#General Help

1 messages · Page 30 of 1

slender lintel
#

I'm stumped

#

I need coffee

past gate
#

I'm so confused now

slender lintel
#

☕ coffee

#

@past gate & @slender lintel will u join my server?

#

@slender lintel can you add me to your repl?

#

If that's all ok with you?

frigid elm
slender lintel
#

If not I'll still try my best to troubleshoot from this side

half marsh
slender lintel
half marsh
#

Send full tb

slender lintel
#

What if

past gate
slender lintel
#

It's actually not that function 💀

past gate
#

😭

#

that is what I was suggesting

slender lintel
#

I spent the whole time trouble shooting something that worked 💀

half marsh
#

Yee this is not helping

#

Gotta see full tb

slender lintel
#

say wut u all want

#

Dr paswa is here 🥸

#

Let me see

frigid elm
slender lintel
#

What 💀

slender lintel
frigid elm
slender lintel
#

Like everything in red

half marsh
slender lintel
#

What does the syntax error say?

frigid elm
half marsh
#

On your insert execution

frigid elm
#

oj wait

#

lemme try

slender lintel
#

If that was the error I'm folding myself

frigid elm
slender lintel
frigid elm
#

t.

frigid elm
slender lintel
#

Oh

frigid elm
#

also another weird thing is i had to convert ctx.author.id to string even tho in the db its set as bigint but it threw an error saying it expected str but got int

fringe hatch
#

this should instant-register a command for the guild. right?

fringe hatch
#

but it isn't

frigid elm
#

no wait

fringe hatch
#

um

frigid elm
#

its for slash commands i think

fringe hatch
#

yea

frigid elm
#

try debug_guilds?

fringe hatch
#

oh wait, do i need to use @slash.command ?

frigid elm
#

yee

fringe hatch
slender lintel
half marsh
frigid elm
#

in pgadmin

#

or

#

in the code

fringe hatch
#

what's the diff b/w bot and slash and user commands?

slender lintel
#

I'm trying to help on phone. Lemme get on my pc

slender lintel
#

Bot commands have a command prefix

#

Like !,#,?

half marsh
#

Also create a thread pls

fringe hatch
slender lintel
#

my dear friend

frigid elm
slender lintel
#

help me

slender lintel
slender lintel
fringe hatch
frigid elm
slender lintel
frigid elm
fringe hatch
slender lintel
slender lintel
frigid elm
slender lintel
frigid elm
fringe hatch
frigid elm
slender lintel
#

ok fine

#

IIf u don't

frigid elm
#

its so confusing

slender lintel
#

Like discord literally won't let me

slender lintel
#

Yea true

frigid elm
slender lintel
#

💀

#

Lemme do that

slender lintel
#

Bro you gotta see my server list 💀

frigid elm
#

mines full oh nsfw

slender lintel
#

Sure

#

Dms

frigid elm
#

@half marsh any idea

half marsh
#

No idea

frigid elm
#

damn

half marsh
frigid elm
frigid lark
#

eh what?

frigid elm
#

how do i make a webhook and store it in a variable

frigid elm
warped jacinth
#

i upgraded to 2.0 and now get_cog returns None. i don't see any changes

frigid lark
frigid elm
#

also when u defined client

#

was it

#

bridge.Bot?

frigid lark
#

Its commands.command

frigid elm
#

when u defined client

frigid lark
#

Its a cog

frigid elm
#

and? in main.py how did u define client

slender lintel
#

or subclassed it

slender lintel
#

one sec let me look at the docs

frigid elm
slow dome
frigid elm
# slow dome

ik how to create it but idk how i would store that webhook in a variable

frigid lark
#
class Client(bridge.Bot):
    def __init__(self, command_prefix=">>", help_command=None, **options):
        super().__init__(command_prefix, help_command, **options)

client = Client(debug_guilds=[ID], case_intensitive=True, intents=discord.Intents.all())
slender lintel
slow dome
frigid elm
#

ig no

slow dome
#

yes

frigid elm
#

oh ok

#

and

slender lintel
#

also in a cog you use the decorator @bridge.bridge_command() I believe?

slow dome
frigid elm
#

kk

slow dome
#

you can store the url of that webhook and create another aiohttp session when you want to use it

frigid elm
#

mb im

#

confused asf

slow dome
frigid lark
#
@commands.command(aliases=["r", "rt"], description="Restart the Bot")
async def restart(self, ctx):

    if ctx.author.id == ID:
        await ctx.respond("Restarting...")
        os.system("clear")
        os.execv(sys.executable, ["python"] + sys.argv)

    else:
        await ctx.respond("You are not the Owner of the Bot!")
frigid elm
frigid lark
slow dome
#

or maybe it's just commands depending on your imports

frigid lark
knotty sequoia
#

I want to pass in a variable for the callback function

frigid elm
#

or create and store in only one session

#

why does every prefix cmd run twice

#

but slash cmds only once

#

even in the terminal if i do a prefix cmd and it has an error it prints it twice

slow dome
slow dome
frigid elm
slow dome
#

discord.ext.bridge

frigid lark
slow dome
#

the one that’s a BridgeCommand

frigid lark
#

a prefix command

slow dome
#

is it imported or what

frigid lark
#

eh, it works on my PI but not on my main system

#

a normal command with a bridge command bot

slow dome
frigid elm
#

i sue bridge commands but prefixed commands run twice idk why

plush tusk
#

need some help guys.
im trying get user's color from discord.Member attributes (user.color.value), but it returns me all time 0. And i can't get user's status (like online/offline), it returns me "offline" all times. how i can fix it?
all intents is enabled (screenshot)

frigid lark
umbral bramble
#

Did someone managed to make the slash commands work?

frigid lark
#

yes

slow dome
#

lmao

umbral bramble
little isle
#

on_message_delete() only seems to be called if the bot was online at the time the message was posted. If I post, then start the bot, then delete the message, the event isn't fired.

Is this expected behavior?

slow dome
little isle
# frigid elm yes

Disappointing. I assume it's a Discord thing, not a library thing. Thanks

slow dome
little isle
#

I didn't know if it was cached or if Discord just sent the whole message

#

Like it does with context commands (which do work if the bot wasn't online)

sudden path
slow dome
#

You may need to fetch the member then receive this info

frigid lark
little isle
slow dome
#

so it’s in the cache

little isle
#

Actually, looks like on_raw_message_delete is a thing. Nice

slow dome
little isle
#

Called when a message is deleted. Unlike on_message_delete(), this is called regardless of the message being in the internal message cache or not.

plush tusk
little isle
inland lance
#

why my logging format and level don't work ?

frigid lark
inland lance
#

that error isn't a problem the bot is turn on but just logging don't work

#

an other idea ?

frigid lark
#

does it still happend after you install the PyNaCl?

frigid lark
#

If I have every time an error some stuff doesnt work

plush tusk
inland lance
#

pycord ignore that error because we don't need PyNaCl if we don't use it

plush tusk
#

isn't it?

inland lance
#

i will try it

#

logging.basicConfig return None

plush tusk
#

nvm...

gusty pendant
#

can you only use InputText with Modals? 👀

frigid lark
inland lance
#

I installed PyNaCl and logging still don't work

plush tusk
#

it's trouble with logger

inland lance
#

yes i know

#

but i don't know why

gusty pendant
#

is your log stuff just not showing up in the terminal? is that the problem?

plush tusk
#

showing in wrong format

inland lance
#

both don't work

#

showing info level

#

and format

gusty pendant
#

you probably wanna instead make your own logger, instead of using basicConfig

logger = logging.getLogger("discord") # this creates your logger
log_format = logging.Formatter("[%(asctime)s]:[%(levelname)s:%(name)s]: %(message)s") # sets logger format

console_handler = logging.StreamHandler()
console_handler.setFormatter(log_format)

logger.addHandler(console_handler)  # adds console handler to our logger
logger.setLevel(LOG_LEVEL)

handler = logging.FileHandler(filename=LOG_FILE, encoding="utf-8", mode="w")
handler.setFormatter(log_format)

logger.addHandler(handler)  # adds filehandler to our logger
#

this is what I use, probably not perfect or ideal but it works

plush tusk
#

anyway loguru is better

#

)0)

gusty pendant
inland lance
#

It's weird because the logs were working fine 10 minutes ago, I'm still programming my bot, nothing to do with the log and now the logs don't work anymore while the bot is working fine.

gusty pendant
#

do you have logging working in another file?

#

like are you working in just one file or do you have multiple

inland lance
#

multiple

gusty pendant
#

again, not an expert on this, but i'm pretty sure you wanna configure all of your logging stuff in the file you actually run, then you can grab child loggers from the other files

#

like in that snippet i posted above, the name of the logger is discord so if I have another file, at the top I'll put logger = logging.getLogger("discord.<somenamehere>")

#

then use logger.info("info message")

inland lance
#

ok ok

#

so if i want only log root I put 'root' in getLogger ?

gusty pendant
#

fairly sure the name you use for logging.getLogger can be whatever you wanna use, it doesn't do anything special apart from identifying separate loggers in separate files

inland lance
#

name is just the name of the logger ?

gusty pendant
#

yes, but I'm fairly sure pycord uses "discord" as their logger name, which is why I make that the root logger name, so it logs all of the bot activity automatically (could be entirely wrong about this, but thats how i understand it)

inland lance
#

here that work xD

#

what is the difference with my other file xD

#

problem found

#

it's because I use logging.info() in an imported file before call logging.basicConfig() in my main file

frigid elm
#

why is my bot running prefixed cmds twice

slow dome
frigid elm
#

no

#

i defined client as discord.ext.commands.Bot

#

and in cogs i use commands.command

#

also yes i have a on_message event but for afk

gusty pendant
gusty pendant
frigid elm
#

uh

#

it deleted

#

its just a normal cmd but it runs twic

#

every command runc twic

#

prefixed command*

gusty pendant
#

i mean can you show me the command itself

#

where it's coded

frigid elm
#

uh

#

dms

#

it keeps deleting

#

but even tiwth default help cmd

gusty pendant
#

you can dm it to me, but just fyi, make sure your bot token is hidden

bright pebble
#

sys:1: RuntimeWarning: coroutine 'Client._run_event' was never awaited
Does anyone know how to fix this? I'm trying to use pycord-ext-ipc but I keep getting this error when I try to start the ipc server.

warped jacinth
#

i have this:

client.load_extension('sql.database')
client.load_extension('cogs.admins')
client.load_extension('cogs.devils')
client.load_extension('cogs.reflex')
client.load_extension('cogs.help')

all are cogs but client.cogs (client = Bot) lists everything except devils and admins . works fine in v1.7.3 but not 2.0

#

idk where to begin as all have similar inits. admins and devils have cmds but so does help

bronze wedge
#

does pycord 2.0 also include the new slash command permissions?

bronze wedge
plush tusk
#

user object from slash_command option

#

or ctx.author

#

status is

user: discord.Member
return user.status
#

source is still same: slash command

bronze wedge
plush tusk
#

im trying get it from attributes

#

for color its user.color.value

#

and for status user.status

bronze wedge
#

does this actually return offline or does it not compare when comparing it with the strings of online etc?

plush tusk
#

all times

bronze wedge
#

should be noted in the docs

plush tusk
#

im watching user

#

not bot

#

sorry, ss is crapped

#

there is

bronze wedge
#

oh so you're not using a bot but instead an actual account

plush tusk
#

wdym?

#

in option?

bronze wedge
#

a discord bot account can't access some values like if a user has nitro etc

#

and I think the user color is one of those

slow dome
plush tusk
#

i must use self bot to get data about status? О.о

icy sluice
#

is the callback when ur bot leave a server called on_guild_leave or on_guild_remove

bronze wedge
hearty rainBOT
bronze wedge
plush tusk
#

so.. how i can fix it?

bronze wedge
#

then I have no idea

plush tusk
#

oh...

icy sluice
plush tusk
#

bloody hell

bronze wedge
#

haven't really touched pycord for the last few months since I waited for the update that was announced today

plush tusk
#

i have no clue why its happening

bronze wedge
slow dome
#

lol

bronze wedge
#

sorry if I'm a lil unfriendly, I'm still hungover

plush tusk
#

Is there exist other way to get member's status & color?

sudden path
#

There's only one way

plush tusk
#

...

flat bobcat
#

How do I take buttons that I sent as part of a view and get the custom_id of only the first button pressed then disable the view?

sudden path
plush tusk
#

nothing more

#

or solution

sudden path
#

Solution to what?

plush tusk
#

to original problem

sudden path
#

No idea what's your problem

frigid elm
#

how do i use group commands in cogs

supple ravineBOT
#

Here's the slash cog groups example.

slow dome
#

@frigid elm ^

frigid elm
#

so i shld have like

#

@commands.group

#

async def wwtv

#

and the cmds will be like

#

@wtv.command

#

?

frigid elm
slow dome
frigid elm
#

but it doesnt work

#

i have this

#

@commands.group()
async def setup(ctx):
if ctx.invoked_subcommand is None:
await ctx.reply("That subcommand does not exist")

#

inside a cog

#

and

#

@setup.command()
@commands.has_permissions(manage_guild=True)
async def channel(self,ctx,channel:discord.TextChannel): and some code

#

but it doesnt show up

slow dome
#

(i haven’t used prefixed in a while)

#

b!rtfm pyc group

slow dome
frigid elm
#

LOL

slow dome
#

b!rtfm pyc commandgroup

slow dome
#

also what I was looking for

frigid elm
slow dome
#

b!rtfm pyc discord.ext.commands.group

frigid elm
#

wait how would i add it w add_command

#

await add_command(setup)

#

oh

#

no

#

nvm

slow dome
frigid elm
#

wait i dont get how to se add_command

slow dome
#

do you need to?

frigid elm
#

idek

slow dome
#

I don’t think you do

frigid elm
#

then how would i make it work

slow dome
#

you do prefixgroupname command

frigid elm
#

i did

#

it doesnt even show up in the defaul help

slow dome
#

since pycord doesn’t really uhh use prefixed commands

frigid elm
#

OHH NVM IM DUMB I DDINT LOAD THE COG
LOL

slow dome
#

:)

#

It happens to the best of us

minor breach
#

How to pass Objects using args

#

and retrieve them too so as to pass those objects to a different function

#
    print(args)

when func(user, target) is called

#

('@sullen ledge', '@sullen ledge')

#

is returned

#

and i cant pass those string to another function cz they accept Member Objects instead of strings

past gate
#

convert the ids to members

minor breach
# past gate convert the ids to members

but why are we getting ids instead of Member Obects, I am passing user and target bot hof them are Member Objects. So args should look like
(<__main__.Member object at 0x000002E81CF9FD30>, <__main__.Member object at 0x000002E81CF9FCD0>)

#

instead of this

('@sullen ledge', '@sullen ledge')
midnight cedar
#

check the actual types of the things being passed

minor breach
# midnight cedar check the actual types of the things being passed

The thing is when you dont explicitly mention the type, @user is passed as str, and when you do mention the type, they are passed as that type. For example :

@commands.command()
async def cmd1(self, ctx, user:Member, target:Member):
    print(type(user))
    print(type(target))

@commands.command()
async def cmd2(self, ctx, user, target):
    print(type(user))
    print(type(target))
```These are two commands, one specifies the type of user and target parameters, and the other does not.
So when user and target were mentioned to be of type Member, they were received as Member Object. And when they were not linked to any type, they were received as normal str objects of the form <@id>.

Now, since my decorator accepts ctx, and other parameters in *args, I am not able to predefine the type of the variables since i don't know what the variables are. Since, type is not predefined, they are received as str objects instead of Member Objects.
midnight cedar
#

so what are you trying to do

#

variadic arguments?

minor breach
#

i want to write a decorator that checks whether the command user is lets say, of certain userID.

#

for example, if I apply my decorator to a command like this

@decorator
async def cmd(self, ctx, user:Member)

It will check whether ctx.author.id == certainID. and if it is, execute the command

#

a decorator like this would work

#
def validate_user(func):

    async def predicate(user_class, ctx, user:Member):

        command_user = ctx.author

        data = await mongo_manager.manager.get_user(str(command_user.id))

        if data is None:
            return await ctx.send("Not Allowed")

        await func(user_class, ctx, user)

    return predicate

#

here, await func(user_class, ctx, user) is getting called.

midnight cedar
#

yeah

minor breach
#

and since user is Member [explicitly defined]

#

func call is good and it works

#

but

#

I want to be able to apply this decorator to any command with ctx, cz thats what all i need for verfication.

@commands.command()
async def cmd2(self, ctx, id:int)
#

if i apply my decorator on this command

#

it wont work, cz i am not passing a user for predicate function instead i am passing an int

#

to solve that

#

i thought i wont mention any vars and just accept whatever is being sent, cz i only care about ctx, which is being received as object

#

so decorator now becomes :

def validate_user(func):

    async def predicate(user_class, ctx, *args):

        command_user = ctx.author

        data = await mongo_manager.manager.get_user(str(command_user.id))

        if data is None:
            return await ctx.send("Not Allowed")

        await func(user_class, ctx, *args)

    return predicate
#

whatever is being received other than ctx, shall be passed as it is, as we dont want to know about them

#

but now i can't define the type of variables

#

as *args is of type tuple

#

so Members will now be received as str

#

and i wont be able to pass them to original function

midnight cedar
#

so the purpose of your validate_user function is to run checks to see if the author can run the command

minor breach
#
def validate_user(func):

    async def predicate(user_class, ctx, *args):
        
        # args is a tuple of str

        command_user = ctx.author

        data = await mongo_manager.manager.get_user(str(command_user.id))

        if data is None:
            return await ctx.send("Not Allowed")

        await func(user_class, ctx, *args) # can't call this as this function accepts only Member object but args is tuple of strs and Members


    return predicate
midnight cedar
#

you can make checks as decorators

minor breach
#

thats what i am doing

#

i am carrying out checks inside the decorator

midnight cedar
#

the library has a builtin way to do this though

minor breach
#

Hmm

midnight cedar
#

I'm not sure if what you're currently trying would even work on top of a command

minor breach
#

Looks fine

#

it would work

#

lets say

#

i dont use the user and target anywhere

#

then it doen't matter whether they are passes as str or Member

#

command works in this case

#

i have tried it

#

it just agrs members cant have types, and i want type restricted parameters

midnight cedar
#

well I'm not sure if I can do much else here

minor breach
#

nono

#

i got what i wanted

midnight cedar
#

but I would recommend using the builtin custom checks system

minor breach
#

yeah

#

thats what i am gonna use

#

ty for following up lol

steep verge
#

why is this happening in a specific one of my bots only? it works in all my other bots.
Error: py Traceback (most recent call last): File "/home/container/.local/lib/python3.9/site-packages/discord/commands/core.py", line 127, in wrapped ret = await coro(arg) File "/home/container/.local/lib/python3.9/site-packages/discord/commands/core.py", line 851, in _invoke arg = await converter.convert(ctx, arg) TypeError: convert() missing 1 required positional argument: 'argument' The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/home/container/.local/lib/python3.9/site-packages/discord/bot.py", line 992, in invoke_application_command await ctx.command.invoke(ctx) File "/home/container/.local/lib/python3.9/site-packages/discord/commands/core.py", line 358, in invoke await injected(ctx) File "/home/container/.local/lib/python3.9/site-packages/discord/commands/core.py", line 127, in wrapped ret = await coro(arg) File "/home/container/.local/lib/python3.9/site-packages/discord/commands/core.py", line 1171, in _invoke await command.invoke(ctx) File "/home/container/.local/lib/python3.9/site-packages/discord/commands/core.py", line 358, in invoke await injected(ctx) File "/home/container/.local/lib/python3.9/site-packages/discord/commands/core.py", line 135, in wrapped raise ApplicationCommandInvokeError(exc) from exc discord.errors.ApplicationCommandInvokeError: Application Command raised an exception: TypeError: convert() missing 1 required positional argument: 'argument'

Code: ```py
@slash_command(name="myslashcommand", guild_ids=[...])
@commands.check_any(commands.is_owner(), commands.has_guild_permissions(manage_roles=True), commands.has_guild_permissions(view_audit_log=True))
async def myslashcommand(self, ctx, interval: Option(TimeConverter, description="(e.g. 1h, 1m, 1d, 12h)"), channel: Option(discord.TextChannel)):

stuff

MY TIMECONVERTER CLASS BEING IMPORTED

class TimeConverter(commands.Converter):
async def convert(self, ctx, argument):
args = argument.lower()
matches = re.findall(time_regex, args)
time = 0
for v, k in matches:
try:
time += time_dict[k]*float(v)
except KeyError:
raise commands.BadArgument("{} is an invalid time-key! h/m/s/d are valid!".format(k))
except ValueError:
raise commands.BadArgument("{} is not a number!".format(v))
return round(time)```

#

im on 2.0.0rc1

midnight cedar
#

convert should either be a staticmethod or you should be initializing the converter class

steep verge
#

it works in all my other bots on 2.0.0rc1

midnight cedar
#

because rn it's not getting a self param it looks like

steep verge
#

just this specific bot

#

i dont understand how I fix it

steep verge
#

no

#

it works in all my other bots

#

it doesnt make sense

#

should I just remove self?

#

or ctx since ctx isnt used

midnight cedar
steep verge
#

there isnt

#

i copied and pasted the class

#

and the cog

#

i removed ctx and it works

#

but the class is different than the others

#

but whatever

obsidian garnet
#

One message removed from a suspended account.

#

One message removed from a suspended account.

slow dome
#

discord.GuildChannel

obsidian garnet
#

One message removed from a suspended account.

slow dome
#

or specifically, discord.TextChannel

#

or even discord.VoiceChannel

#

depending on the situation

obsidian garnet
#

One message removed from a suspended account.

obsidian garnet
slow dome
#

yes

obsidian garnet
#

One message removed from a suspended account.

thorn verge
#

How do I create a slash command with the bridge method?

thorn verge
#

just slash without prefix

thorn verge
balmy sparrow
#

Hello, does anyone know what a command to ban people who do not have a specific role would be like?

sudden path
balmy sparrow
sudden path
#

How so

#

@balmy sparrow

balmy sparrow
#

I can't get the member list

#
discord.Guild.members

returns my user not everyone's

slow dome
balmy sparrow
slow dome
#

simplest I could put it

balmy sparrow
#

or users who watch a channel

signal grotto
#

I have one question: using pagination, if I go to the second page for example,is the embed switching to second page for everyone or am I just seeing the second page?

maiden slate
#

One quick question I was trying to setup pycord using the guide but got this error?

gilded widget
#

could you send a screenshot of your pip list

maiden slate
gilded widget
gilded widget
maiden slate
#

yes

gilded widget
#

fairly certain you're missing dependencies

#

try reinstalling please

maiden slate
#

kk reinstalled

#

still gives same error but more dependencies are here now

gilded widget
#

odd, what command are you using to install?

maiden slate
#

pip install py-cord

gilded widget
#

and then reinstall py-cord once more

maiden slate
#

still gives same error :z

gilded widget
#

hm, are you sure there's no issues with your venv?

#

i.e. are you installing packages in the right place

maiden slate
gilded widget
#

well, sorta grasping at straws here, its the only thing i can think of that would explain that error besides namespace conflicts and wrong version

maiden slate
gilded widget
maiden slate
gilded widget
#

can you try using commands.Bot and create a slash command?

#

my only real guess is somehow your install is corrupted/missing files or data

gilded widget
#

commands.Bot would be in discord.ext.commands but that indicates that you're missing discord.commands which is where slash command code is held

#

can you try doing
pip uninstall py-cord
pip install py-cord==2.0.0

#

it shows you have 2.0.0 which is really confusing but i'm not sure what else would be causing that, seems more like you're on 1.7.3

gilded widget
#

not sure what else to tell you then besides check your venvs/installations

#

someone else might be able to help you? maybe idk

obsidian garnet
#

One message removed from a suspended account.

maiden slate
#

💀 it keeps getting worse

gilded widget
#

lmao wtf

slender lintel
maiden slate
slender lintel
#

yeah

maiden slate
slender lintel
#

uh

#

maybe go back 1 version to py-cord==2.0.0rc1

#

and see what that does

gilded widget
#

you can go through and delete each message

#

it'll be a bit intensive but should work

slender lintel
gilded widget
#

that would work on a per channel basis

#

you'd have to do that for each channel

#

and who knows how big the amount of messages in that channel could be

slender lintel
#

o

gilded widget
#

it'd be a lot more intensive than just using Member.history

slender lintel
#

ok that makes sense

maiden slate
slender lintel
#

how tf

#

maybe just install py-cord through the package manager in pycharm

obsidian garnet
#

One message removed from a suspended account.

gilded widget
#

no

#

even if you were gonna do it on a per-channel basis you need to actually check the message attributes, not checking in

obsidian garnet
#

One message removed from a suspended account.

gilded widget
#

checking if message.author.id == user.id

#

no, its a pretty simple thing to do

obsidian garnet
#

One message removed from a suspended account.

#

One message removed from a suspended account.

gilded widget
#

?tag tias

hearty rainBOT
queen nacelle
#

can I use defer on a paginator?

maiden slate
#

ig conda is just being horrible @gilded widget
i switched over to pycharm inbuilt venv and it worked lmfao

#

how to limit commands to certain roles/people with certain permissions?

forest talon
#

b!rtfm pyc commands.has_

maiden slate
#

anyone know how to change the status of a bot

#

and how to add slash commands to a server (mine only go to the debug server i listed)

unique glacier
#

b!rtfm pyc change_presence

tender isle
#

I know this isn't a pycord question, but probably an easy answer. What is the style of channel used here in Help called? (With separate threads inside the channel.) I don't know what to search for to learn about it, lol.

tender isle
#

Thanks. :)

slender lintel
#

im using await interaction.delete_original_message() and getting discord.errors.NotFound: 404 Not Found (error code: 10015): Unknown Webhook

minor breach
#

Is it possible to make Paginator buttons look like this? Select is just a normal button which will call a function.

#

Select btn can be appended after the arrow buttons but that looks ugly

minor breach
#

Make sure thats not the case

minor breach
#

Try fetching the InteractionMessage using original_message() and then calling delete on that.

slender lintel
#

ok

slender lintel
icy sluice
#

how do i get my uptime as a unix timestamp?

minor breach
slender lintel
#

okay ill try that

slender lintel
minor breach
#

Hmm

slender lintel
#

same error as before with the interaction.delete_original_message()

slender lintel
#

very werid

#

does anyone know how to make buttons only executeable by the interaction author

#

like make it disabled for everyone except

#

them

stable torrent
#

you can simply compare interaction user id with author's id

#

you can get author's id by passing it through view as and argument

#

for example

#

@slender lintel

slender lintel
#

But I’m not sure how to make the buttons only disabled for certain

#

People

stable torrent
#

you can't make them disabled

slender lintel
#

Oh

stable torrent
#

you can make them not respond to certain people

slender lintel
#

Ah

#

Ok

#

Ik how then

#

Thanks

stable torrent
#

👍🏻

slender lintel
#

Hello everyone, I have an question. Does everyone having the issue that the script don't find the interaction and do not defer it? It hapens some time for me

toxic tiger
#

Anyone an idea where this is coming from? Timeout in autocomplete?

Task exception was never retrieved
future: <Task finished name='Task-45055' coro=<ApplicationCommandMixin.on_application_command_auto_complete.<locals>.callback() done, defined at /var/discord/venv/lib/python3.9/site-packages/discord/bot.py:739> exception=NotFound('404 Not Found (error c
ode: 10062): Unknown interaction')>
Traceback (most recent call last):
  File "/var/discord/venv/lib/python3.9/site-packages/discord/bot.py", line 742, in callback
    return await command.invoke_autocomplete_callback(ctx)
  File "/var/discord/venv/lib/python3.9/site-packages/discord/commands/core.py", line 1177, in invoke_autocomplete_callback
    await command.invoke_autocomplete_callback(ctx)
  File "/var/discord/venv/lib/python3.9/site-packages/discord/commands/core.py", line 1177, in invoke_autocomplete_callback
    await command.invoke_autocomplete_callback(ctx)
  File "/var/discord/venv/lib/python3.9/site-packages/discord/commands/core.py", line 905, in invoke_autocomplete_callback
    return await ctx.interaction.response.send_autocomplete_result(choices=choices)
  File "/var/discord/venv/lib/python3.9/site-packages/discord/interactions.py", line 890, in send_autocomplete_result
    await self._locked_response(
  File "/var/discord/venv/lib/python3.9/site-packages/discord/interactions.py", line 956, in _locked_response
    await coro
  File "/var/discord/venv/lib/python3.9/site-packages/discord/webhook/async_.py", line 211, in request
    raise NotFound(response, data)
discord.errors.NotFound: 404 Not Found (error code: 10062): Unknown interaction
stable torrent
slender lintel
#

only english in chat

#

dm

stable torrent
#

это канал помощи, какая разница

#

я же пытаюсь тебе помочь, а не намеренно использую руссиянский по приколу

slender lintel
#

py-cord==2.0.0rc1

#

из pip freeze

stable torrent
#

обновись до релизной

#

2.0.0

slender lintel
#

of

#

ща

#

ща чекним

stable torrent
#

если повторяется, мб в коде проблема, гдето застряёт мб

slender lintel
stable torrent
#

обычно при запуске бота есть промежуток, в который команды еще не работают

stable torrent
#

попробуй вывести в консоль чтото по ходу выполнения команды

#

в начале, середине и конце

#

дебагни короче

slender lintel
#

у меян брейкпойнты стоят

stable torrent
#

ну и где ломается

slender lintel
#

катчит ток при await ctx.defer()

stable torrent
#

дискорд крут

slender lintel
#

согл

stable torrent
#

убери дефер, думаю обычного времени достаточно

slender lintel
#
    @user.command()
    async def stats(self, ctx: discord.ApplicationContext, member: Option(discord.User, 'Specify an user')):
        member = ctx.author if member is None else member

        await ctx.defer()
        cur = plugins.CONNECTION.cursor()
        cur.execute('''
        SELECT * FROM player WHERE user_id=%s;
        ''', (member.id,))
        fetch = cur.fetchone()
slender lintel
#

неа

#

тогда вообще не выводит

stable torrent
#

sqlite настолько медленный без ормки

slender lintel
#

у меня psql

stable torrent
#

ладн

slender lintel
#

есть еще идеи, или в issues кидать

stable torrent
#

есть какая то закономерность в появлении этой штуки

slender lintel
#

у меня дедлайн сегодня

slender lintel
stable torrent
#

а бля

#

слушай, библа же в async работает

slender lintel
#

и

stable torrent
#

а бд у тебя не в async

#

мб блокирующий процесс?

#

🤔

slender lintel
#

думаешь?

stable torrent
#

возможно

#

хотя по сообщению ошибки не скажешь

#

но если после получения опыта

slender lintel
#

по стеку все норм

#

изза асинка не может быть

slender lintel
stable torrent
#

дефер вообще странно работает, я обычно стараюсь его не использовать

#

но это уже дискорд так накодил

slender lintel
#

кидать баг репорт?

stable torrent
#

ну просто кроме как на блок, я ниче не могу подумать

#

попробуй кинуть баг на гх

slender lintel
#

дису или библе

stable torrent
#

библе

#

там челы которые делают либу обычно отвечают, я лично хз че тут

slender lintel
#

окей

stable torrent
#

запутанно все

slender lintel
#

но как быть с дедлайном?

#

меня же выебут)

stable torrent
slender lintel
#

согл

stable torrent
#

ну для начала не юзать sync бд в async проекте

slender lintel
#

так форка на асинк для psql нету вроед

#

ой бл, ща переписывать все Klass

stable torrent
#

есть черепашка, ее сам овнер либы юзает

#

может успеешь переписать основной функционал)

#

там не сложно вообще, даже можно вроде напрямую команды давать

slender lintel
#

у меня еще пол проекта не завершено, я 10 дней хуи пинал)

stable torrent
#

ну молодец, что сказать)

#

уроки на будущее

slender lintel
#

я могу попросить еще время дать

slender lintel
stable torrent
#

удачи

slender lintel
#

спасибо)

#

а если исключить вину асинхронности, больше идей нет?

stable torrent
#

если это искючить

#

или баг в либе, или дискорДик молодец

#

можешь попробывать подать репорт в гитхаб опять же к челам сюда

#

но хз

slender lintel
#

я кину всеже

#

кинь др

stable torrent
#

сорян ни

#

у меня лс открыто к челам с этого серва

#

так что норм

icy sluice
stable torrent
#

🤔

icy sluice
stable torrent
#

im pretty sure calendar.timegm() makes timestamps

#

its shows what i mean

icy sluice
#
import calendar
import time
from datetime import datetime
dt = datetime(2017, 12, 31)
print(time.mktime(dt.timetuple()))
print(calendar.timegm(dt.timetuple()))

this is the example given but how do I change dt = … to the time when my bot starts is?

stable torrent
#

mhm, second

#

you should make an variable and record a time here whenever bot starts... may be

#

it should work

#

im not sure if there is other way

#

there may be

#

then you just current_time - start_time

slender lintel
#
import discord
from discord.ui import Select, View
from discord.ext import commands
from discord.commands import SlashCommand

client = commands.Bot()


class help(commands.Cog):
    def __init__(self, client):
        self.client = client

    @client.slash_command(name="help", description="Opens a select menu based on helping.")
    async def menu(self, ctx):
        select = Select(
            placeholder="Choose your help category:",
            options=[
                discord.SelectOption(
                    label="Moderation",
                    emoji="🔨",
                    description="Shows all the available moderation commands.",
                ),
                discord.SelectOption(
                    label="Fun",
                    emoji="🐸",
                    description="Shows all the available fun commands."
                ),
                discord.SelectOption(
                    label="Misc",
                    description="Shows all the available misc commands."
                )
            ]
        )

        async def menu_callback(interaction):

            if select.values[0] == "Moderation":
                embed = discord.Embed(title="Moderation", description="""        
:white_small_square: `Ban`, Bans a user from the server, (/ban)
:white_small_square: `Clear`, Clears a selected amount messages from a channel, (/clear)
:white_small_square: `Purge`, Clears a selected amount messages from a channel, (/clear)
:white_small_square: `Kick`, Kicks a user from the server, (/kick)
:white_small_square: `Unban`, Unbans a user from the server, (/unban), copy there id!""")

            elif select.values[0] == "Fun":
                embed = discord.Embed(title="Fun", description="""        
:white_small_square: `Ban`, Bans a user from the server, (/ban)
:white_small_square: `clear`, Clears up too 1000 messages from a channel, (/purge)
:white_small_square: `Kick`, Kicks a user from the server, (/kick)
:white_small_square: `Unban`, Unbans a user from the server, (/unban), copy there id!""")

            elif select.values[0] == "Misc":
                embed = discord.Embed(title="Misc", description="""        
:white_small_square: `multiply`, Multiples two numbers together, (/multi)
:white_small_square: `Selectmenu`, Provides information on a selected mod menu, (/selectmenu)
:white_small_square: `Help`, Show this embed, (/help)
:white_small_square: `Server Info`, Sends information about the server, (/server_info)
""")

            await interaction.response.send_message(embed=embed, ephemeral=True)

        select.callback = menu_callback
        view = View()
        view.add_item(select)
        await ctx.respond("Choose what category u need help with: ", view=view)


def setup(client):
    client.add_cog(help(client))

so i have this shity help command but i wanna make a command that looks like this any one know how i can?

#

i wanna make it look like that

icy sluice
#

Code:

@commands.Cog.listener()
async def on_ready():
        print(f"{self.bot.user} is online & functioning!")
        global startTime
        startTime = time.time()

Error:

Ignoring exception in on_ready
Traceback (most recent call last):
  File "/home/container/.local/lib/python3.9/site-packages/discord/client.py", line 382, in _run_event
    await coro(*args, **kwargs)
TypeError: on_ready() takes 0 positional arguments but 1 was given
#

confused

surreal lagoon
icy sluice
#

ah ok ty both

surreal lagoon
#

Check out the docs and experiment a bit

jagged meadow
#

is a proper implementation of BridgeOptions being considered or being worked on or is it already done in the latest commit?

minor breach
#
async def cmd(self, ctx):

    async def select_callback(self):
            # do stuff
            
            paginator.clear_items()

    button = Button(label="Click ME")
    button.callback = select_callback
    paginator = Paginator(pages)

    await paginator.send(ctx)

#

this is not working

#

paginator items are still there even after pressing the button

vast patrol
#

i have a little error with PyNaCl, can someone help me pls? i installed, uninstalled, changed version etc

#

can't get it working

crystal verge
#

can ya'll help me with my terminal?

#

my terminal look like it has a disease

frigid lark
#

Did you installed something?

vast patrol
#

i do pip install PyNaCl and it installs

crystal verge
past gate
#

right..

vast patrol
#

but it's not working

past gate
#

not working as in?

vast patrol
#

shows the generic, Needs the lib for voice

past gate
#

maybe reinstalling pycord /w voice would help

#
# Linux/macOS
python3 -m pip install -U "py-cord[voice]"

# Windows
py -3 -m pip install -U py-cord[voice]```
frigid elm
#

idk why some cogs arent loading

#

they used to load fore but now they jst stopped

vivid nacelle
#

Please don’t ping other members

frigid elm
wind merlin
# steep verge it works in all my other bots on 2.0.0rc1

I ran into the same issue. It seems to be due to this commit:
https://github.com/Pycord-Development/pycord/commit/33a0a2522f11e63c6d6e2ae84bd2dfc754b36d1f#diff-9a360fa14dc0981d2044cee070fd0707bbd71d0dc49bae324f230722baffb51eL847

Previously, a "self" was given to converters:

arg = await converter.convert(converter, ctx, arg)

But now, it is either instantiated if it is an instance of type and the convert is called on the created instance, or it is used just as if it was static method. But isinstance(converter, Converter) returns True even if converter is actually a class, that is a subclass of Converter. 🤔 Hence, @midnight cedar s suggestion to either instatiate the class or make it a static method should work.

But also yes, the old behaviour was broken by that commit.

steep verge
#

Please don’t ping me randomly

wind merlin
sudden path
#

Chill they were just trying to help lol

frigid elm
#

bro

#

😭

steep verge
#

Oh so it was the commit? Because I was confused because I copied and pasted the same code and I guess I reinstalled on the commit that wasn’t working.

frigid elm
frigid elm
# slow dome specify problem?

i have mod.py cog but it wont load and it doesnt give me any error, i tried pasting the code in another cog but it wont load that asw, so there's something in that code that blocks the bot to load the cog

#

kinda confusing

frigid elm
signal grotto
signal grotto
#

wdym by define?

slow dome
#

what do you mean it doesn't work. what doesn't work

signal grotto
#

oh i see 😄 got that wrong. So when i try to use the command /hello it doesnt show me any options to fill in

slow dome
signal grotto
#

two quick screenshots

#

i renamed the command to build, nothing else changed

#

so it doesnt give me the options to fill in and just uses the default values

slow dome
#

?tag guide

hearty rainBOT
slow dome
signal grotto
#

thank you, i found the solution for the first one too, the second one works but looks different of course

frigid elm
#

ive been trying to figure it out for hours

#

but i cant see any problem

#

nd it gives no erros

#

errors*

forest talon
#
def setup(bot):
    bot.add_cog(CogName(bot))
icy sluice
#

yeah, they did

forest talon
#

oh

icy sluice
forest talon
#

ah ty

frigid elm
#

its a weird ass problem

#

idek what to do anymore

forest talon
frigid elm
forest talon
#
embed = discord.Embed(color=discord.Color.from_rgb(13,99,143),title=f"{message_before.author.name} has edited a message・{message_after.author.id}",title="Message edited")
#

you put two titles

#

it worked after i changed one of them to description=

frigid elm
#

lemme suck ur dick

forest talon
#

lmao

frigid elm
#

ure my savior

forest talon
#

it gave me an error though

frigid elm
#

a basic error took me 4 hours

frigid elm
#

me

#

u dont understand u just saved me

#

omg

forest talon
#

lol np

slate stirrup
#

How do I make an auto response to a message without a prefix

signal grotto
#

is their any way when using autocompletion for command options (because the choices limit is too low) to validate the input before sending the command?

forest talon
#

make sure to process commands afterwards too, just in case

#

await bot.process_commands(message)

steep verge
#

How come this is erroring when i have a status loop that loops every 13 seconds. It errors like this after a while tho

future: <Task finished name='Task-1' coro=<ch_pr() done, defined at /home/container/main.py:78> exception=ConnectionResetError('Cannot write to closing transport')>
Traceback (most recent call last):
  File "/home/container/main.py", line 94, in ch_pr
    await set_status_as_guilds()
  File "/home/container/main.py", line 75, in set_status_as_guilds
    await client.change_presence(activity=discord.Activity(type=discord.ActivityType.listening, name=f"tickets for {len(client.guilds)} servers"))
  File "/home/container/.local/lib/python3.9/site-packages/discord/client.py", line 1179, in change_presence
    await self.ws.change_presence(activity=activity, status=status_str)
  File "/home/container/.local/lib/python3.9/site-packages/discord/gateway.py", line 667, in change_presence
    await self.send(sent)
  File "/home/container/.local/lib/python3.9/site-packages/discord/gateway.py", line 627, in send
    await self.socket.send_str(data)
  File "/home/container/.local/lib/python3.9/site-packages/aiohttp/client_ws.py", line 150, in send_str
    await self._writer.send(data, binary=False, compress=compress)
  File "/home/container/.local/lib/python3.9/site-packages/aiohttp/http_websocket.py", line 687, in send
    await self._send_frame(message, WSMsgType.TEXT, compress)
  File "/home/container/.local/lib/python3.9/site-packages/aiohttp/http_websocket.py", line 598, in _send_frame
    raise ConnectionResetError("Cannot write to closing transport")
ConnectionResetError: Cannot write to closing transport```
and it has nothing to do with the code
forest talon
#

it works when i run it

steep verge
#

not right away

#

like a few hours

forest talon
#

if that's what you meant

signal grotto
#

Yeah I just thought that there is maybe a workaround but I guess the workaround is just to throw an error message if the user uses an item not included in the list. Straight up validation would be way cooler though

slender lintel
#

How do you put a saved file into an embed because it only takes url?

signal grotto
slender lintel
vagrant mortar
#

How can I delete dropdowns after I've interacted with them? (as in, in the callback of the Select view)

icy sluice
#

Code:

@bot.event
async def on_message(ctx, message):
        if message.content.lower() == f"<@!{bot.user.id}>" or message.content.lower() == f"<@{bot.user.id}>":
            await ctx.reply("testinggg")

Error:

Ignoring exception in on_message
Traceback (most recent call last):
  File "/home/container/.local/lib/python3.9/site-packages/discord/client.py", line 382, in _run_event
    await coro(*args, **kwargs)
TypeError: on_message() missing 1 required positional argument: 'message'
#

if anyone could help then I’d appreciate it, I’m quite confused bruh

midnight cedar
#

Events don't take ctx

sudden path
icy sluice
icy sluice
stable torrent
#

i like when people can think

icy sluice
#

would len(self.bot.member_count) return the amount of members from all guilds my bot is in?

stable torrent
#

i mean, property is named member_count

#

its already an int

steep verge
#

b!rtfm bot.users

open bearBOT
# steep verge b!rtfm bot.users

I couldn't find a documentation with the name bot.users! Maybe you used to command wrong? Correct Usage: <prefix>rtfm <docs> [<term>] (eg. b!rtfm py cool)
List of Documentations you can search:
python
pycord
discord.py
yarsaw
nextcord
disnake

steep verge
#

b!rtfm pyc bot.users

torpid siren
#

how do i get the "everyone" role

#

i want to something like this

await voice_channel.set_permissions(everyone_role, connect=False)
#

but how do I get the "everyone" role of a guild?

#

nvm i figured out

#

it's guild.default_role

misty glacier
#

Traceback (most recent call last): File "/home/bots/discord/python/Ruby Network/Bot.py", line 4, in <module> from commands.setJoinChannelCommand import setJoinChannelCommand File "/home/bots/discord/python/Ruby Network/commands/setJoinChannelCommand.py", line 10, in <module> class setJoinChannelCommand(commands.Cog): File "/home/bots/discord/python/Ruby Network/commands/setJoinChannelCommand.py", line 16, in setJoinChannelCommand async def setinvitechannel(self, ctx, channel: discord.channel): File "/usr/local/lib/python3.9/dist-packages/discord/commands/core.py", line 1625, in decorator return cls(func, **attrs) File "/usr/local/lib/python3.9/dist-packages/discord/commands/core.py", line 645, in __init__ self.options: List[Option] = self._parse_options(params) File "/usr/local/lib/python3.9/dist-packages/discord/commands/core.py", line 696, in _parse_options option = Option(option) File "/usr/local/lib/python3.9/dist-packages/discord/commands/options.py", line 161, in __init__ raise exc File "/usr/local/lib/python3.9/dist-packages/discord/commands/options.py", line 156, in __init__ _type = SlashCommandOptionType.from_datatype(input_type) File "/usr/local/lib/python3.9/dist-packages/discord/enums.py", line 704, in from_datatype if issubclass(datatype, str): TypeError: issubclass() arg 1 must be a class

class setJoinChannelCommand(commands.Cog):

    @slash_command(name="setinvitechannel", description="Setzte den Invite Channel fest!", guild_ids=[923972845124583455])
    async def setinvitechannel(self, ctx, channel: discord.channel):

        config = ConfigParser()
#

It's the channel: discord.channel

#

But what should I write instead?

burnt iris
#

quick help with a project

frigid lark
burnt iris
#

class Enemy(EnemySprite):
def update(self):
global g
g=0
self.rect.y += self.speed
for invader in invaders:
if self.rect.y > win_height:
self.rect.x = randint(80, win_width - 80)
self.rect.y = 0
g=g+1
print(g)
if g==1:
mini_image.fill((255,255,255,0))
window.blit(self.image, (self.rect.x, self.rect.y))

#

this is the code and the problem is that the g value doesnt update every time the if condition happening

#

it stills at value of 1

sudden path
misty glacier
# sudden path discord.TextChannel

Thx, how can i create a directory/file if not exists?

with open("resources/config.ini", "w+") as f:
    config.write(f)

It says: Application Command raised an exception: FileNotFoundError: [Errno 2] No such file or directory: 'resources/config.ini'

scenic leaf
#

this code

nr = 300
for number in range(nr)

returns TypeError: 'str' object cannot be interpreted as an integer
how do i fix this ?

sudden path
#

You could just range(300). Whats the point of defining a var

scenic leaf
#

i get the var so it has to be (nr)

#

cause the var returns a random number

#

and i need to send that number from 0 to that number

#

in this case 300

sudden path
#

OK then

past gate
slender lintel
#

does anyone know how i could get the locale field of a interaction via pycord?

boreal harness
# scenic leaf in this case 300

I am assuming that you are getting the input as a string. Convert the message to an integer before putting it as a range.

value = "10281212"
for number in range(int(value)):
    ...
scenic leaf
#

ooh ill try that thanks

supple ravineBOT
boreal harness
#

full error please

slender lintel
#

does anyone know how i could get the locale field of a interaction via pycord?

slow dome
#

b!rtfm pyc interaction.locale

open bearBOT
slender lintel
#

and inside there i can findthe users language

#

right

slow dome
#

ye

#

s

vivid nacelle
#

@slender lintel please don’t write here additionally if you’ve created a thread. And don’t beg for help in general too afterwards.
It’s all volunteer and we help if we got time.

rigid lodge
#

How would I convert the find1 to a discord.Color type? without having it be a argument

async def test_welcome(self, ctx):
        request = mycol.find_one({"key": f"welcColor_{ctx.guild.id}"})
        find1 = request["data"]
        if ctx.author.guild_permissions.manage_guild:
            if mycol.find_one({"key": f"accepted_{ctx.author.id}"}) is not None:
                 embed = discord.Embed(title="Test",
                                       description="Test",
                                       color=find1)
                 await ctx.send(embed=embed)
                 # ....
rigid lodge
#

Nvm, i got it

pliant grail
#

How can I find an example for unpack_audio

slender lintel
#

i noticed when using interaction locale it gets the locale from when u execute the command, such as i will do /something in say french and then go to settings and change to spanish then i edit the message to make it get the interaction.locale again it gets the one of the original command locale

maiden slate
#

how do i set some commands to be only in debug server and some in any server my bot is in?
Or if thats not possible how do i make commands available outside my debug server that is listed

gilded widget
maiden slate
#

do i have to do that every time :z or is there a work around?

gilded widget
#

you could group your commands

#

make a section for debug commands

#

and then you'd only have to pass the guild_ids for that one group

maiden slate
#

o so u can have one decorator for a group of commands??

gilded widget
#

eh

#

here

slender lintel
#

hey

slender lintel
#

i have

#
class memeView(discord.ui.View):
    def __init__(self, lang):
        super().__init__(timeout=None)
    @discord.ui.button(
        label="Next Meme",
        style=discord.ButtonStyle.green,
        emoji="⏩",
        custom_id="submit"
    )```
#

im trying to pass language

#

to the button

#

and make label = label

#

and label will be the translated

#

text via lang

#
label = await translate_lang(text, lang=lang)```
maiden slate
#

ah thanks

#

would i do it like this

gilded widget
# slender lintel ```py class memeView(discord.ui.View): def __init__(self, lang): sup...

easy enough, instead of using the decorator there's 2 other ways to go about it:

class memeView(discord.ui.View):
    def __init__(self, lang):
        super().__init__(timeout=None)
        # whatever lang processing here
        button = discord.ui.Button(label=label, ...)
        button.callback = your_callback
        self.add_item(button)

# your_callback can either be in the view class or defined outside 

or, subclass button and allow kwargs in init

gilded widget
slender lintel
gilded widget
#

what do you mean?

slender lintel
#

and then do something

#

like before i had

    @discord.ui.button(
        style=discord.ButtonStyle.red,
        emoji="🗑️",
        custom_id="delete"
    )
    async def delete(self, button: discord.ui.Button, interaction: discord.Interaction):
      await interaction.response.defer()
      await interaction.delete_original_message()``` which would when you interact it would delete the message
#

but when doing add_item im sorta confused

gilded widget
slender lintel
#

al

#

alr

#

i can do the rest

#

thanks

slender lintel
#
#list devs
    @slash_command(guild_ids=database.owner_guild_ids, name="list-devs")
    async def list_devs(self, ctx):
        """Shows bot devs"""
        if check.is_dev(ctx.author.id):
            num = 0
            devs_list = ""
            dev_ids = list(database.dev_ids())
            for dev_id in dev_ids:
                num += 1
                dev_mention = f"<@{dev_id}>"
                devs_list += f"`{num}.` {dev_mention}\n"
            dev_em = discord.Embed(description=devs_list, color=database.theme_color)
            dev_em.set_author(name=f"Devs List", icon_url="https://cdn.discordapp.com/emojis/979609228845129738.png?size=96")
            await ctx.respond(embed=dev_em)
        else:
            errorEm = discord.Embed(description=f":error: You are not authorized to use the command.", color=database.error_color)
            await ctx.respond(embed=errorEm, ephemeral=True)
#

^^ Help Me

slender lintel
#

@slow dome

maiden slate
#

if

#

if a role doesn thave a permission to use a command can they see the command?

stable torrent
#

yes

maiden slate
#

if i restart the program will it add another response?

#

cause i udpated my program but it processes the request, but also gives an application did not respond message

maiden slate
#

is ctx.respond better?

deep grail
#

Well it will prevent the application didn't respond msg

#

For interactions always use ctx.respond

maiden slate
#

ah i see
I think the main problem is its running twice for some reason so id like to prevent that

deep grail
maiden slate
deep grail
#

Send code pls

#

@maiden slate

maiden slate
#

?

deep grail
#

Send the code for what's causing teh issue

maiden slate
#

nothings causing the issue specifically

#

the program runs fine

#

i just get two responses

deep grail
#

What responses?

#

Send a screenshot

maiden slate
#

i got the error the first run

deep grail
#

Yeah so that should be fixed with using ctx respond instead of ctx send

maiden slate
#

kk

deep grail
maiden slate
#

and that happened

deep grail
#

And it happened again?

maiden slate
#

it sent the correct response first

deep grail
#

Yeah so wasn't it fixed when u replaced ctx.send with ctx.respond?

maiden slate
#

btw how to make it ephermeral

deep grail
#

Becuz what's happening is discord doesn't know ur acknowledging the interaction when u use ctx.send, but with ctx.respond it does and doesn't show the failure msg

deep grail
maiden slate
#

?

deep grail
#

Yeah

deep grail
#

Don't ping the admins for help

#

I think the issue is with u supplying database.owner_guild_ids, check the type of that @slender lintel

#

Also is the error during cmd registration or when the cmd is run?

deep grail
#

Hm

slender lintel
#

After this line of code every line after this code also shws the same error

misty glacier
#

How do i get the inviter and the invite url in on_member_join?

deep grail
#

Check the docs

deep grail
maiden slate
#

does anyone know how to do that thing some bots do where their response to slash commands make it look like they're responding to a message

maiden slate
#

wut

#

o

misty glacier