通过名称 discord.py 获取角色

时间:2021-07-11 19:20:05

标签: python discord discord.py

我有一个名为 config.py 的文件,其中包含我的一些可能会更改的文本/角色名称。没有 ctx ,我如何获得角色? 我的配置文件:

import discord
footertext = "Neon Bot"
footerimg = "https://cdn.discordapp.com/icons/701555647011094571/a_5efe08a3085601499b9c53adf16e5e43.gif?size=1024"
prefix = "."
failed = "unknown"
neonstaffrole = discord.utils.find(lambda r: r.name == "-『?』· ????-?????", ctx.message.guild.roles)

我不知道如何在不使用 ctx 的情况下完成 neonstaffrole = discord.utils.find(lambda r: r.name == "-『?』· ????-?????", ctx.message.guild.roles) 所做的事情。

0 个答案:

没有答案
相关问题