0

I need help with my bot, I coded it all before but then something happened and I made a new one and it just isn’t working when I run the code it works fine but the bot isn’t online or responding to the commands

import discord 
from keep_alive import keep_alive 

client = discord.Client() 

@client.event async def on_ready(): print('we have logged in as {0.user}').format.client

@client.event async def on_message(message): 
  
  
if message.author == client.user: return 

if message.content.startswith('$cmds'): 

await message.channel.send("Hello! how are you, my current commands are $cmds and $ping more coming soon!") keep_alive() client.run(os.getenv("Token"))

enter image description here

[enter image description here][2]

[2]: https://i.stack.imgur.com/URmvr.jpg![enter image description here](https://i.stack.imgur.com/ei20c.jpg)

Whatic
  • 11
  • 4

1 Answers1

0

It is recommended that you use the commands framework :-

import discord
from discord.ext import commands

@client.command()
async def cmds(ctx):
  await ctx.send("Hello! how are you, my current commands are $cmds and $ping more coming soon!")
ChaoticNebula
  • 263
  • 1
  • 3
  • 18