The Student Room Group

Python Code

Hello, I am coding a discord bot for my special interest can I have some help, please? The code format is this:

# bot.py
import os

import discord
from dotenv import load_dotenv

load_dotenv()
TOKEN = os.getenv('DISCORD_TOKEN')

client = discord.Client()

@client.event
async def on_ready():
print(f'{client.user} has connected to Discord!')

client.run(TOKEN)

How do I make this work?
(edited 3 years ago)
Original post by the_cosmo_guy


Thanks
Original post by WrenTheBest2004
Thanks

nw

Quick Reply

Latest

Trending

Trending