【问题标题】:would it be possible to make a system that gives a role if they type in a certain channel using discord.py如果他们使用 discord.py 在某个频道中键入内容,是否有可能制作一个赋予角色的系统
【发布时间】:2020-09-19 03:37:08
【问题描述】:

是的,所以我试图为角色扮演服务器制作一个机器人,我想要它,以便当具有“No oc”角色的人在角色提交中创建角色时,它会给他们“等待批准”角色这可能吗?

【问题讨论】:

    标签: python discord discord.py


    【解决方案1】:

    您可以使用on_message 事件:

    @client.event
    async def on_message(message):
    
        if message.content == 'Give Me The Role With ID 123456789': # text goes there
            role = message.guild.get_role(123456789) # role ID goes there
            await message.author.add_roles(role, reason='Bot Role')
    
    

    【讨论】:

      猜你喜欢
      • 2019-10-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-03-26
      • 1970-01-01
      • 2021-04-03
      • 2019-06-01
      相关资源
      最近更新 更多