Commit 83e768a5 authored by nanahira's avatar nanahira

logging

parent 5feb8a1a
......@@ -33,6 +33,15 @@ export default class GuildVerifier {
@UseEvent('guild-request')
private async onGuildRequest(session: Session) {
const userDisplayName = `${session.username || '未知用户'}(${
session.userId
}) `;
const guildDisplayName = `${session.guildName || '未知群组'}(${
session.guildId
})`;
this.logger.info(
`${session.messageId}: ${userDisplayName} invited ${session.selfId} to ${guildDisplayName}.`,
);
if (session.userId && this.config.isAdmin(session.userId)) {
return session.bot.handleGuildRequest(session.messageId, true);
}
......@@ -41,11 +50,7 @@ export default class GuildVerifier {
}
return session.bot.sendMessage(
this.config.notifyGuildId,
`${session.username || '未知用户'}(${session.userId}) 邀请我加入群 ${
session.guildName
}(${session.guildId}) 。\n请私聊发送我 verify.accept ${
session.messageId
} 同意。\n请私聊发送我 verify.reject ${session.messageId} 拒绝。`,
`${userDisplayName} 邀请我加入群 ${guildDisplayName} 。\n请私聊发送我 verify.accept ${session.messageId} 同意。\n请私聊发送我 verify.reject ${session.messageId} 拒绝。`,
);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment