I've been trying to create a view (for buttons), but it keeps throwing up the same error, saying discord has no attribute ui. When I try to import views, using from discord.ui import view, it says there's no discord.ui module
Can't seem to find a suitable answer on any other forum/thread (in this server)
any help is welcome
Please note that I've uninstalled and reinstalled py-cord multiple times T_T
Thanks :D
#I think the discord.ui module is not importing?
1 messages · Page 1 of 1 (latest)
could you install rc1?
with pip install py-cord==2.0.0rc1
also make sure discord.py is uninstalled
ill just try that, although i think ive already tried...gimme a moment :p
okay so discord.ui still isnt registering 😭😭
and for some reason, my old prefixed commands dont seem to work T_T (lol deleted this by mistake)
from discord.ext import commands
import sys
bot = commands.Bot(command_prefix="!")
@bot.event
async def on_ready():
print(f'Logged in as {bot.user}')
print('Status Online')
await bot.change_presence(status = discord.Status.online, activity = discord.Game('!help'))
@bot.command()
async def ping(ctx):
await ctx.send("Pong!")
@bot.command()
async def hi(ctx):
await ctx.send("hi")
@bot.command()
async def button(ctx):
await ctx.send("This is a button!")
bot.run('<token>')
def p(*args):
sys.stdout.flush(args[0] % (len(args) > 1 and args[1:] or []))``` This is the base code (relearning some stuff), dunno if this'll help
?tag message-content
As of PyCord beta 5 (which uses API v10), specifying the message content intent will be required for receiving message content.
You will need to enable the intent on the developer portal, as well as in your code:
intents = discord.Intents.default()
intents.message_content = True
Docs: https://docs.pycord.dev/en/master/api.html#discord.Intents.message_content
If you have a verified bot, it is only a matter of time before you a required to use Slash Commands, unless you have a valid use case, which can be seen here: https://support.discord.com/hc/en-us/articles/4410940809111-Message-Content-Intent-Review-Policy
No, the bot isnt verified yet...but i get that ill have to add slash commands too