#intents not defined

1 messages · Page 1 of 1 (latest)

slim elmBOT
crimson hare
#

i get this error right here Exception has occurred: NameError
name 'intents' is not defined
File "C:\Users\doree\OneDrive\Documents\topg\main.py", line 8, in <module>
bot = discord.Bot(intents=intents)

#

this is the code import os
import discord
import random
from discord import Intents
from discord.ext import commands
from discord.commands import Option

bot = discord.Bot(intents=intents)

token= ""

@Bot.slash_commands(description="echo a message")
async def echo(ctx, echo: Option(str, "Enter the message you want this bot to say!")):
await ctx.respond(echo)

@Bot.slash_commands(description="nuke a user")
async def nuke(ctx, user: Option(discord.User, "Enter the user you want to nuke!")):
responses = [f"nuking {user}!", "congrats you started world war 3", "looks like the commander didnt sign off your lucky! :,)", f"sorry, but {user} is part of nato", "gay midget porn"]
await ctx.respond(random.choice(responses))

@Bot.slash_commands(description="rob a user")
async def rob(ctx, user: Option(discord.User, "Enter the user you want to rob!")):
responses = [f"Robbing {user}!", "gun ran out of ammo your dead!", "looks like your dumb you tried to rob a cop😂 :,)", f"Sorry, but {user} is a old lady", "penis in my mouth"]
await ctx.respond(random.choice(responses))

class MyModal(discord.ui.Modal):
def init(self, *args, **kwargs) -> None:
super().init(*args, **kwargs)

    self.add_item(discord.ui.InputText(label="type issue here", style=discord.InputTextStyle.long))

async def callback(self, interaction: discord.Interaction):
    embed = discord.Embed(title="issue")
    embed.add_field(name="Descrbe the issue", value=self.children[0].value)
    await interaction.response.send_message(embeds=[embed])

@Bot.slash_commands(description="report an issue in the server")
async def issue(ctx: discord.ApplicationContext):
"""Report An Issue In The Server."""
modal = MyModal(title="Report A problem")
await ctx.send_modal(modal)

@Bot.event
async def on_ready():
print(f'Logged in')

bot.run(token)