#I think the discord.ui module is not importing?

1 messages · Page 1 of 1 (latest)

peak trench
#

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

pastel atlas
#

with pip install py-cord==2.0.0rc1

peak trench
#

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
glacial willow
#

restart vscode maybe

#

might help

gilded surgeBOT
pastel atlas
peak trench