【发布时间】:2020-01-16 12:48:45
【问题描述】:
您好,我需要像 $ID=(CHANNEL_ID) 这样的命令来定义机器人将发送 NSFW 内容的频道 ID,我想要分享并且我不想让任何人编辑代码,可以这样做吗??
async def nsfw(ctx):
check_role = get(ctx.message.guild.roles, name='Leader')
if check_role in ctx.author.roles:
channel = bot.get_channel(611574273588461580)
randomlist = [' msg1 ', ' msg2 ']
await channel.send(random.choice(randomlist))
await ctx.send('*hint: bot sending nsfw commands only into nsfw channel! check #nsfw*')
【问题讨论】:
-
机器人会成为多个服务器的成员吗?每个服务器都应该有自己的频道吗?您是否已经有任何持久存储,例如数据库或 json 文件?
-
是的,机器人将在更多服务器上,不,我没有任何数据库或 .json 文件
标签: python command bots discord discord.py