from config import config import discord intents = discord.Intents(messages=True) client = discord.Client(intents=intents) @client.event async def on_ready(): print(f'We have logged in as {client.user}') @client.event async def on_message(message): if message.author.name in config['bot']['whitelist']: if message.content == 'info': await message.channel.send('Hello!') else: print("user not authorized") client.run(config['bot']['token'])