Discord Bot in Python (Full Copy & Paste Code)

import os
import discord

TOKEN = os.getenv('DISCORD_TOKEN')

client = discord.Client()

@client.event
async def on_ready():
    print(f'Logged in as {client.user}')

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

    if message.content == 'Hi bot':
        await message.channel.send('Hello human!')

client.run(TOKEN)

<< Return To Python Discord Bot Tutorial