#discord bot

6 messages · Page 1 of 1 (latest)

runic elk
#

Hey does anyone know what to do when you get this error

NameError: name 'discord' is not defined

prime siren
#

you can't use a library without importing it

#

assuming you use discord.py, it would be something like this

import discord

intents = discord.Intents.default()
intents.messages = True
intents.message_content= True

client = discord.Client(intents=intents)

@client.event()
async def on_ready():
  print("I am online!")

client.run("TOKEN")
#

and it's important to also have the discord.py library installed on the server otherwise it can't import it

runic elk