When I try to combine a command and an event only one of them works while the other doesn't.
import discord
import random
from discord.ext import commands
client = commands.Bot(command_prefix='.')
@client.event
async def on_ready():
print('I am ready.Let us begin')
@client.command(aliases=['8ball'])
async def _8ball(ctx, *, question):
responses = ['Razsamaha.',
'Profesor Iks',
'Jen Grei',
'Shelma']
await ctx.send(f'Question: {question}\nAnswer:{random.choice(responses)}')
@client.event
async def on_message(message):
if message.author == client.user:
return
if message.content.startswith('hello'):
await message.channel.send('Hello!')
client.run('')
The first @client.event works in both cases, whether only with the 8ball command or the hello event. The issue is that when I try to run them both (the 8ball command and the hello event) together, only the one of them works, yet on their own, they both work okay. Where am I messing up? I only just installed python today.