Использование ctx.guild.id не работает в процессоре Discord.py. Что я должен делать? ⇐ Python
Использование ctx.guild.id не работает в процессоре Discord.py. Что я должен делать?
I have a discord.py bot and I’ve just expanded to cogs, but now when I run a command that needs to access ctx.guild.id but I'm getting an error assuming that I’m trying to get cogname.guild.id. What should I change to fix this?
I tried:
Class cogname(commands.cog): @commands.hybrid_command(name=“testcommand”) async def testcommand(ctx): ctx.send(data[ctx.guild.id]) I expected the json data for the guild to be sent, but I get an error saying that the class mycog doesn’t have an attribute guild. What should I do?
I'm using the latest version of everything.
Источник: https://stackoverflow.com/questions/780 ... hould-i-do
I have a discord.py bot and I’ve just expanded to cogs, but now when I run a command that needs to access ctx.guild.id but I'm getting an error assuming that I’m trying to get cogname.guild.id. What should I change to fix this?
I tried:
Class cogname(commands.cog): @commands.hybrid_command(name=“testcommand”) async def testcommand(ctx): ctx.send(data[ctx.guild.id]) I expected the json data for the guild to be sent, but I get an error saying that the class mycog doesn’t have an attribute guild. What should I do?
I'm using the latest version of everything.
Источник: https://stackoverflow.com/questions/780 ... hould-i-do
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение
-
-
Бот разногласий Python ctx.guild.voice_client.disconnect() не работает
Anonymous » » в форуме Python - 0 Ответы
- 10 Просмотры
-
Последнее сообщение Anonymous
-
-
-
При использовании ctx.moveto () с HTML Canvas Tag Ctx.arc (), moveto () рисует линию
Anonymous » » в форуме Html - 0 Ответы
- 8 Просмотры
-
Последнее сообщение Anonymous
-
-
-
При использовании ctx.moveto () с HTML Canvas Tag Ctx.arc (), moveto () рисует линию
Anonymous » » в форуме Javascript - 0 Ответы
- 12 Просмотры
-
Последнее сообщение Anonymous
-
-
-
При использовании ctx.moveto () с HTML Canvas Tag Ctx.arc (), moveto () рисует линию
Anonymous » » в форуме Html - 0 Ответы
- 9 Просмотры
-
Последнее сообщение Anonymous
-
-
-
При использовании ctx.moveto () с HTML Canvas Tag Ctx.arc (), moveto () рисует линию
Anonymous » » в форуме Html - 0 Ответы
- 16 Просмотры
-
Последнее сообщение Anonymous
-