global t
t = 0
@bot.command()
async def ping(ctx, member: discord.Member):
while True:
await ctx.channel.send(member.mention)
@bot.event
async def on_message(message):
try:
if message.author == member:
t = 5 #(A)
return
except:
pass
if t == 5:
break
Line (A) shows an error. I assumed the problem was that the variable t was not carrying through the @bot.event, but it seems like even the global command does not work. Is there some other problem that I just don't see?