无法向该用户发送消息 [英] Cannot send messages to this user

查看:20
本文介绍了无法向该用户发送消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在做一个不和谐的替代生成器.基本的想法是,我输入 !generate 并且机器人 dm 是我的帐户.我的问题是我的机器人无法向消息的作者发送任何消息.我收到无法向该用户发送消息".

I'm doing a discord alt generator. the basic idea is, I type !generate and the bot dm's me with an account. my problem is that my bot can't send any messages to the author of the message. I'm getting "Cannot send messages to this user".

律码

let embed = new Discord.RichEmbed()
 .addField("alt", `account: 
${random}`)
 .setColor("#fffff");
message.author.send(embed);

random 函数选择随机 alt(例如 test:test 来自 txt 文件).

random function picks random alt ( test:test for example from a txt file ).

感谢任何帮助.谢谢

推荐答案

您向其发送 RichEmbed 的用户可能禁用了来自服务器成员的 DM.

确保 message.author 没有在其隐私设置中禁用来自服务器成员的 DM.

Make sure that message.author does not have DM's from server members disabled in their privacy settings.

这篇关于无法向该用户发送消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆