#AttributeError module 'discord' has no attribute 'Bot'

1 messages · Page 1 of 1 (latest)

quick grove
#
import discord
from discord.ui import Button
from discord.ext import commands

intents = discord.Intents.default()
intents.guilds = True
intents.messages = True
intents.message_content = True
intents.members = True
bot = discord.Bot(command_prefix='%', intents=intents, owner_id=1008485976240304138 )
TOKEN = nope u cant have my token lmao

async def on_ready(ctx):
    ctx.send("bot started")


@bot.command()
async def foo(ctx, arg):
   # button = Button(label="Click Me!", style=discord_ui.ButtonStyle.Blurple, emoji="![razorcop](https://cdn.discordapp.com/emojis/1003367004348108820.webp?size=128 "razorcop")")
    await ctx.send(arg)

@bot.command()
@commands.is_owner()
async def spamping(ctx, arg):
    for i in range(10):
        await ctx.send(arg)


class MyView(discord.ui.View): # Create a class called MyView that subclasses discord.ui.View
    @discord.ui.button(label="Click me!", style=discord.ButtonStyle.primary, emoji="😎") # Create a button with the label "😎 Click me!" with color Blurple
    async def button_callback(self, button, interaction):
        await interaction.response.send_message("You clicked the button!") # Send a message when the button is clicked

@bot.slash_command(guild_ids=[1003031800836272158]) # Create a slash command
async def button(ctx):
    await ctx.respond("This is a button!", view=MyView()) # Send a message with our View class that contains the butto



bot.run(TOKEN)
golden relic
#

can you show the pycord version?

quick grove
#

this is pycord...

#

or maybe im super dumb

golden relic
#

pycord or py-cord? ;3

quick grove
#

py-cord is what i have

golden relic
#

show the pip list

quick grove
golden relic
#

you have discord and discord.ui installed

mighty mirage
golden relic
#

uninstall all and install py-cord new

quick grove
#

alr

#

so it should look like this?

#

@golden relic

golden relic
#

yes

#

restart the editor

quick grove
#

it worked

golden relic
#

can you use /close?

compact gust
#

I'll close it