Botは無視するように

This commit is contained in:
syuilo 2019-01-15 18:52:20 +09:00
parent 2f916de51c
commit 93532bcf7f
No known key found for this signature in database
GPG key ID: BDC4C49D06AB9D69
2 changed files with 7 additions and 0 deletions

View file

@ -130,6 +130,12 @@ export default class 藍 {
private async onReceiveMessage(msg: Message): Promise<void> {
this.log(chalk.gray(`<<< An message received: ${chalk.underline(msg.id)}`));
// Ignore message if the user is a bot
// To avoid infinity reply loop.
if (msg.user.isBot) {
return;
}
const isNoContext = !msg.isDm && msg.replyId == null;
// Look up the context

View file

@ -3,4 +3,5 @@ export type User = {
name: string;
username: string;
isFollowing: boolean;
isBot: boolean;
};