(first I will say that most of the code is copied)
import discord
from discord.ext import commands
Token = 'long'
Bot = Commands.bot (Command_Prefix = '!')
@ Bot.Event
ASYNC DEF ON_REDY ():
PRINT ('LOGGED IN AS')
Print (Bot.user.name)
Print (Bot.user.id)
Print ('------')
@ Bot.comMand (Pass_Context = True)
ASYNC DEF Jacot (CTX):
Print ('Received Jacot' command)
Ctx.send ('OK')
@ Bot.comMand (pass_context = true) # Let me transmit the alarms
ASYNC DEF TEST (CTX, ARG): # Create an asynchronous poundation of the bot
AWAIT CTX.SEND (ARG) # send back argument
Bot.Run (Token)
and error
RuntimeWarning: Coroutine 'Messageable.send' Was Never Awaited
On the ‘Yakot’ Team
Answer 1, Authority 100%
Any korutin must be “expectable”. This is done using the AWAIT
instruction.
This code will be correct:
@ bot.command (Pass_Context = True)
ASYNC DEF Jacot (CTX):
Print ('Received Jacot' command)
AWAIT CTX.SEND ('OK')