【问题标题】:discord.js - Send image on member ban?discord.js - 发送关于成员禁令的图像?
【发布时间】:2021-04-01 16:26:50
【问题描述】:

您好,所以我希望我的机器人在有人被例如 dyno 禁止时在一般聊天中发送图像,但我不知道该怎么做,如果有人可以提供帮助,我将不胜感激!

【问题讨论】:

  • 你有来自(失败的)尝试的代码吗?如果是,请分享:)

标签: discord.js


【解决方案1】:

您将为guildBanAdd 创建一个监听器,并在用户被禁止时向特定频道发送消息。

client.on('guildBanAdd', (guild, user) => {
    if(guild.id === 'GuildID') {
        const notificationChannel = guild.channels.cache.find(c => c.name === 'general');
        notificationChannel.send('Message', {files: ['image address/url']});
    }
});

【讨论】:

    猜你喜欢
    • 2021-02-19
    • 2020-10-08
    • 2021-11-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-06-28
    • 2020-10-09
    • 1970-01-01
    相关资源
    最近更新 更多