#๐Ÿ”’ type annotation for member object

103 messages ยท Page 1 of 1 (latest)

viral helm
#

I want to allow only member as param discord.ext

analog rainBOT
#

@viral helm

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

rotund escarp
#

Be more detailed in your question

viral helm
kind moss
viral helm
#

So it's just the Member object bruh brainmon

kind moss
#

yeah

viral helm
#

Bruh

kind moss
#

that's how it works for most objects

#

if you wanted a user, you'd do user: discord.User

viral helm
viral helm
#

Of Member object and user object?

kind moss
#

Users aren't in a guild

#

Members are in a guild

viral helm
#

Owh

#

@kind moss I'll take this note thanks

kind moss
#

np

kind moss
#

a CommandTree

viral helm
#

Its the slash command of discord extension

kind moss
#

!d discord.app_commands.CommandTree

analog rainBOT
#

class discord.app_commands.CommandTree(client, *, fallback_to_global=True)```
Represents a container that holds application command information.
rotund escarp
#

Thank you!

viral helm
#

Well I use discord.ext.commands.Bot.tree

viral helm
viral helm
#

Eh

#

How to initialize it?

viral helm
rotund escarp
viral helm
#

Hmmmmm

kind moss
viral helm
#

So it don't use "Bot" object

kind moss
#

it doesn't have to

#

you should only use commands.Bot if you're using prefix commands

#

otherwise, use discord.Client

#

(for the most part)

viral helm
#

It will not ask for prefix

kind moss
#

it just does a lot of extra unnecessary processing

#

it's more relevant to ask the question "why should I use the Bot class"

viral helm
rotund escarp
viral helm
#

But mostly it's same as Bot.tree.command???

kind moss
#

if you want to use prefix commands haha

rotund escarp
kind moss
#

Bot subclasses Client and adds prefix commands

rotund escarp
#

Ah

kind moss
#

and the default ?help command

kind moss
#

it does self.tree = CommandTree(self)

viral helm
#

Hmmmmm

kind moss
#

so yes it's equivalent

viral helm
#

So Bot.tree is. CommandTree subclass?

kind moss
#

Type:
CommandTree

viral helm
#

!d discord.ext.commands.Bot.tree

#

Hmmm

#

@kind moss just a question

#

Why I can't use discord.ext

#

I have to install pycord to make it work

#

Idk why

kind moss
#

you're probably just using it wrong

#

if you share some code and an error then we can tell you how to fix it

#

but I gtg so someone else can help

#

good luck

viral helm
#

It will trow a error

#

And it can't be fix

#

U don't have to run the bot

#

It will error on commands.Bot() part

kind moss
#

Again, you're probably just using it wrong

#

If you show some code and an error we can tell you how to fix it

viral helm
#

Git

#

Its hard to paste code on git I have no pc

kind moss
#

just send some code and an error

#

i don't need to see a whole repository

viral helm
kind moss
#

And what error do you get?

viral helm
#

Just try it on replit

#

I cant use replit

#

Well the use is

#

I have to install pycord

#

Idk y

viral helm
#

I'll delete my pycord

viral helm
#

Hmm

#

It works

#

Dono y

viral helm
#

But I can't replicate it now

#

Wierd

grave palm
#

Client doesn't have those

kind moss
analog rainBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.