【发布时间】:2018-06-14 06:13:50
【问题描述】:
所以我有一个用 python3.6 制作的不和谐机器人,我希望他创建一个文本频道,但仅限于管理员。
我知道如何使用await client.create_channel() 创建文本频道,但我不知道如何设置自定义权限以及如何向其发送消息。
谢谢!
我的代码(以备不时之需):
@client.event
async def discord.on_server_join(server):
await client.send_message(channel, "Thank you for using Phantom. From all the developers, we want to thank you, as we know there are thousands of other bots out there.")
await client.send_message(channel, "You should see that a new channel was created and is called \"Phantom\". That is the phantom moderation channel and is used for administrating your phantom instance.")
server = ctx.message.server
await client.create_channel(server, "Phantom", type=discord.ChannelType.text)
@client.event
async def on_message(message):
# The code continues here, but I think you only need the on_server_join function.
【问题讨论】:
标签: python-3.x discord discord.py