【发布时间】:2021-02-04 19:12:37
【问题描述】:
我需要这个 Mass Dm 给除作者之外的所有人发消息 但是我真的不知道该怎么做...
@bot.command()
async def massdm(self, ctx, *, args=None):
if args != None:
members = ctx.guild.members
for member in members:
try:
await member.send(args)
print("'" + args + "' sent to: " + member.name)
except:
print("Couldn't send '" + args + "' to: " + member.name)
else:
await ctx.channel.send("A message was not provided.")
【问题讨论】:
-
代码好像没问题,有什么错误吗?
-
没有任何错误,但我需要它给除作者以外的所有人发消息
-
你的 discord.py 版本是多少?
-
最新,我 3 天前刚刚更新。
标签: python discord.py discord.py-rewrite