V
V
Vladislav the Wise2020-04-22 15:17:28
Python
Vladislav the Wise, 2020-04-22 15:17:28

Why are the commands in the discord bot not working?

So, I decided to write a bot on the discord and met with the problem that the commands do not work for me, I surfed the Internet and did not find any help and does not give an error

import discord
from discord.ext import commands
from random import *

client = discord.Client()
bot = commands.Bot(command_prefix='!')
@client.event
async def on_ready():
    print('I has been started - {0.user}'.format(client))
@bot.command()
async def helpme(ctx):
    await print('seconds:{}'.format(randint(0,10)))
    await ctx.send('Привет, вот мои комманды:\n'
             '-/help Вызвать это меню')
@bot.command()
async def greet(ctx):
    await ctx.send(":smiley: :wave: Hello, there!")
@client.event
async def on_message(message):
    print(message.content)
    if message.author == client.user:
        return
    if 'dexter' in message.content.lower() or 'дэкстер' in message.content.lower():
        await message.channel.send('Hi!')
        await message.channel.send('Я могу ничего, Ха. Ха')
    if '702253949838819438' in message.content:
        await message.channel.send('Отстань блять')        

try:
 bot.add_command(helpme)
 bot.add_command(greet)
except:
    pass
client.run('ТОКЕН')

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladislav the Wise, 2020-04-22
@yungtitanium

THE QUESTION IS CLOSED

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question