move hello function

This commit is contained in:
deflax 2024-01-15 23:48:20 +02:00
parent e94081b747
commit 6917f489d3

View file

@ -16,12 +16,15 @@ client = discord.Client(intents=intents)
async def on_ready(): async def on_ready():
print(f'Logged in as {client.user}') print(f'Logged in as {client.user}')
async def hello(message):
await message.channel.send('Hello!')
@client.event @client.event
async def on_message(message): async def on_message(message):
if message.author == client.user: if message.author == client.user:
return return
if message.content.startswith('!hello'): if message.content.startswith('!hello'):
await message.channel.send('Hello!') await hello(message)
client.run(bot_token) client.run(bot_token)