mirror of
https://github.com/syuilo/ai.git
synced 2024-12-22 08:21:08 +00:00
Botは無視するように
This commit is contained in:
parent
2f916de51c
commit
93532bcf7f
|
@ -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
|
||||
|
|
|
@ -3,4 +3,5 @@ export type User = {
|
|||
name: string;
|
||||
username: string;
|
||||
isFollowing: boolean;
|
||||
isBot: boolean;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue