0

Here's my code. It's still in early development. Also, I'm fairly new to developing bots.

import discord
from discord.ext import commands

client = discord.Client()
bot_prefix: str = ">"
client = commands.Bot(command_prefix=bot_prefix)


@client.event
async def on_ready():
    print('Miska Rise')

Here's the one event I have right now:

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

    if message.content.startswith('woof') or message.content.startswith('Woof'):
        await message.channel.send('Bork!')

Here's the command:

@client.command()
async def ping(ctx):
    await ctx.send('Pong!')
Harmon758
  • 5,084
  • 3
  • 22
  • 39

1 Answers1

1

If you override on_message, you need to call Bot.process_commands in it, so that commands are still processed.

See the Why does on_message make my commands stop working? section of the FAQ in the documentation.

Harmon758
  • 5,084
  • 3
  • 22
  • 39