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="")
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)
#AttributeError module 'discord' has no attribute 'Bot'
1 messages · Page 1 of 1 (latest)
can you show the pycord version?
pycord or py-cord? ;3
py-cord is what i have
show the pip list
you have discord and discord.ui installed
And discord.py
uninstall all and install py-cord new
can you use /close?
I'll close it