add username to hello message

This commit is contained in:
2021-11-20 18:45:00 +01:00
parent c5e69d7b15
commit 43b6aa067c

View File

@@ -17,12 +17,14 @@
## Imports ## Imports
import discord import discord
import json import json
from discord import user
from lib.keep_alive import keep_alive from lib.keep_alive import keep_alive
from lib.help import * from lib.help import *
## Vars ## Vars
client = discord.Client() client = discord.Client()
with open("bot.json", 'r') as f: with open("bot.conf", 'r') as f:
BOTDATA = json.load(f) BOTDATA = json.load(f)
## Run ## Run
@@ -40,7 +42,7 @@ async def on_message(message):
await message.channel.send(help) await message.channel.send(help)
if message.content.startswith(BOTDATA['prefix'] + 'hello'): if message.content.startswith(BOTDATA['prefix'] + 'hello'):
await message.channel.send('Hello!') await message.channel.send("Hello, {}!".format(message.author))
keep_alive() keep_alive()
client.run(BOTDATA['token']) client.run(BOTDATA['token'])