mirror of
https://github.com/syuilo/ai.git
synced 2024-11-14 01:37:59 +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> {
|
private async onReceiveMessage(msg: Message): Promise<void> {
|
||||||
this.log(chalk.gray(`<<< An message received: ${chalk.underline(msg.id)}`));
|
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;
|
const isNoContext = !msg.isDm && msg.replyId == null;
|
||||||
|
|
||||||
// Look up the context
|
// Look up the context
|
||||||
|
|
|
@ -3,4 +3,5 @@ export type User = {
|
||||||
name: string;
|
name: string;
|
||||||
username: string;
|
username: string;
|
||||||
isFollowing: boolean;
|
isFollowing: boolean;
|
||||||
|
isBot: boolean;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue