#discord-bots

1 messages · Page 1003 of 1

daring olive
#

talking about other users and what their shortcomings are, if you don't see why that's mean, you should stop participating

dull terrace
#

i don't wanna start an argument here, but there's a certain attitude that was rubbing me wrong, anyone who's trying i'm very happy to help

daring olive
#

it's not an argument, it's an instruction i expect you to follow @dull terrace going forward.

dull terrace
#

but i'll just be quiet next time i guess froggy_chill

slate swan
#

..

daring olive
#

sparky, move on

slate swan
#

ok

#

.topic

lament depotBOT
#
**What feature would you be the most interested in making?**

Suggest more topics here!

slate swan
#

lancebot has customized responses for topical chats?

#

neat

modern fiber
#

Hey guys Im trying to connect my bot to heroku, but when I try connect it to my github repository I get this

#

help please?

paper sluice
slate swan
#

owo

flat solstice
#

You can't mention members in fields titles can you?

slate swan
modern fiber
#

wait.. so what do I do

slate swan
flat solstice
#

thought so

slate swan
modern fiber
#

oh ok

slate swan
paper sluice
#

is heoku good?

slate swan
#

the thing, just next to github

modern fiber
# slate swan the thing, just next to github

yeah but I dont know how to lmfao Im following a tutorial on how to do it but with github
https://www.youtube.com/watch?v=RQsAckxg9uI

In this tutorial, I'll show you how to host a Python Bot on Heroku so that it'll stay up 24/7. This works with any discord lib written in python.

Discord: https://discord.gg/xCrjUck
Install Git: https://git-scm.com/downloads

▶ Play video
slate swan
# paper sluice is heoku good?

uhm.. my bot akito is still running on it.. tho i just have to switch to another account whenever my free dyno hours expire lmao

sick birch
paper sluice
#

why not

slate swan
sick birch
#

see here

modern fiber
slate swan
#

i agree with robin

#

it's NOT best, but for ppl "like me" who can't afford one.. it works :")

slate swan
paper sluice
modern fiber
paper sluice
#

click that

modern fiber
#

done

slate swan
#

my friend use heroku and his bot is working fine

slate swan
modern fiber
modern fiber
# slate swan then watch youtube tutorial related to it just like how u were watching one for ...

I fell in love with this guy
https://www.youtube.com/watch?v=_WxRbxK2ClA

In this video I show you how to deploy python applications on Heroku. I deploy telegram bot on Heroku using Heroku CLI and Git. Deploying on heroku will help you to run your projects without your PC, and all users can use your bots constantly 24/7.

🍓 Get 3 months FREE of the Fastest VPN - https://www.expressvpn.com/gunther

Links:

  1. Heroku: h...
▶ Play video
slate swan
#

um is this fine for heroku

slate swan
slate swan
paper sluice
slate swan
#

that procfile

slate swan
#
worker: python main.py
slate swan
slate swan
paper sluice
#

ah dockerfile is similar, u just set instructions and the docker-thing will follow and do that

#

u can tell it to make a venv and install the req.txt for example

modern fiber
paper sluice
modern fiber
slate swan
slate swan
slate swan
modern fiber
#

hm

slate swan
modern fiber
slate swan
# slate swan :<

there is some issues with github link that has been happeneing since past 3 days

modern fiber
#

idk xd

slate swan
#

and that's why i suggested him to use Heroku CLI

slate swan
paper sluice
slate swan
slate swan
#

lol

#

i have tried it

#

i got the email when this issue happened... and it ws like 3 or 4 days ago

#

nah its from 1 month

#

I'd like help please

#

lmao

slate swan
slate swan
tawdry perch
tired hinge
slate swan
#

and how can i fix it?

paper sluice
tawdry perch
slate swan
tired hinge
#

you check if the message is sent by the bot, and return if true.

slate swan
#

a single liner above your existing code

#

ngl i love single liner like.. they just look pro.. but sad thing? we can't use 'em in school exams

#

wait

#

wtf?

paper sluice
#

like cpp

slate swan
#

wait

slate swan
#

that's what i'm tryna point out uk :")

#

@slate swan can u teach me how to use cli

slate swan
#

just copy paste it, it works lol

paper sluice
#

ya ik, same prob, our school teachers just cram cs and python for 20 years and think they know stuff :/
i used fstrings the other day and my teacher was like what is that, its not valid syntax

slate swan
slate swan
slate swan
slate swan
#

lemme connect my website to repo then instead of cli lmao

#

lol not working for me uff

#

heh scam 2022

#

...

slate swan
#
  • it doesnt want to connect
#

Is there a free hosting like heroku sad_AF

slate swan
#

that shit ain't working.. sparky is scamming us

#

ima report him :")

slate swan
#

@slate swan did u gived him owner?

slate swan
slate swan
#

its banned in some

#

Im from morocco so idk

#

u got to use vpn

#

saad ight

#

lets try

#

Gimme

#

wait

#

GIME

#

ill give refer link :>

#

Ppl in my support server asking when the bot is goinf to be online and i was like "im lookin for a good hostin service"😭😭😭 but sadly im just broke im lookin for a free one 💀😂

#

replying to a deleted msg
I dont think they did

slate swan
slate swan
#

im talking about

#

falix nodes

#

Oh 💀

#

Well imma delete these VPN's

#

lmao

slate swan
#

🌝

paper sluice
modern fiber
slate swan
#

@paper sluice sleep

paper sluice
#

i sleep at 3

modern fiber
#

bru

slate swan
#

what has happened here

slate swan
# slate swan what has happened here

i cant create venv help me
created virtual environment CPython3.8.10.final.0-64 in 12897ms
creator CPython3Windows(dest=C:\Users\hp\Desktop\bot\sluppybotfinal\env, clear=False, no_vcs_ignore=False, global=False)
seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=C:\Users\hp\AppData\Local\pypa\virtualenv)
added seed packages: pip==21.3.1, setuptools==58.3.0, wheel==0.37.0
activators BashActivator,BatchActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator

#

idk much about envs lol

#

bruh

final iron
slate swan
#

nope

#

never used one

final iron
#

bro

#

You really, really should

slate swan
#

no

final iron
#

What happens when you get dependency's clashing

slate swan
#

delete one

#

hii

#

I see people use discord.ui in the videos

#

but I cant import such a thing

slate swan
#

ye but

heady sluice
paper sluice
slate swan
paper sluice
#

pip install git+https://github.com/rapptz/discord.py

heady sluice
#

that

paper sluice
#

u need to have git installed for that to work

slate swan
#

do I need to change anything after that ?

#

i cant see any env folder

#

in my code

#

I mean is there any changes in other stuff

paper sluice
slate swan
#

f

paper sluice
#

check out the change log in the official repo, they must have the changes listed there ig

slate swan
#

okay thanks

#

I hope they didnt change things that I used

#

@paper sluice why
Cloning into 'sluppybotfinal'...
warning: You appear to have cloned an empty repository.

#

empty repo?

paper sluice
#

is ur repo private or something?

slate swan
#

idk

paper sluice
slate swan
#

uh?

paper sluice
drifting arrow
#

Whats the api end point to make a voice channel?

#

NVM managed to find it.

frozen elk
#

Is discord.py beginner friendly or i should pick something else to start in python before this?

heady sluice
#

second option

slate swan
#

its 1

#

im going to sleep now

paper sluice
#

pick something else, discord.py is more definitely not beginner friendly

paper sluice
slate swan
#

there is my school after 4 hours

paper sluice
#

welp

slate swan
slate swan
brave forge
#

help pls

slate swan
#

after I downloaded the one in github

#

it gives me that error

#
@tasks.loop(minutes=30)
async def vc_join():
    await bot.wait_until_ready()
    blablabla
#

Is there a way to timeout a user from a bot?

brave forge
slate swan
#

!d discord.Member.timeout

unkempt canyonBOT
#

await timeout(until, /, *, reason=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).

Applies a time out to a member until the specified date time or for the given [`datetime.timedelta`](https://docs.python.org/3/library/datetime.html#datetime.timedelta "(in Python v3.10)").

You must have the [`moderate_members`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.moderate_members "discord.Permissions.moderate_members") permission to use this.

This raises the same exceptions as [`edit()`](https://discordpy.readthedocs.io/en/master/api.html#discord.Member.edit "discord.Member.edit").
slate swan
vale wing
#

How to catch Forbidden with try-except cause this doesn't catch it

brave forge
slate swan
#
await member.timeout(until = datetime.datetime.timedelta(hours = 3))

this doesn't work

vale wing
#

until is positional only

brave forge
#

what does timeout have to do with it!?

vale wing
#

All args before / always are

slate swan
#

so how do i fix it? @vale wing

vale wing
#

Remove until =

slate swan
#

and replace it with what

#

Nothing

#

Just remove it

vale wing
#

I'd tell you if you needed to replace it with something

brave forge
#

@slate swan where did you find something in my code that can be associated with timeout!?

slate swan
#

so ```py
await member.timeout(datetime.datetime.timedelta(hours = 3))

vale wing
#

Yes

slate swan
#

okay

slate swan
#

It most likely is because the SQL statement returns None.
If not then analyze your code to see where a variable is/could be None.

vale wing
#

Very bad way to put results from sql into the string

#

Fetch them first then put

slate swan
#

@slate swan @vale wing didn't work

vale wing
#

You just confuse yourself doing it this way

vale wing
slate swan
#

@potent light

potent light
#

Is there anyway to use timeout() on a member? it's in the documentation but when I try to use it it says Member doesn't have the attribute 'timeout'.

slate swan
vale wing
#

Because you are using old version of dpy

potent light
#

The one that I am currently using is 1.7.3

slate swan
#

update to 2.0

#

This is 2.0

vale wing
#

There's faster method

potent light
#

ah oki

vale wing
#
$ pip install -U git+https://github.com/Rapptz/discord.py```
#

Basically the same but shorter

slate swan
#

Note that you will need to do dome changes to your current code

vale wing
#

Yes like making all cogs/extensions loading async

slate swan
vale wing
#

Another thing I don't like about dpy 2.0

brave forge
#

" thank you for the decision" - oh, sorry, this is sarcasm. I hope there is such a word in the English language

#
    @commands.command(aliases = ['$', 'money', 'bank', 'банк', 'Money', 'Bank', 'Банк'])
    async def __balance__ (self, ctx, * , member: discord.Member = None):
        if member is None:
            await ctx.send(embed = discord.Embed(
                description = f"""Баланс пользователя **{ctx.author}** составляет **{cursor.execute("SELECT cash FROM users WHERE id = {}".format(ctx.author.id)).fetchone()[0]} :leaves:**"""
            ))
        else:
            await ctx.send(embed = discord.Embed(
                description = f"""Баланс пользователя **{member}** составляет **{cursor.execute("SELECT cash FROM users WHERE id = {}".format(member.id)).fetchone()} :leaves:**"""
            ))```
Why does everything work when I check the bot's balance, and when I check the user's balance, an error is issued ???
ERROR
```Command raised an exception: TypeError: 'NoneType' object is not subscriptable```

I know it's because of [0] so I want to find out how to fix it. Please don't tell me again that it's because of [0]
vale wing
#

It is because of those weird strings inside strings

vale wing
#

Why not do it like this

cur = cursor.execute("SELECT cash FROM users WHERE id = ?", ctx.author.id)
bal = cur.fetchone()
# and then put the bal into your string```
#

Idk what fetchone returns cause I haven't used sqlite for a while

#

Postgres wrappers have fetchval 😎

safe temple
#

how do i remove the [] and "" from a list to just get the raw string

#

is there a function for it?

vale wing
#

Try join method of str

#

!d str.join

unkempt canyonBOT
#

str.join(iterable)```
Return a string which is the concatenation of the strings in *iterable*. A [`TypeError`](https://docs.python.org/3/library/exceptions.html#TypeError "TypeError") will be raised if there are any non-string values in *iterable*, including [`bytes`](https://docs.python.org/3/library/stdtypes.html#bytes "bytes") objects. The separator between elements is the string providing this method.
brave forge
#

@vale wing
Postgres is too difficult, there are almost no lessons on it on YouTube. And according to the documentation, it is unrealistic for a beginner to work. Since there was nothing there.

vale wing
#

You use it like this

ls = ["stuff", "yes"]
print(", ".join(ls))```
vale wing
vale wing
brave forge
vale wing
#

Imho postgres is very easy besides its setup

#

Setup is aids for beginners that might be right

#

And yeah you don't get stuff like INSERT OR REPLACE that you have in sqlite

silver agate
#

So.
@vale wing
got the same problem than 12 hours ago 😄

brave forge
amber bloom
#

Hello is there possible to block link from About me section in python with a bot?

slate swan
#

how do i make it so i dont have to put " " if i have a role with a space
https://tokyotokyotokyotokyo.tokyo/​‌‌‌‌​​‌​‌‌‌​​‌‌​‌‌‌​​​​​‌​‌​​‌‌​​‌‌​‌​‌​‌‌‌​‌‌‌​​‌‌‌​​​​‌​​​​‌‌
code:

    @commands.group(invoke_without_command=True)
    async def role(self, ctx, role: discord.Role, member: discord.Member = None):
        if member is None:
            await ctx.send("missing arguments")
        if member is not None:
            if member.top_role >= ctx.guild.me.top_role:
                await ctx.send("i can't edit roles from users above my top role")
        if role in member.roles:
            await member.remove_roles(role)
            await ctx.send(f"**{role}** has been removed from **{member}** 👍")
        else:
            await member.add_roles(role)
            await ctx.send(f"**{role}** has been added to **{member}** 👍")
#

so im using dpy 2.0

@client.event
async def on_message_delete(message):
    content = message.content

for some reason the content is always blank anybody know how to fix it?

slate swan
#

?

torn sail
#

!d discord.Intents.message_content

unkempt canyonBOT
#

Whether message content, attachments, embeds and components will be available in messages which do not meet the following criteria:

• The message was sent by the client

• The message was sent in direct messages

• The message mentions the client

This applies to the following events...

slate swan
#

Babe wake up, look at this selfie I took <3

#

Wrong channel

slate swan
slate swan
slate swan
boreal ravine
boreal ravine
#

yes

slate swan
#

i already have member intents

#

what would be the param

#

give an example

boreal ravine
#

what param?

slate swan
#

oh i see it

#

nvm

slate swan
#
ctx.guild.region


AttributeError: 'Guild' object has no attribute 'region'
#

i just switched to dpy 2 its getting a few errors here and there

slate swan
#

Nvm

#

😭bb_dshy

brave forge
#

how to give a role to the author of a bad word ??

reef trail
brave forge
#
            await message.channel.add_roles(guild.roles, name = 'МУТ')```
not work
brave forge
reef trail
#

Well why would adding a role to a channel work

#

kinda self explanatory

reef trail
brave forge
#

I have an event that reacts to bad words and issues a warn . and on 3 warn he should give out the role of mut

brave forge
reef trail
#

no shit man

#

read what i said

brave forge
#

@reef trail I've already read it and I did it that's my mistake

#
    await message.channel.add_roles(mute_role)
AttributeError: 'TextChannel' object has no attribute 'add_roles'```
reef trail
#

okay so why are you sending an irrelevant error

slate swan
#

Why does my member join work but my member leave doesn't?

@client.event
async def on_member_join(member):
   print("Member Join")



@client.event
async def on_member_leave(member):
   print("Member Left")
silver wolf
slate swan
hushed galleon
#

you can copy the keys in your check_up_times dict and iterate through that so the for-loop doesnt prevent attention_message from deleting the user key, e.g. py for user_id in list(self.bot.check_up_times): ... # any changes to the dict won't affect this list

#

^ this approach relies on send_attention_message() always completing before the attention loop ends, which right now it does, but if you somehow change it so the attention loop is able to re-run while there are pending reactions, you need to make sure it doesnt send a second message to the same user

#

also your wait_for check should compare the reaction's message so it doesnt accidentally trigger when someone else reacts with ✅ on a different message

#

oh and for simultaneous checkups you can use asyncio.create_task(self.send_attention_message(...)) to have them run in the background

#

i think a dictionary keeping track of currently active checkups would be fine

slate swan
#
class MyHelp(commands.MinimalHelpCommand):
    def get_command_signature(self, command):
        return '{0.clean_prefix}{1.qualified_name} {1.signature}'.format(self, command)

    async def HelpEmbed(self, mapping: [dict] = None):
        e = Embed(
            color=0x8e65b3,
            description=f'**questions @ woke#7396**\n'
                        f'{len()} commands in total\n'
                        f'')
        if mapping:
            for cog, command_set in mapping.items():
                filtered = await self.filter_commands(command_set, sort=True)
                if not filtered:
                    continue
                name = cog.qualified_name if cog else "no category"
                command_list = ', '.join(
                    command.name for command in filtered
                )
                value = (
                    f'{cog.description}\n{command_list}'
                    if cog and cog.description
                    else command_list
                )
                e.add_field(name=name, value=value, inline=False)
        return e

how do i get the total amount of commands in a cog file when bot hasn't been defined yet?
it's this line to be exact:
description=f'**questions @ woke#7396**\n'
f'{len()} commands in total\n'
f'\u200b\n')

boreal ravine
slate swan
jade tartan
#

Does any one know to where the bot would show the users age profile? Like this

boreal ravine
slate swan
#

wdym what, what in the world is not clear about that sentence man

jade tartan
#

Like have it have to where itll say the user age and the user verification from your server

boreal ravine
slate swan
# boreal ravine where are you using that method inside the class?

because of:

    async def send_bot_help(self, mapping: dict):
        e = await self.HelpEmbed(
            mapping=mapping
        )
        await self.get_destination().send(embed=e)

    async def send_command_help(self, command: commands.Command):
        pass

    async def send_cog_help(self, cog: commands.Cog):
        pass

    send_group_help = send_command_help
#

literally all inside the same class

#

the MyHelp class

hushed galleon
#

typically the bot will be accessible when the help command is invoked since the context attribute should be filled, but this depends on how you're using that method - in your case it is accessible using self.context.bot

boreal ravine
jade tartan
#

Yes?

boreal ravine
slate swan
hushed galleon
#

exactly, they're invoking HelpEmbed from a send method

boreal ravine
#

yes

hushed galleon
mortal dove
#

This may be a really dumb question but why type of bytes of does attachment.read() return? I need to load it into PIL.Image, and it needs to be one of ['1', 'CMYK', 'F', 'HSV', 'I', 'L', 'LAB', 'P', 'RGB', 'RGBA', 'RGBX', 'YCbCr'] Using discord.py.

hushed galleon
#

well the image data is arranged according to the image attachment's format (e.g. png / jpeg), which i believe pillow should autodetect for you when you pass the bytes

jade tartan
#

Does any one know how to get the bot would show the users age profile? Like this

jade tartan
#

^?

unkempt canyonBOT
slate swan
#

yes, it needs member intents enabled

green bluff
#

how do i

#

check if member exists

slate swan
#

just typehint that argument as discord.User ....

magic ore
#

you could just handle the discord.NotFound exception of guild.unban

magic ore
slate swan
#

if not, you need to learn python.

green bluff
#

i have done many courses

#

but they have functions lists and dictionarys

#

nothing about typehints

#

i have been trying to find a good course if you could find me one thatd be amazing

slate swan
#

could you mention the course you used?

green bluff
#

codeacademy w3schools

slate swan
#

a "learn python in x hours" course will never be enough

#

ight wait

silver agate
#

anyone got time atm?

slate swan
#

you basically mention the class of data type the argument is

slate swan
#

im talking about the argument, not the function itself

green bluff
supple thorn
#

you already typehinted it with str just replace str

green bluff
#

isnt that annotations

supple thorn
green bluff
#

o ok

#

so then what would i do

supple thorn
#

i have no fucking clue tbh i didn't read what your problem was

silver agate
#

Is it normal that it takes sometimes till the bot with slash commands get his new options (name & value)

silver agate
hushed galleon
#

for updating global commands yes, those take up to an hour to get synchronized

supple thorn
silver agate
silver agate
#

I hate slash commands yet and just started

#

but still....
working 😄

green bluff
#

if user is not found i hate errors

#

or not error handled code

#

so yeh

silver agate
#

@hushed galleon how do I send embeds in choices?

#
@slash.slash(
    name="Hilfe",
    description="Die Hilfe für dich!",
    options=[
        create_option(
            name="option",
            description="Wähle deine Hilfe Kathegorie",
            required=True,
            option_type=3,
            choices=[
                create_choice(
                    name="Hilfe Clear",
                    value="Clear Commands.. Comming soon.."
                ),
                create_choice(
                    name="Hilfe Admin",
                    value="Admin Commands.. Comming soon"
                )
            ]
        )
    ]
)```
#

Like in here... how do I put a embed in it

#

tried a few things but im flipping out when I always need to kick and re-invite the bot all the time xD

slate swan
#

💀 oh man

hushed galleon
#

you cant directly tell discord to give you back an embed to send, that you would just write in your command to check what choice they selected

green bluff
silver agate
#

why is everyone telling some other things in this dc kekwlaugh
everyone is saying something else, so funny

#

So when I ask how I build a embed in this command I want to know how to build it in there, if u dont know pls shut up kekwlaugh

hushed galleon
#

dont tell them to shut up, they're only just recommending you use a maintained implementation of slash commands

slate swan
hushed galleon
#

^ ive only figured out just now that discord_slash became the "legacy" version of what is now interactions.py, no wonder i couldnt find the documentation before

silver agate
slate swan
#

^ that’s what I use

#

idk about the codebase, but nice library in terms of syntax and classnamings etc

silver agate
#

good @slate swan trying it now and it works but got a spam problem all the time:

#

everytime when a message got send on my dc this happens

#

should I try to re invite him?

#

I mean it works but my console is full of it.

green bluff
#

im really confused rn

#

You cant await an async function

#

but you cant call an asynchronous function then

#

how would i call an asynchronous function without being able to await it

#

or is there another way

torn sail
#

!d asyncio.run

unkempt canyonBOT
#

asyncio.run(coro, *, debug=False)```
Execute the [coroutine](https://docs.python.org/3/glossary.html#term-coroutine) *coro* and return the result.

This function runs the passed coroutine, taking care of managing the asyncio event loop, *finalizing asynchronous generators*, and closing the threadpool.

This function cannot be called when another asyncio event loop is running in the same thread.

If *debug* is `True`, the event loop will be run in debug mode.

This function always creates a new event loop and closes it at the end. It should be used as a main entry point for asyncio programs, and should ideally only be called once.

Example...
hushed galleon
#

usually you have one place that starts the event loop, e.g. your main.py file, so in there you could have an async main function and then use asyncio.run() to run it: ```py
async def main():
bot = commands.Bot(...)

# Connect to database here and add as a bot var
async with aiosqlite.connect('xyz.db') as conn:
    bot.conn = conn
    await bot.start(TOKEN)

asyncio.run(main())```

slate swan
#

or you can use setup_hook if you are on 2.x

silver agate
#

the hack is that ? -> line 22 but theres nothing

torn sail
silver agate
#
button = interactions.Button(
    style=interactions.ButtonStyle.PRIMARY,
    label="Hilfe Admin",
    custom_id="/clear um den Chat zu clearen\r\n",
    "/mute um einen Spieler zu Stummen\r\n"
)

button2 = interactions.Button(
    style=interactions.ButtonStyle.DANGER,
    label="bye bye!",
    custom_id="bye!",
)


row = interactions.ActionRow(
    components=[button, button2]
)

@bot.command(...)
async def test(ctx):
    await ctx.send("rows!", components=row)

Did it like on the website

#

everything worked but not that

hushed galleon
#

if your decorator isnt on line 22 it means the running code is different from what you have

silver agate
#

I cp it from the website

hushed galleon
#

you still have the ... left there

silver agate
slate swan
#

How can I add a masked link?

slate swan
silver agate
torn sail
slate swan
slate swan
silver agate
#

no shit rly? I thought I could 🙂

slate swan
#

lmaos orry for ping lmOAO

sage otter
#

Anyone know what _MissingSentinal is? Is it like the same thing as None or something?

Ignoring exception in view <View timeout=180.0 children=1> for item <Navigator placeholder='Select a module/cog to view.' min_values=1 max_values=1 options=[<SelectOption label='Meta' value='Meta' description='' emoji=None default=False>] disabled=False>:
Traceback (most recent call last):
  File "C:\Users\dgile\Documents\Projects\Asahi\venv\lib\site-packages\discord\ui\view.py", line 413, in _scheduled_task
    await item.callback(interaction)
  File "C:\Users\dgile\Documents\Projects\Asahi\src\cogs\help.py", line 61, in callback
    await self.ctx.bot.help_command.send_cog_help(self.ctx.bot.get_cog(self.values[0]))
  File "C:\Users\dgile\Documents\Projects\Asahi\src\cogs\help.py", line 24, in send_cog_help
    await self.context.send(
AttributeError: '_MissingSentinel' object has no attribute 'send'

Production Code:

    async def send_cog_help(self, cog: commands.Cog):
        await self.context.send(
            embed=discord.Embed(
                title=f"Help for {cog.qualified_name.replace('_', ' ')}",
                description=cog.description or "No Description",
                color=self.context.bot.info_color
            ).add_field(
                name="Commands",
                value="\n".join([f"`{i.qualified_name}`" for i in cog.get_commands()])
            ).set_footer(
                text=f"This cog currently has {len(cog.get_commands())} commands",
                icon_url=self.context.bot.user.avatar.url
            )
        )
slate swan
boreal ravine
hushed galleon
sage otter
slate swan
silver agate
#

command yeah

#

again. the rest worked but only this isnt

#

wait

#

ah lol hahaha

slate swan
#

pityesports 🤔

sage otter
#

That wasnt my question. Im asking what a _MissingSentinal is and why its being propagated.

torn sail
# sage otter and?

Usually context would be there. _MissingSentinal basically it like None

sage otter
boreal ravine
#

hm

slate swan
torn sail
slate swan
hushed galleon
sage otter
slate swan
torn sail
slate swan
boreal ravine
torn sail
#

And the title would be normal

silver agate
#

anything important in there? its annoying.

slate swan
sage otter
slate swan
slate swan
unkempt canyonBOT
#

class discord.Embed(*, colour=None, color=None, title=None, type='rich', url=None, description=None, timestamp=None)```
Represents a Discord embed.

len(x) Returns the total size of the embed. Useful for checking if it’s within the 6000 character limit.

bool(b) Returns whether the embed has any data set.

New in version 2.0.

For ease of use, all parameters that expect a [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)") are implicitly casted to [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)") for you.

Changed in version 2.0: `Embed.Empty` has been removed in favour of `None`.
slate swan
#

discord.Embed.url @slate swan

torn sail
unkempt canyonBOT
#

await send_help(entity=<bot>)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).

Shows the help command for the specified entity if given.
The entity can be a command or a cog.

If no entity is given, then it’ll show help for the
entire bot...
green bluff
#

does selecting from a database

#

cause delays or is it just inserting

slate swan
sage otter
slate swan
boreal ravine
green bluff
slate swan
torn sail
unkempt canyonBOT
boreal ravine
slate swan
#

^ +1

green bluff
#

yes ik but i cant figure how to to do asyncio.run in defining client

#

cause im trying to get prefix but asyncio.run just gives an error

boreal ravine
slate swan
green bluff
slate swan
boreal ravine
slate swan
#

^ @slate swan

slate swan
slate swan
unkempt canyonBOT
#

class discord.Embed(*, colour=None, color=None, title=None, type='rich', url=None, description=None, timestamp=None)```
Represents a Discord embed.

len(x) Returns the total size of the embed. Useful for checking if it’s within the 6000 character limit.

bool(b) Returns whether the embed has any data set.

New in version 2.0.

For ease of use, all parameters that expect a [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)") are implicitly casted to [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)") for you.

Changed in version 2.0: `Embed.Empty` has been removed in favour of `None`.
green bluff
#

shit

slate swan
#

can I add 2 titles?

green bluff
#

ok reset token

#

i guess iw ont share it lmao

boreal ravine
#

command_prefix=get_prefix @green bluff

slate swan
boreal ravine
#

you don't need to await it, d.py does that for you

slate swan
#

no

maiden fable
slate swan
#

anyway to make the description as big as the title?

hushed galleon
# sage otter If it helps. Heres the current implementation. https://paste.pythondiscord.com/e...

send_help could work, although it comes with the caveat of having to create another HelpCommand instance; the alternative is passing the help command object to your navigator and using send_cog_help from that: ```py
class Navigator(discord.ui.Select):
def init(self, ctx: AsahiContext, help_command: AsahiHelp):
...

async def callback(self, interaction: discord.Interaction):
    await self.help_command.send_cog_help(...)```
maiden fable
boreal ravine
slate swan
slate swan
#

my bad :>

boreal ravine
slate swan
slate swan
#

oh

#

:")

hushed galleon
slate swan
#

hey, what does async def riddle(self, ctx, *, question): what is the "*" in the paramaters mean

green bluff
#

workeed

slate swan
#

makes sense, thanks!

opaque spear
#

Can someone explain in layman's terms how bots work. Do they pull from a list of acceptable responses? Do they build their own sentences. I'm going to try and learn python again and I think a chatbot would be fun but don't want to get in over my head on the first one! 😅

silver agate
#

idk where I missed it...

#
@bot.command(
    name="Erster Befehl",
    description="Test UI",
    options=[
        interactions.Option(
            name="Command1",
            description="Beschreibung1",
            type=interactions.OptionType.SUB_COMMAND,
            options=[
                interactions.Option(
                    name="option",
                    description="Beschreibung2",
                    type=interactions.OptionType.INTEGER,
                    required=False,
                ),
        interactions.Option(
            name="Command2",
            description="Beschreibung3",
            type=interactions.OptionType.SUB_COMMAND,
            options=[
                interactions.Option(
                    name="option2",
                    description="Beschreibung4",
                    type=interactions.OptionType.STRING,
                    required=True,
                ),
            ],
        ),
    ],
)```
#

Am I blind or what

hushed galleon
#

the interactions.Option for that is also unclosed too

silver agate
#

It is?

#

or which one ur talking about, but they should be closed, if not it would show another error

silver agate
#

but Idk how to close the options on top.
if I put it another ] it closes something else

slate swan
#

you passed in the options kwarg twice

silver agate
#

huhg

midnight gorge
#

why isn't loading cogs on 2.0?

#
client = bot 
for filename in os.listdir('./cogs'):
    if filename.endswith('.py') and not filename.startswith('_'):
        client.load_extension(f'cogs.{filename[:-3]}')
hushed galleon
#

speaking of which that is a copy paste of their example which has the syntax error

silver agate
#

my problem is that it does not close

wary zenith
#

anyone know how to how to string parse math for a math command

torn sail
hushed galleon
#

oops

midnight gorge
#

so that means that you don't use that anymore on 2.0?

torn sail
#

You do. You just await them now

wary zenith
#
@commands.command()
    async def math(self, ctx, *, args): #todo```
midnight gorge
torn sail
#

Yes but you need to move it to the setup hook

#

!d discord.Client.setup_hook

unkempt canyonBOT
#

await setup_hook()```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).

A coroutine to be called to setup the bot, by default this is blank.

To perform asynchronous setup after the bot is logged in but before it has connected to the Websocket, overwrite this coroutine.

This is only called once, in [`login()`](https://discordpy.readthedocs.io/en/master/api.html#discord.Client.login "discord.Client.login"), and will be called before any events are dispatched, making it a better solution than doing such setup in the [`on_ready()`](https://discordpy.readthedocs.io/en/master/api.html#discord.on_ready "discord.on_ready") event.

Warning

Since this is called *before* the websocket connection is made therefore anything that waits for the websocket will deadlock, this includes things like [`wait_for()`](https://discordpy.readthedocs.io/en/master/api.html#discord.Client.wait_for "discord.Client.wait_for") and [`wait_until_ready()`](https://discordpy.readthedocs.io/en/master/api.html#discord.Client.wait_until_ready "discord.Client.wait_until_ready")...
wary zenith
midnight gorge
#

...

wary zenith
#

ive never used that and my cogs load just fine

torn sail
wary zenith
#

im tired of updating from the repo

#

i want to update using the pip

#

pypi*

green bluff
#

how to make embeds colourless

wary zenith
wary zenith
#

not sure what it is

green bluff
#

o i see ty tho ill try look it up

slate swan
#

its not a transparent embed color, its just the same color as Discord background

green bluff
#

because i tried that and u can see colour when highlited

slate swan
green bluff
#

ok

slate swan
#

the hex for that color is 0x36393F

green bluff
#

oh lmao and ow my eyes hurt

green bluff
green bluff
slate swan
#

cause discord provides no option for transparent embeds

green bluff
#

look the same while highlighted

slate swan
#

thats just the same colour as the discord dark background

green bluff
slate swan
# slate swan the hex for that color is 0x36393F

Nope - peuple tend to keep the embed look and have color the same as the embed dark gray color.

Inspecting the embed element will give you that color as background, more specifically the background-secondary variable. Which is --background-secondary: #2f3136;

slate swan
green bluff
#

i mean background secondary

slate swan
#

They don't provide real support for transparent color as already said so the closest you can get is to have the same color as the background.

green bluff
#

looks just like background

slate swan
#

No

#
        if answer.lower() == "toothbrush":
          ctx.send("Correct Answer")

Is there a way I can make it so after someone guesses the right answer, the answer isn't claimable anymore? For example, the user guesses the right answer and gives them a role but nobody else after they guess it can put the answer in and get the role?

#

Works fine

slate swan
#

As we don't know how you've implemented the command/feature so far we can't help but just guess on solutions.

#

I need it so lets say you guess the answer and then I see you guess the answer, I just take it and put it in for the same reward you got. I want it so where its a "one-time" answer kinda thing

slate swan
#

which seems to do the same

#

Not really - you don't keep the embed "layout"

#

It won't look as "good" as with the other one which will still keep the rounded corners

paper sluice
#

good morning

latent dawn
#

!resources

unkempt canyonBOT
#
Resources

The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.

slate swan
#
    async def send_bot_help(self, mapping: [dict] = None):
        e = Embed(
            color=0x8e65b3,
            description=
            f'**questions @ woke#7396**\n'
            f'{len(self.context.bot.commands)} commands in total\n'
            f'\u200b\n'
        )
        if mapping:
            for cog, command_set in mapping.items():
                filtered = await self.filter_commands(command_set, sort=True)
                if not filtered:
                    continue
                name = cog.qualified_name if cog else "no category"
                command_list = ', '.join(
                    command.name for command in filtered
                )
                value = (
                    f'{cog.description}\n{command_list}'
                    if cog and cog.description
                    else command_list
                )
                e.add_field(name=name, value=value, inline=False)
        await self.context.send(embed=e)
``` how do i make it so it gives me the filtered command count instead of the full command count
#

How do you get a category by its ID in py?

green bluff
green bluff
#

for example

#
import discord

discord.utils.get(ctx.guild.channels, id=category_id)
slate swan
#

guild.channels?

green bluff
slate swan
#

You can't negate an avatar

slate swan
green bluff
slate swan
#

weird

        category = discord.utils.get(ctx.guild.channels, id='968374998823755806')
        channel = await ctx.guild.create_text_channel(name=f'{ctx.author.id}', category=category, overwrites=overwrites)
slate swan
slate swan
#

oh

slate swan
green bluff
#

it has to be an integer

slate swan
green bluff
#

ohh

#

lmao im dumb

slate swan
#

filter_commands returns a list, get the length of the list

slate swan
#

wait sec

slate swan
green bluff
#

code

slate swan
# green bluff show

nvm fixed it w this " category = discord.utils.get(ctx.guild.categories, id=968374998823755806)"

#

Your filtered variable is only available within the for loop and below but still in that loop scope

slate swan
#

Then just save the count in an outside variable and define your embed at the end

#

And you probably can't make multi lines like that

slate swan
#

Well then you can do such horrible code KEKW

#

if i have the original code, it doesnt have any problem

slate swan
#

change my mind B)

echo wasp
#

Hello, I am In an blockfront minecraft server and i was wondering how do i make the welcome message unique?

scarlet sorrel
#

my bot is hosted on aws and i used nohup to run it and now i cant see it in ps and cant turn it off

slate swan
#

how to make time mute?

slate swan
#

You can get its length

#

You already use the function filter_commands and save it in a variable

#

Simply save its length in an outer variable and then build your embed

#

Yeah but when I try to save it's length its giving me errors

#

Well I can't see your screen nor code :)

#

pardon the language, how can i make a similar mute?

#

As I can't read Russian I will make a guess..

Mute the user, then use asyncio.sleep to sleep an amount of seconds which will be given by the user, then unmute the user

slate swan
#

wait

#

If you want to mute a user for a specific time the explanation above is right

#

Although I would recommend to use the timeout feature that Discord now has

shell wing
#
Because no versions of discord match >1.7.3,<2.0.0
   and discord (1.7.3) depends on discord.py (>=1.7.3), discord (>=1.7.3,<2.0.0) requires discord.py (>=1.7.3).
  Because discord.py (1.7.3) depends on aiohttp (>=3.6.0,<3.8.0)
   and no versions of discord.py match >1.7.3, discord.py (>=1.7.3) requires aiohttp (>=3.6.0,<3.8.0).
  Thus, discord (>=1.7.3,<2.0.0) requires aiohttp (>=3.6.0,<3.8.0).
  So, because python-template depends on both aiohttp (^3.8.1) and discord (^1.7.3), version solving failed.

  at venv/lib/python3.8/site-packages/poetry/puzzle/solver.py:241 in _solve
      237│             packages = result.packages
      238except OverrideNeeded as e:
      239return self.solve_in_compatibility_mode(e.overrides, use_latest=use_latest)
      240except SolveFailure as e:
    → 241raise SolverProblemError(e)
      242243│         results = dict(
      244│             depth_first_search(
      245│                 PackageNode(self._package, packages), aggregate_package_nodes
/home/runner/Cadmus-slash/venv/lib/python3.8/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
exit status 1
``` what did i missed in installing ?
shell wing
vale wing
#

The command

shell wing
#

pip install discord.py

shell wing
vale wing
#

Well what the hell

shell wing
vale wing
#

@shell wing try this

$ python3 -m pip install discord.py```
#

And for god's sake don't use replit

shell wing
#

👀😳

vale wing
#

Why not use VSC

shell wing
vale wing
#

Like pycharm may be heavy but what's wrong with vsc

tired hinge
shell wing
#

i can use pycharm...

shell wing
vale wing
#

Imho

shell wing
#

alr alr 👀

tired hinge
#

that errors weird asf, back when i used to use replit, it was annoying asf and i had no idea how to solve it

#

@shell wing ^

shell wing
#

i got replit premium...

#

but thats shitty too lmao

#

due to common ip

tired hinge
shell wing
tired hinge
#

i think i have a fix for that

#

one second

shell wing
#

alr

tired hinge
#
import os
try:
    bot.run(os.getenv("TOKEN"))
except:
    os.system("kill 1")
    bot.run(os.getenv("TOKEN"))
shell wing
#

oo

#

well the issue is common ip so if rate limited it wont work

#

even after killing it

tired hinge
#

tho idk i stopped using it a while back

shell wing
#

Cool

#

ig now ima go to vps and stuff

#

ditching replit

#

for good ig

slate swan
#

how to make a kick reason, but if it was not specified there was no reason = none?

slate swan
#

that's for muting it looks like

maiden fable
green bluff
#

can someone please tell me

#

how to handle this exception

spring flax
#

wth is wrong with my keyboard

spring flax
green bluff
#

what would i write

#

ive only handled bad arguement and missing permission

#

exceptions so far

spring flax
#

the exception is what i said

slate swan
#

interesting

#

Then handle that exception the same way you did the others

green bluff
#

which is?

green bluff
slate swan
#

You just said you handled 'bad arguement and missing permission'

#

How did you handle them

green bluff
#

@commandname.error

#

async def error if is instance error commands.badarguement

slate swan
#

Then, do the same for NotFound

green bluff
#

so error, discord.NotFound?

spring flax
unkempt canyonBOT
#

exception discord.NotFound(response, message)```
Exception that’s raised for when status code 404 occurs.

Subclass of [`HTTPException`](https://discordpy.readthedocs.io/en/master/api.html#discord.HTTPException "discord.HTTPException")
green bluff
#

what error would this be

#

i had an increase in braincells after learning how to error handle

slate swan
#

It's always written

green bluff
vast gale
#

you need to share the full traceback

slate swan
#

converting "e" to an integer?

green bluff
#

oh ValueError

#

im trying to handle all str errors

vast gale
#

the full traceback

green bluff
#
    return await self._callback(self.binding, interaction, **params)  # type: ignore
  File "c:\Users\notvi\Desktop\Opal\Opal[TESTER]\cogs\Ban_Util.py", line 99, in unban
    mem = await self.client.fetch_user(int(member_id)) or self.client.get_user(int(member_id))
ValueError: invalid literal for int() with base 10: 'e'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Users\notvi\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\app_commands\tree.py", line 1092, in call
    await command._invoke_with_namespace(interaction, namespace)
  File "C:\Users\notvi\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\app_commands\commands.py", line 629, in _invoke_with_namespace
    return await self._do_call(interaction, transformed_values)
  File "C:\Users\notvi\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\app_commands\commands.py", line 622, in _do_call
    raise CommandInvokeError(self, e) from e
discord.app_commands.errors.CommandInvokeError: Command 'unban' raised an exception: ValueError: invalid literal for int() with base 10: 'e'```
vale wing
#

Anyone knows how to catch disnake.Forbidden with try-except? Cause I do have it but still getting it unhandled

slate swan
#

instead of converting it to an integer later , you could have typehinted it to int and it would raise an commands.BadArgument if it was not an integer

green bluff
#

in a slash command atleast

slate swan
vale wing
vale wing
#

disnake.HTTPException doesn't work either

#

Ig it's about those stupid wrapped exceptions

slate swan
#

cause your message sending part is inside the except itself

#

!e ```py
a = {"id":1}
try :
pass
except:
print(a["test"])

is what youre doing

#

oh wait

#

did you try using try except blocks inside the methods the error comes from?

#

pls send discord role permission can ban

#

!d discord.Permissions.ban_members is what you mean?

unkempt canyonBOT
slate swan
#

thx

#

who can help me?

boreal ravine
#

Are you following PEP 9001 😮

slate swan
#

but I don’t understand what’s wrong, why it works but the unban message doesn’t come

#

example

hasty stump
green bluff
#

why can i
still ban

#

when hes not in my server
it throws an error
which i dont know
how to handle

#

ive tried
Try except

slate swan
#

can i make change prefix?

#

and change language

vale wing
#

Look at traceback and see where it's raised from

green bluff
slate swan
#

how to do it?

brittle bear
#
ImportError: cannot import name 'AppCommandOptionType' from 'discord.enums' (C:\Users\xavee\AppData\Local\Programs\Python\Python310-32\lib\site-packages\discord\enums.py)

why do i keep getting this error when importing from discord import app_commands

vale wing
slate swan
vale wing
#

When the exception is raised in inner function it goes upside until it gets caught

green bluff
#

not discord.ext

vale wing
#

K

#

Well have you tried something like from discord.app_commands import ...

#

It might be a directory and not a package so you can't import it but once again - I don't know personally so it's a guess

slate swan
#

app_commands is a folder

slate swan
slate swan
#

who can help me?

#

make unban emb

#

I can not

#

owo

slate swan
#

yes\

#

!d discord.Embed @slate swan

unkempt canyonBOT
#

class discord.Embed(*, colour=None, color=None, title=None, type='rich', url=None, description=None, timestamp=None)```
Represents a Discord embed.

len(x) Returns the total size of the embed. Useful for checking if it’s within the 6000 character limit.

bool(b) Returns whether the embed has any data set.

New in version 2.0.

For ease of use, all parameters that expect a [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)") are implicitly casted to [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)") for you.

Changed in version 2.0: `Embed.Empty` has been removed in favour of `None`.
slate swan
slate swan
slate swan
#

I don't know what's wrong here

vale wing
#

How to catch Forbidden this doesn't catch it

slate swan
vale wing
#
"{}".format(member.mention)```
Pretty nice construction
#

But why tf not just use member.mention

#

Yes but rule 4 exists

#

!rule 4

unkempt canyonBOT
#

4. Use English to the best of your ability. Be polite if someone speaks English imperfectly.

slate swan
#

i know

vale wing
#

If you want to speak russian with me you can go to dms

slate swan
drifting arrow
#

Does discordpy have a way to track how long someone has been in a voice channel?

#

Or do I have to do that myself manually?

slate swan
#

By yourself

drifting arrow
#

Sadge

tawdry perch
#

well you can use bot to track it afaik

slate swan
#

me need help

#

Without code or errors nobody can help.

tawdry perch
slate swan
#

its work, but the message is not sent

#

Define "its work"

#

Have you tried to debug to be sure it actually works as intended?

#

it should unban the user after K.unban and send a message like this

#

And does it work?

#

Does it unban the user?

slate swan
unkempt canyonBOT
#
I'm sorry Dave, I'm afraid I can't do that.

No documentation found for the requested symbol.

upper helm
#

Hi, I keep getting this error message;

Traceback (most recent call last):
  File "/home/runner/ParchedExtrasmallTaskscheduling/venv/lib/python3.8/site-packages/discord/client.py", line 343, in _run_event
    await coro(*args, **kwargs)
  File "main.py", line 17, in on_message
    await sendchannel.send(message.content)
  File "/home/runner/ParchedExtrasmallTaskscheduling/venv/lib/python3.8/site-packages/discord/abc.py", line 1065, in send
    data = await state.http.send_message(channel.id, content, tts=tts, embed=embed,
  File "/home/runner/ParchedExtrasmallTaskscheduling/venv/lib/python3.8/site-packages/discord/http.py", line 254, in request
    raise HTTPException(r, data)
discord.errors.HTTPException: 400 Bad Request (error code: 50006): Cannot send an empty message```
drifting arrow
slate swan
slate swan
slate swan
unkempt canyonBOT
#

discord.on_voice_state_update(member, before, after)```
Called when a [`Member`](https://discordpy.readthedocs.io/en/master/api.html#discord.Member "discord.Member") changes their [`VoiceState`](https://discordpy.readthedocs.io/en/master/api.html#discord.VoiceState "discord.VoiceState").

The following, but not limited to, examples illustrate when this event is called...
upper helm
slate swan
#

They said

its work
which it doesn't

drifting arrow
slate swan
#

welp

upper helm
#

the bot was supposed to copy & paste it onto another channel, I send the message and it says this

tawdry perch
slate swan
slate swan
drifting arrow
upper helm
#

well, I kinda got the bot scripted for me but the dude I paid to script is ignoring me so

slate swan
slate swan
#

self_bot....?

#

!rule 2

unkempt canyonBOT
upper helm
#

I meant

slate swan
#

Self bots are against the Terms of Service of Discord.

upper helm
#

OH

slate swan
#

We won't provide help for that

upper helm
#

bruh, this guy

paper sluice
#

\💀

upper helm
#

@slate swan thank u

slate swan
#

Then there are tutorials around on the Internet for further help and guidance

#

what's wrong? it doesn't send unban message

#

Just as side note, you're unbanning everyone from the server and not just a single member

#

This unbans every member that was banned

#

what to do?

#

me need unban 1 user

#

Add a check

#

To see if the current ban_entry.user is actually the member you want to unban

#

what to do with the message?

#

And you need to type hint the member parameter to discord.User - and rename the parameter to user so that is follows naming conventions.

#

Otherwise it will simply never work, banned users are no longer members of the guild.

#

ok

brittle bear
#

how do i detect if the user who clicked the button isnt the one that ran the slash command?

high sun
brittle bear
#

im using dpy 2.0

#

i cant add ctx on slash commands

slate swan
#

You can

high sun
#

you should have a bot.wait_for()

slate swan
#

It's must not called ctx

brittle bear
#

how

#

@slate swan

slate swan
#

Instead of ctx you can name it inter or interaction which is an object of type discord.Interaction.

#

!d discord.Interaction

unkempt canyonBOT
#

class discord.Interaction```
Represents a Discord interaction.

An interaction happens when a user does an action that needs to be notified. Current examples are slash commands and components.

New in version 2.0.
brittle bear
#

it is interaction

slate swan
#

You then have the following attributes and methods

high sun
#

A slash command does have ctx as argument

green bluff
#

how would i handle this

#

as a command not found error

slate swan
#

Just like you handle all other errors in your code

brittle bear
#

someone told me in another server to use interaction_check instead, they didnt give me proper information tho

high sun
#

@brittle bear you probably have assigned something like `SlashCommand(bot) in your code, haven’t you?

brittle bear
#

no

slate swan
#

Simply add another case

brittle bear
high sun
#

How does your current slash command look like

slate swan
#

Yeah as I said - it's discord.Interaction

green bluff
#

how to make one that detects all errors

#

sorry for ping oopsies

slate swan
brittle bear
slate swan
#

It does, since you now have a ctx like parameter

green bluff
#

why ur app_command is not registering

#

is ur app_command not shwoing up

#

it takes an hour to show up without assigning a guild

slate swan
brittle bear
green bluff
slate swan
#

Or you can also take a look at this

#

Which also links to the guide above

vale wing
#

I have on_error overwritten but it shouldn't be what is causing errors as its purpose is to do logging and nothing else

green bluff
#

!paste

unkempt canyonBOT
#

Pasting large amounts of code

If your code is too long to fit in a codeblock in discord, you can paste your code here:
https://paste.pythondiscord.com/

After pasting your code, save it by clicking the floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.

brisk dune
#

Somebody suggest some discord bot commands...

loud junco
upbeat gust
loud junco
#

lol

brisk dune
#

I literally can't think of anything after "Hello!" command

loud junco
#

A mod bot?

#

Ban and kick

#

💀

brisk dune
#

True

#

could put in modding capabilities...

brisk dune
loud junco
#

Vc handler

jade tartan
#
Traceback (most recent call last):
  File "C:\Users\thoma\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\client.py", line 343, in _run_event   
    await coro(*args, **kwargs)
  File "c:\Users\thoma\OneDrive\Desktop\discord server bot\Bot2.py", line 31, in on_member_join
    await member.send(embed=Myembed)
  File "C:\Users\thoma\AppData\Local\Programs\Python\Python310\lib\site-packages\discord_components\dpy_overrides.py", line 350, in send_override
    return await send(channel, *args, **kwargs)
  File "C:\Users\thoma\AppData\Local\Programs\Python\Python310\lib\site-packages\discord_components\dpy_overrides.py", line 325, in send
    data = await state.http.send_message(
  File "C:\Users\thoma\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\http.py", line 248, in request        
    raise Forbidden(r, data)
discord.errors.Forbidden: 403 Forbidden (error code: 50007): Cannot send messages to this user``` Is something to do with dms?
slate swan
jade tartan
#

ok wow glad that i something

lyric apex
junior verge
supple thorn
#

Is that js

inner sierra
#

Can't we make bot online 24/7

#

??

slate swan
#

u can

slate swan
#

Traceback (most recent call last):
File "C:\Users\User\Desktop\бот дс\bot.py", line 34, in <module>
async def clear(ctx, amount = 1):

#

what to do?

tired hinge
#

you aren't sending the full error

#

send the entire traceback

slate swan
#

second

#

it full

tired hinge
#

you probably have a duplicate somewhere in your code.