Answer the question
In order to leave comments, you need to log in
Why doesn't the code run? Where is the mistake?
Error:
Traceback (most recent call last):
File "bot.py", line 465, in
@client.event()
TypeError: event() missing 1 required positional argument: 'coro'
@client.event()
async def on_group_remove(ctx, channel, member):
cursor.execute("UPDATE users SET onchannel = 0 WHERE name = {}").format(member.name)
@client.event()
async def on_group_join(ctx, channel, member):
cursor.execute("UPDATE users SET onchannel = 1 WHERE name = {}").format(member.name)
async def vccash(ctx):
while True:
for x in cursor.execute("SELECT onchannel, name FROM users").fetchall():
if x[0] == 1:
cursor.execute("UPDATE users SET cash = cash + 1 WHERE name = {}").format(x[1])
await asyncio.sleep(20)
Answer the question
In order to leave comments, you need to log in
The decorator client.event
should not be called: https://discordpy.readthedocs.io/en/v1.4.1/api.htm...
@client.event # вызов функции-декоратора (скобки) отсуствует
async def on_ready():
print('Ready!')
on_group_*
on the bot client are absolutely useless, since discord does not provide the ability to add bots into "groups"on_guild_*
The error is likely due to a missing required "coro" argument.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question