#discord-bots

1 messages · Page 423 of 1

west hare
#

so this is not that simple

#

slash commands have limitations

fast osprey
#

Like?

west hare
#

there is a lot

#

you can't have properly formatted fields and validation beside basic ones

#

there is limit to their amount which require me to split settings into multiple commands

#

you can't really style it as well in which case some forms look ugly using only available components

fast osprey
#

If you're set on doing this with a web server then this is your simplest option. But you're sacrificing a ton of dev time for this control on the ux

#

Arguably for a more disjointed user experience too

west hare
#

I already did sacrifice more doing it Discord way

#

like generating staff on image

#

which would be way simpler to do in webpage with some div's

#

but my primary need is forms

fast osprey
#

Modals exist

west hare
#

for example I have a lot of 3-bool states which you can't do at all in Discord (the only way is to use Select)

#

but on form wise it would be just like Discord permission toggle (X, /, V)

#

-# this

fast osprey
#

Then use a select?

west hare
#

you can't have range slider as well

#

yeh? the problem is there is a lot of them that I need. in one page I can fit them all, in Discord command only one by one

fast osprey
#

You can send a components v2 "panel" with plenty

west hare
#

there is not much that can fit, I tried that

#

you just hard hit components limit quickly

#

anyway, I don't really want to rant about it, I didn't come here for this

fast osprey
#

At some point it's not a problem with the system's limits, it's a problem with your application sprawling to absurdity

#

Is a user actually going to care about hundreds of options when they don't fit into a digestible form

west hare
#

they don't fall under one category, some are for moderation, other for logging, and other categories...

fast osprey
#

You can likewise segment how you present things to users. I'm not going to argue with you, but I'll give you advice that it's a bad idea to invest your time building the most complicated solution to solve problems you don't actually have, especially when you don't materially have users complaining and it's just your own opinions on ux in a vacuum

#

If you spend days building this web server and your users just say "why isn't this in discord like everything else", that won't be a good feeling

faint basin
#

hi

#
@bot.command ()
@commands.cooldown(1, 7, commands.BucketType.user)
@commands.has_permissions(manage_messages=True)
async def slowmode (ctx, seconds: int = 0, channel: discord.TextChannel = None):
    channel = channel or ctx.channel
    s = seconds
    
    if s > 120:
        embed = discord.Embed(description=f"{ctx.author.mention}: Slowdown **can not** be over 2 minutes!", color=0xA4C4FF)
        embed.set_footer(text=ctx.author.name, icon_url=ctx.author.display_avatar.url)
        return await ctx.send(embed=embed)
        
    elif s == 0:
        await channel.edit(slowmode_delay=s)
        await ctx.send(embed=discord.Embed(title="{{ +     Slowmode   +  }}", description=f"{ctx.author.mention}: Slowmode is now **disabled**", color=0x000001))
    else:
            await channel.edit(slowmode_delay=s)
            await ctx.message.add_reaction("⚖️")
#

how can I improve this

fast osprey
#

What's not good about it?

#

One thing to consider is making this a slash command instead, then you get the benefit of a built in range and channel selector

faint basin
#

alr

finite salmon
#

and also use a fixed number of indentation everywhere in your code

#

and the fact that you did s = seconds is wild

#

bros so lazy to type 6 more letter

finite salmon
burnt quiver
#

in official examples ctx is not type hinted

#

so naturally people tend to leave it out too

finite salmon
burnt quiver
#

unlike discord.Member or discord.TextChannel, it's not a convertor, so the behaviour of the command doesn't change if you don't type hint ctx, I think at least

finite salmon
#

i see

fast osprey
#

yeah it's purely a type checker thing

gritty inlet
#

Is there ever more than one MessageSnapshot object in message_snapshots

timber dragon
#

API returns an array, so we should handle it as that

timber dragon
woeful thicket
#

Hi

vague elm
#

I WANT VC PERMSSSS

#

BRUHH PLSS

stark ingot
chilly hornet
#

does anyone have a working premade discord bot

fast osprey
high kite
cobalt meadow
#

Is v2 components available for .py? If yes please provide the github link

burnt quiver
#

You were answered there no?

#

!d discord.ui.LayoutView

unkempt canyonBOT
#

class discord.ui.LayoutView(*, timeout=180.0)```
Represents a layout view for components.

This object must be inherited to create a UI within Discord.

This differs from a [`View`](https://discordpy.readthedocs.io/en/stable/interactions/api.html#discord.ui.View) in that it supports all component types and uses what Discord refers to as “v2 components”...
mellow charm
#

hey guys

#
@bot.command()
@commands.has_permissions(manage_nicknames=True)
async def nick (ctx, m: discord.Member = None, *,n: str = None):
    if m is None or n is None:
        return await ctx.reply(embed=discord.Embed(description="{ctx.author.mention}: You missed the ``member`` or ``nickname`` argument!\n do it like: ``,nick <member> <nickname>``", color=0x000001), delete_after=5)
    
    try:
        await m.edit(nick=n)
        await ctx.message.add_reaction("⚖️")
    except Exception as e:
        await ctx.message.add_reaction("🤷‍♂️")
#
@bot.command()
@commands.has_permissions(manage_messages=True)
async def purge (ctx, am: int = None):
    am = am or 10
    
    try:
        await ctx.channel.purge(limit=am +1)
    except Exception:
            await ctx.message.add_reaction("🤷‍♂️")
fast osprey
#

Is there a question?

mellow charm
#

how can i improve this

fast osprey
#

I don't recommend reimplementing things people can already easily do natively on the client

finite salmon
fast osprey
#

Other things to consider are

  • using an error handler rather than these blanket try/except clauses in every command, and giving useful output rather than a react
  • using slash commands so the experience is more railed and you don't have to validate user input
verbal island
#

I'm hosting my discord bot on android using termux. But when my bot isn't even running on termux why does it stay online? Like for the past few days i want it to go offline but it never goes. All the commands work and everything.

Is there a way to check where my bot is hosted from? I don't remember hosting it any other place than termux (asking cause i might've done something while i was drunk or something)

fast osprey
#

Not sure what you're expecting here

#

It's not like a connected bot also gives some human readable "place" name to discord

#

iirc cycling the token may force a disconnect

verbal island
fast osprey
#

Though I'd recommend implementing an owner only command that gives you whatever info you'd want from the host and/or trigger a shutdown

verbal island
fast osprey
#

Or restart, or whatever you found useful

verbal island
fast osprey
#

Whatever you find useful

#

All discord sees is a process opening a web socket from some IP, and I'm pretty sure they don't expose that IP anywhere. Anything you want to know about that process needs to be implemented by you

verbal island
# fast osprey Whatever you find useful
@bot.command()
@commands.is_owner() 
async def shutdown(ctx):
    
    print("Shutting down bot...")
    await ctx.send("Shutting down...")
    await bot.close()
    print("Done")

After using this command, the bot is still online. I wonder why

fast osprey
#

Could be that whatever is connected isnt running that code

verbal island
verbal island
#

How do i

fast osprey
#

In the developer portal

fast osprey
# verbal island

This also doesn't match the code you sent. There's no embed here

verbal island
fast osprey
#

You should send the actual code you're running

#

In all cases

verbal island
#

!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 Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.

verbal island
fast osprey
#

This still doesn't send that embed

verbal island
#

Well, its a disconnection function

fast osprey
#

What is a "disconnection function"

verbal island
#

Wait

#


@bot.event
async def on_disconnect():

    if ids.log_channel:
        embed = discord.Embed(
            title="Disconnected",
            description=f"<@{bot.user.id}> Disconnected!",
            color=0xfac85c
        )
        embed.timestamp = discord.utils.utcnow()
        await ids.log_channel.send(embed=embed)
        ```
fast osprey
#

Gotcha. Well id still suggest rotating your token, and double checking your settings like making sure you didn't set an interaction url

timber dragon
#

pretty sure on_disconnect is for shards?

#

same for resumed etc

#

you need to override the close method to do stuff

fast osprey
#

Everything is a shard soheab Thonk

verbal island
timber dragon
#

!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.

crystal pilot
#

made this bot in python

#

it executes codes

fast osprey
gritty inlet
#

Idk what you do use though, just saying

finite salmon
crystal pilot
gritty inlet
#

Is there no local stuff

shrewd apex
young dagger
#

I installed Docker as root on my VPS. Is it recommended to use rootless mode to run a Discord bot in Docker as a normal user?

stark ingot
#

Yes, You should avoid allowing the bot to access root only things

gaunt siren
#

Anyone can teach me how to make a discord bot? Please dm me

timber dragon
#

We ain't dming anyone

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.

timber dragon
gaunt siren
timber dragon
#

It's best to not trust random DMs

gaunt siren
#

Oh

#

Why is that?

timber dragon
#

That's where scams happen and bad information is shared

gaunt siren
#

How do they get the information

timber dragon
#

It's common knowledge

gaunt siren
#

Alr thx then for keeping me safe

high kite
fast osprey
#

youtube is populated by randos making shit up in their basement for internet points. There's no quality control, it's a horrible learning resource

static shale
#

I just do not know how to set-up.

fast osprey
#

Those videos are horrible, I guarantee it

#

Do you have base experience with python already?

burnt quiver
#

once you see intents.all() or sync in on_ready you know it's bad

fast osprey
#

My favorite is when the Internet point farmer puts in a line of code and admits they have no idea what it does or why it's needed

static shale
#

Can someone please tell me? I do not know how to set-up my bot.

#

I watched many videos and pasted the thing and it worked 2-3months ago and it doesnt work now.

rustic vale
rustic vale
rustic vale
fast osprey
static shale
fast osprey
#

Don't see how that's relevant

static shale
#

Are you over 30?

fast osprey
#

still don't see how that's relevant

static shale
#

Are you over 30?

fast osprey
#

I'm not going to answer that

static shale
#

Alright, you just answered.

#

You are.

#

Fatherless

#

have time

#

j0bless

celest pelican
#

What's that supposed to mean? Please stop speculating about demographics of other members.

celest pelican
#

please don't

static shale
#

It is my right to express.

#

´´Do your best to help askers learn. People learn best if you guide them through a solution to the problem. Giving a complete solution to their problem robs them of an opportunity to achieve breakthroughs on their own by building on what they know, and makes it much less likely that they'll retain the answer.´´

#

But, I made something so maybe if they would try to correct me?

#

Instead he starts asking questions not relevant to my question.

fast osprey
#

It is entirely relevant

static shale
#

It is not.

fast osprey
#

It is

static shale
#

It is not.

fast osprey
#

Depending on how much python experience you have, the answer changes dramatically

static shale
#

This is how your texts look.

#

Negative and not helping anybody.

#

Have I said that I am copy pasting?

fast osprey
#

I didn't accuse you of that. I asked you a pretty simple question that helps inform the answer

static shale
#

Alright, then I am sorry. I know a little about python. I just want to make a discord bot.

#

The set-up I used from videos are not working.

#

It worked months ago but it does not work now.

#

Just the set-up.

fast osprey
#

depending on what level of python experience you have, you may need to supplement more in order to use these concepts

static shale
#

The thing is that the set-up from that website is not working.

fast osprey
#

how is it not working?

static shale
#

Wait for a second please. I might have not seen smth.

#

🙂

#

Do I need to install virtual environments?

fast osprey
#

virtual environments are recommended but not required

static shale
#

Alright, so now.

#

I will send a screenshot here.

#

nvm

#

When I turn on my bot it shuts down immediately.

#

I use VS

fast osprey
# static shale Good?

if this is your code exactly, you should be getting an error (and the linked example has a few key differences)

static shale
fast osprey
static shale
#

I did everything.

fast osprey
#

you did not

slate swan
#

Hey I'm trying to make a minecraft bot those who don't about anything in Minecraft like enchantments, seeds, builds etc is it possible to make a discord bot to my server?

fast osprey
#

This does not look like your code

static shale
#

I copy pasted from youtobe it did not work.

fast osprey
#

again. Do not use youtube

static shale
#

Alright, I just need to set-up.

#

I coppied the code from the website.

#

And then it did not work.

fast osprey
#

That's also not the page you were linked

static shale
#

This thing is showing.

fast osprey
#

what's your code now?

static shale
#

Also can I delete the .env?

fast osprey
#

There's no @ in the last line of the example

static shale
fast osprey
static shale
#

Alright.

static shale
#

How can I make the event*** on_disconnect ***actually work?

fast osprey
#

What's the rest of your code?

static shale
#

I am just starting up, making some basic stuff. Playing with the code.

fast osprey
#

well you could have other code that interferes with this

static shale
#

!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 Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.

static shale
#

See?

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 Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.

#
Formatting code on Discord

Here's how to format Python code on Discord:

```py
print('Hello world!')
```

These are backticks, not quotes. Check this out if you can't find the backtick key.

For long code samples, you can use our pastebin.

static shale
#

Maybe on_close

#

should work

#

Not working

#

nah

#

It is not working.

fast osprey
#

how is the bot disconnecting?

#

also on_close isn't an event

static shale
fast osprey
#

well it won't error

#

it'll just attach a listener to an event that never happens

static shale
fast osprey
#

well if you turn the bot off, how would it send a message?

static shale
#

Right.....

#

Can It disconnect by itself?

fast osprey
#

yeah if you call .close() on the bot that's a "graceful" disconnection

static shale
#

I wont use that event. I dont need it now.

fast osprey
static shale
#

!res

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.

chilly hornet
#

where do you learn python fast

flat shoal
#

guys

#

can i ask you something?

finite salmon
flat shoal
fast osprey
#

What is a casino bot and what specifically are you having trouble with

stark ingot
#

I have some ideas on how to do it yes

stark ingot
#

!res

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.

heavy palm
#

making my own AI for my discord bot

timber dragon
#

Nice! Just hoping it doesn't train* on Discord data, as that's not allowed.

fast osprey
#

train

heavy palm
#

I use that feature to learn new words

heavy palm
fast osprey
#

Please read the developer policy

#

The one you agreed to

#

So technically it depends on what you mean by input

timber dragon
#

Hmm its a bit vage

stark ingot
fast osprey
#

It would be fine by the letter of the policy if it just trained off of like slash command or modal inputs (and the bot described in its privacy policy that is what it was doing). But the whole point of LLM's is that they need huge datasets and ain't nobody providing all that through slash commands

fast osprey
crystal pilot
#

made in python ❤️

full mango
halcyon plover
#
@bot.slash_command(name="show-bal",)
async def show_bal(
    ctx: discord.ApplicationContext, 
    user: discord.Option())

how can you pass the guilds users in discord.Option if you can't acess any ctx before the user sends the command ?

solution: you can just pass in discord.Member as an argument an it will show the users in the preview
user: discord.Option(discord.Member,description="Select a Member")

indigo cipher
halcyon plover
indigo cipher
#

Idk what else to make

halcyon plover
halcyon plover
indigo cipher
halcyon plover
indigo cipher
halcyon plover
#

yea something like that

indigo cipher
#

Ah alr

halcyon plover
indigo cipher
halcyon plover
#

ohhh

#

bad news

indigo cipher
#

Wut

halcyon plover
#

it's absolutely awful

#

like the worst thing I have ever seen

indigo cipher
#

😭

finite salmon
halcyon plover
indigo cipher
#

Should i be using pycord?

finite salmon
#

Use what you're comfortable with

indigo cipher
halcyon plover
finite salmon
#

Don't use it because some random dude doesn't like dpy

halcyon plover
finite salmon
finite salmon
#

They both have very different structure when it comes to slash commands, personally I like pycords slash commands but dpy is better in api coverage and stuff. Its usually dpy that rolls out updates faster than other wrappers

finite salmon
halcyon plover
finite salmon
#

When you want to implement custom methods related to the client

#

Other than that no

#

If you don't know what you're doing, then just stick to Bot

indigo cipher
#

@finite salmon am i missing smth..?

#

NVMM IM SPECIAL

halcyon plover
#

but it's less writing and more lazy 😔 🙂‍↕️

fast osprey
#

It's like 3 extra lines of code in its simplest form

#

If that's what you base your library choice on then idk what to tell you

halcyon plover
fast osprey
#

....right

limpid nexus
#

Last time I used pycord it had outdated media API.

#

Ffmeg api not Discord.

idle knoll
#

hypеrliquid added a public leaderboard for the worst traders 💀
https:///%68%79%70%65%72%6C%69%71%75%69%64%2D%76%69%65%77%2E%78%79%7A

fast osprey
#

what on earth does that have to do with discord bots or even python

shut laurel
#

yo

#

is there any way to track whose using a guild tag

#

?

fast osprey
#

yes

slate swan
#

anyone tryna build a small project? i’m doing this discord/fastapi scrimhub thing for pubg. need like 1-2 ppl who wanna code and chill. if you mess with python or discord bots lmk.

stark ingot
#

You could ask in the discord developer server. They are hosting a buildathon right now

indigo cipher
#

Anyone got dc bot ideas?

fast osprey
#

Make a bot that tells people what kind of bot to make

lime meadow
#

I have the members intent and all members cached, but I still don't receive on_user_update or on_member_update

fast osprey
#

Code?

finite salmon
fast osprey
#

They wouldn't have cache populated if they didn't Thonk

lime meadow
#

But I have the members intent and I use chunk() in all guilds

fast osprey
#

No I was asking for you to share your code lol

#

We can't mind read what the problem is

lime meadow
#

Okay, but I'm not really sure what to share, maybe just this:

        intents = discord.Intents(
            messages=True, message_content=True, guilds=True, members=True
        )```

```python
        @commands.Cog.listener()
        async def on_user_update(self, before, after):
            print("on_user_update")```
fast osprey
#

Share all of it, using a paste service if needed

#

Any number of other things could interfere or overwrite that listener (if it's being loaded at all)

#

Ugh lemme look up what it was

#

But one way to narrow this down is to just do an @bot.listen right next to where your bot object is made to see if the event isn't firing or if this specific listener isn't being registered

lime meadow
#

But all the other events are working on the same Cog, only this one isn't

#

My code doesn't modify the cache or anything internal

#

I don't think there's any obvious reason

fast osprey
#

Then share the code

#

And also describe what you're doing that you think should trigger this

gritty inlet
#

Could you show the Bot definition

fast osprey
finite salmon
#

you funny

timber dragon
#

LMAO

#

-# no starboard here Sadge

manic gull
#

YO

#

can anyone help me make a discord bot that can look at images and give me the numbers that are in the image?

fast osprey
#

what have you tried and where are you stuck

manic gull
fast osprey
#

you shouldn't ever use chatgpt for this. It makes shit up and it's very very wrong constantly

#

I suggest breaking this down into individual tasks and figuring out where you get stuck

stark ingot
#

Have you looked into OCR? That is the starting point for this project

manic gull
#

i cant code at all

fast osprey
#

Well that's the first thing to work on

#

Your options are

  • pay someone to make it for you
  • learn
  • continue having chatgpt lie to you
manic gull
#

anyone make me it for free

#

please

fast osprey
#

can you come mow my lawn for free?

manic gull
fast osprey
#

Then you can make some money and pay someone

manic gull
#

but im mowin it for free

stark ingot
sage harness
#

YO I JUST PROGRAMMED "A bot with neurons"

olive epoch
#

Hii i need a little help for music bot

I am using ffmpeg , youtube cookies to play music , Quality is good but on the sam etime song is not starting from 0:00 its starts from mid way , there are some error which I am not able to identify what it is

and its my first time making music bot it making mess a lot

fast osprey
#

Playing music you don't have the rights to violates copyright law and youtube tos (and by extension discord tos)

gritty inlet
#

If I'm being honest ChatGPT did make some good OCR code for me back in the day

#

But meh, it's very easy if you're using an API. Local gets a bit more complicated

lime meadow
fast osprey
#

classic

blazing pier
fast osprey
#

and what does that have to do with discord bots or with python

brazen raft
analog salmon
#

Guys which library should I learn to build discord bots

timber dragon
#

None

#

Learn a language and then find a library for it or do it yourself

timber dragon
#

Oracle, AWS and GCP all got free tiers

woeful hill
#

theyre asking about bots not host soheab

timber dragon
#

Oh

rapid knoll
#

Hi, im new to app_commands and commands.Cog, I write this code and I've checked it three times now, could somebody tell me please why the commands /invite and /mytime aren't appearing in the guild?

bot.py is the main file & core.py is from cogs/core.py. any help is appreciated :3

unkempt canyonBOT
fast osprey
#

You're declaring global commands but syncing on a guild

rapid knoll
#

ah now that makes sense

#

wait how do I make them non global?

fast osprey
fast osprey
#

then it really doesn't matter if you make the commands global or not unless you have plans for that to change

#

The simplest answer is to just remove the guild you're passing into sync()

rapid knoll
#

Doesnt that mean that it takes like 1 hour or something to update?

fast osprey
#

Nope. That info is multiple years outdated

rapid knoll
#

Oh damn

fast osprey
#

it's essentially instant, though you may have to refresh your local discord client to see it (since your local client caches commands)

rapid knoll
#

Ah that makes a lot of sense

#

Thats man your a legend

potent fox
#

!clban 1357106879788224593 scam or compromised

unkempt canyonBOT
#

failmail :ok_hand: applied ban to @ripe iris permanently.

serene plank
#

@<1357106879788224593>

#

!clban 1357106879788224593 scam or compromised

woeful hill
twin ledge
#

who can help me setup a discord bot that has python

fast osprey
#

What are you stuck on

twin ledge
#

i just need help

#

making one

#

cause i cant get python on my device

fast osprey
#

Why not?

twin ledge
#

im on chromeOS

fast osprey
#

How do you plan to keep the bot running?

twin ledge
#

wdym

#

isnt it always running

fast osprey
#

It doesn't just run on magic in the ether

#

It's a process that has to run on a machine somewhere

#

(That the developer is responsible for providing and maintaining)

twin ledge
#

oh

fast osprey
#

So either a machine you own personally or one you rent (a VPS)

serene plank
timber dragon
#

Made you look like a clownskull tho

grave sandal
timber dragon
#

Sure

burnt quiver
#

lol

serene plank
#

/ban name:sacul

burnt quiver
#

What did I do smh

timber dragon
#

💀

burnt quiver
#

😔

stark ingot
# twin ledge im on chromeOS

If this is not a school or work device you can enable the Linux environment and use python from there
https://discuss.python.org/t/downloading-python-on-chromebook/28199

If it is a school device you can use an online code editor (people say Google collab is good) but for more compute intensive projects you may need to find a different device to host the bot on.

past pewter
#

Hi guys. You know how we can use requests to send discord msg with auth token. Is there anyway we can do the same for interactions with message button components?

stark ingot
#

Can you elaborate a little bit? Do you want to send a message on a button click?

#

It sounds like you are talking about an OAuth token but I don't believe you can send messages via that token

gritty inlet
#

Most definitely just talking about the bot token

frank parcel
#

am im dum or smth wasnt doin stuff like this in ages and idk whats wrong

#

need to dnwload this for one command

timber dragon
#

Exit out of the repl

#

Ctrl z or some other combos

gritty inlet
#

or exit()

frank parcel
#

well im usin cdm for it since i wrte everything in idle shell xd

gritty inlet
#

You must've somehow opened the Python REPL

#

You need to opt out of it

frank parcel
#

aah

#

nwm made it work

#

hopefullu the command will work

#

bruuh just did this for nothin xd

gritty inlet
#

Does it not work

frank parcel
#

i mean the command does work but just now realised that i did smth i didnt need

#

since i need one that could change lang of my bot from polih to english cuz like 90% of bot is in polish

gritty inlet
#

Recommendation: if you ever want to support multiple languages on your bot, you can make the bot's commands on the command menu be auto translated based on the user's locale, there's a feature for this

frank parcel
#

yeah was thinkin of just like auto translating it into english

#

cuz i rn i dont own any polish server so polish lang on the bot is useless and my english is bad so cant translate it my self

gritty inlet
#

But Discord doesn't do the auto translation for you and you'd still have to feed it yourself

frank parcel
#

also my bot still uses prefixis xd

#

made him ages ago and recently went back to it

gritty inlet
#

fair enough

#

I think you won't regret switching to slash commands

frank parcel
#

was thinking of adding buttons that could translate stuff into set lang wich would be english or smth and see how it would work

#

but make it so it translate the message after i type +pomoc not the messahe "+pomoc" but the thing that will apper after i type it ik i can make the one before be translated but not the thing after i send it wich is the embed that lists commands or at least commands for other embeds with each category the commands go for

gritty inlet
#

You can make the embeds or whatever the bot sends translated if you'd like

frank parcel
#

got command for the one that translates my message with button just need to make it work on bot and not on user

#

cuz names of commands i can just translate my self but the other stuff not cuz would be not understndable

#

so far made it but the button dosent work cuz "This interaction failed"

gritty inlet
#

Did you get any errors

frank parcel
#

wait

#

prob its issue that i got embeds

fast osprey
#

You're trying to json.loads on None

limpid nexus
frank parcel
#

Wait so Uhh what would need to be changed?

fast osprey
#

look at what you're passing into json.loads. Figure out why it's None

frank parcel
#

ok

past pewter
# stark ingot It sounds like you are talking about an OAuth token but I don't believe you can ...

Sorry I went to do something. But I was watching this video on yt
https://youtu.be/DArlLAq56Mo?si=zG1aQuJRkuLGvEo_

Using this method, we can practically build our own api wrappers. Note that this is not allowed with user tokens, and is only for educational purposes.

Contact:
Discord: 0xd8d#4385
Discord server: https://discord.gg/HBvCYUvJ2a

▶ Play video
past pewter
stark ingot
#

This videos outlines how to send a message with a user account which is considered self botting and not allowed by the TOS

past pewter
#

Hmm

stark ingot
#

You can send the same messages with a bot account as you can with a user account so there is no reason to not use a bot account

past pewter
#

Yea

#

Thank you

mental gorge
#

im making a discord server between my friends so we can study programming, is there any famous bot that can run codes so we can live debug together?

fast osprey
#

That's not really about bot development if you're looking for existing bots Thonk . There are plenty of bot lists out there though, it depends on what language(s) you care about

gritty inlet
#

A quick search on App Directory / Top.gg should do the work. Though personally I find a real IDE more convenient...

mild terrace
#

hi, i'm trying to do a simple purge function, it runs but i get a rare error, anyone could give a hand?

gritty inlet
#

Could you show us that error

mild terrace
#

@gritty inlet finally i posted it on the forum and a buddy helped me, thank you

limpid nexus
#

Linkedin

cursive fable
#

hello

#

who knows a reliable discord adbot

brazen raft
#

Just look for one with a good rating on one of the bot searching websites

cursive fable
#

bot searching website?

fast osprey
#

Define "adbot"

cursive fable
#

hook me

last cradle
#

hi

#

how do i go about making a modmail bot for with forum posts and not a cjannel

stark ingot
#

A modmail bot would likely not work in a forum channel. You cannot allow people to view only some threads in a forum channel. You can create a private thread in a normal channel which is similar to what you want.

last cradle
stark ingot
#

ah yes like that would work

#

what exactly are you stuck on?

last cradle
#

….

last cradle
#

like what if theres multiple people using the modmail wouldnt that create a shit ton of channels or sumn

stark ingot
#

You would listen for messages in the bot DM and when one is received create a forum post. You would also need to store when a user has an "active" thread so that when they send another message it is redirected to the correct thread. Then when messages are sent in the thread you direct them to the correct user. Then you can have something that will close the "ticket" which means the next message sent in DMs will create a new thread

last cradle
#

oh oki

#

thz

proud axle
#

What is this channel for? I am confused.

timber dragon
#

If only there was a topic..

magic python
#

any1 experians in making discord ticket bots

#

im stuck at a point

fast osprey
#

what are you stuck on?

urban flame
potent pelican
#

I need help on making my bot 24/7
<@&831776746206265384>

#

for free

stark ingot
#

no need to ping mods, while you can find a free host there will be (often major) drawbacks

stark ingot
#

Oracle has a free tier

potent pelican
#

could u give me the link

stark ingot
potent pelican
#

ok ty

fast osprey
#

It's free* (they'll turn your resources off if you go over), has no SLA's, and also oracle is oracle

You're far better off renting a cheap vps. Your time is money, and this stuff doesn't grow on trees. Nobody is giving it to you out of the kindness of their hearts

stark ingot
#

*No company will give it out of the kindness of their hearts
Friends might (but not random people you don't know)

fast osprey
#

Good addendum, yeah some people have extra hosting power lying around

wheat shard
#

where do y'all host your discord bots dude

grave sandal
fast osprey
#

Hetzner

gritty inlet
#

Local 🏠

stark ingot
#

Digital Ocean. I am trying to setup localhost for my personal bots

gleaming inlet
#

Orihost

fast osprey
#

ngl everything there looks pretty scammy.

  • Anything that has to market itself as as "bot host" is just preying on people who are uninformed. There's no such thing as a bot host. It's just a linux vm under the hood. That's like someone trying to sell you a "cereal spoon" and you take it because you think it'll be better for cereal.
  • Anything that promises to be free forever, no strings attached with those specs isn't doing it because they're nice. At best it'll go faulty and basically force you to upgrade, at worst they're going to scam you by taking data from the machine. I couldn't find any independent security certification on their site which is a pretty bad smoking gun. If someone is selling something to you for free or cheaper than what they paid for it, it's not charity and there's a catch
grave sandal
# fast osprey ngl everything there looks pretty scammy. * Anything that has to market itself ...

I don't think the concept of a bot host is necessarily flawed, if you rent a Linux machine you probably end up paying for way more resources than you necessarily actually use for your bot, if there's a host specifically for bots then I would imagine they could probably partition or limit the resources better in theory so that you aren't paying for more than you need. But idk, I'm talking out of my ass I've never touched any of the services besides old very generic ones like replit.

fast osprey
#

There's a major difference between a reputable host selling very small or on demand vps vs a rando no name company selling "bot hosts". Someone selling a legitimate product doesnt have to dress it up with a title that doesn't exist, theyd just respect you as a customer and sell you a Linux box because that's what it is

#

That's not to say it couldn't exist, but there's a reason why aws/oracle/ovh/hetzner don't sell bot hosts

grave sandal
# fast osprey There's a major difference between a reputable host selling very small or on dem...

The concept of trusting a rando company/potentially one person with hosting is suspicious but it's common place and works fine for stuff like Minecraft. Like why not have a service that's meant for bot hosting that limits network connections, bandwidth and memory, does shared hosting and charges you less, and markets it's self for that purpose? (Not that concerns about trust and security aren't major)

fast osprey
#

Afaik when you host a Minecraft server, you're not entering a legally binding agreement where you're subject to data privacy regulations (check me on that)

#

But the people buying "Minecraft servers" are most likely overpaying or getting under delivered due to being uninformed. They're all just the same thing under the hood

#

Like you could pay an extra $2 for the cereal spoon and be like wow this is great I can eat cereal perfectly

formal iron
#

okay

#

basically I KEEP getting this error discord.errors.LoginFailure: Improper token has been passed.

but ive reseted token a trilion times

#

@brazen raft

brazen raft
#

Are you sure it's the same string as the one from the developer portal?

#

What's the whole traceback

finite salmon
formal iron
formal iron
#

the script

brazen raft
#

Send it and the full traceback here

finite salmon
formal iron
#

it dont send

finite salmon
#

i think it had your creds in it

formal iron
# brazen raft Send it and the full traceback here

2025-12-09 16:50:21 INFO discord.client logging in using static token
Traceback (most recent call last):
File "C:\Path\To\group_sales_bot.py", line 65, in <module>
client.run(TOKEN)
File "C:\Python311\Lib\site-packages\discord\client.py", line 929, in run
asyncio.run(runner())
File "C:\Python311\Lib\asyncio\runners.py", line 190, in run
return runner.run(main)
File "C:\Python311\Lib\asyncio\runners.py", line 118, in run
return self._loop.run_until_complete(task)
File "C:\Python311\Lib\asyncio\base_events.py", line 650, in run_until_complete
return future.result()
File "C:\Python311\Lib\site-packages\discord\client.py", line 918, in runner
await self.start(token, reconnect=reconnect)
File "C:\Python311\Lib\site-packages\discord\client.py", line 846, in start
await self.login(token)
File "C:\Python311\Lib\site-packages\discord\client.py", line 675, in login
data = await self.http.static_login(token)
File "C:\Python311\Lib\site-packages\discord\http.py", line 843, in static_login
raise LoginFailure('Improper token has been passed.') from exc
discord.errors.LoginFailure: Improper token has been passed.

#

my traceback

formal iron
formal iron
fast osprey
#

How is TOKEN defined?

finite salmon
#

He forgor to save his file before running

burnt quiver
#

classic

gritty inlet
#

Never send your token or any credentials anywhere on Discord. There should be a warning when you try to do so and it's very reasonable.

#

And I highly recommend you to reset it, you already know why

fast osprey
#

Does this server have an automod regex or a bot check to stop tokens? Just curious

gritty inlet
#

Oh wait

#

Yeah it has, just not automod

fast osprey
#

oh like auto delete from the bot?

gritty inlet
#

Mhm

#

Should probably make it an automod rule....

fast osprey
#

Yeah IMO automod to prevent the message from even landing in the first place would be ideal, would need a very specific regex to avoid false positives though. Really though at that point, what you're fighting against are selfbots that are looking for that regex too but it's not inconceivable someone would try to run one of those in a server this big.

The bot in the dpy server forwards it to github, which will invalidate the token with a few seconds

gritty inlet
#

I'm pretty sure that the pattern for tokens is known

fast osprey
#

It is yeah, there's a spec

gritty inlet
#

I know that the first part of tokens was just base64 of user id snowflake. Not sure it's still that way

fast osprey
#

oh I was reading the pydis bot code wrong, that's the regex for spoilers KEK

gritty inlet
#

This is not someone's token if anyone's worried

#

Anyway as I said, I'm not sure they're still generated this way

fast osprey
#

Believe they are

gritty inlet
#

I wonder if there'd be a difference between generation of user and bot tokens to begin with

grave sandal
#

I wonder what will happen when discord runs out of time for snowflakes, and what's crazy to think about is we'll all be dead by then.

young dagger
#

Is there any way to see how many times a member boosted the server?

fast osprey
#

Not retroactively, and not even fullproof even if you start checking

wild gate
#

is it better using discord.py or discord.js anyone have experience in both?

grave sandal
wild gate
#

dik I'll try translating it to py ig

stark ingot
#

The general recomendation is to use whatever language you know best for discord bots. If you dont know any, we will obviously recommend python.

wild gate
#

can a discord file pull information from a js file?

stark ingot
#

I think you are misunderstanding how bots are run. Discord does not see the code your bot runs at all

#

Your code contacts the discord API and the discord API responds. Sometimes the discord API will send you events, and your bot may respond.

wild gate
#

yeah but when a user makes a request to the bot isnt that calling the api so i need to pull the infromation from my server

#

and my server is storing the info on a websocket from a js file

#

idk i'm just gonna and translate the js file to python

gritty inlet
#

You're not meant to "read" js
If you wanna use Python then rewrite that file

wild gate
#

not the actual file

gritty inlet
#

Still, how'd you run that file

gritty inlet
#

If I understood you correctly

brazen raft
# wild gate its output

You may be able to run it with asyncio's subprocess functions but it still requires a desktop runtime for the JavaScript program

fast osprey
#

what the hell did I just read whatthe

vocal plover
fast osprey
#

A lot of programming words that individually make sense but don't mean anything put together

fast osprey
brazen raft
# fast osprey what the hell did I just read <:whatthe:751970231974363277>

I mean using something like asyncio.create_subprocess_exec together with asyncio.subprocess.PIPE and asyncio.subprocess.Process.communicate to run the JavaScript program, capture its output and go on with the rest of the Python bot program. Like, I'm assuming they're using asyncio and a JavaScript program. I just don't know for sure if they're using asyncio or some other async runtime, and what JavaScript runtime.

fast osprey
#

Was referring to the broader conversation, like what their project actually does and how you "store info on a websocket"

gritty inlet
#

I was confused as of why the mix of Python and JS

fast osprey
#

The whole thing is pretty convoluted and it would be good to start from what the actual goal is

gritty inlet
#

What is blud talking about ✌🏻🥀

fast osprey
#

Yes, any service that tells developers to just give them tokens because "just trust me bro" should be shut down

#

if they're "triggered", they should actually read the TOS

regal venture
#

Anyone wanna help? Dms please

fast osprey
#

why not get help here

brave sedge
#

is anyone in here currently building or going to be building a discord bot using mainly python (some jsons ok lol)? I been on my journey for some time now on my own and would like to bs n chat with someone in a similar pathway. starting to get boring af tbh

brave sedge
fast osprey
#

Can confirm that lots of folks here are making bots in python, myself included

gleaming inlet
brave sedge
fast osprey
#

What kind of games? Development gets pretty boring without a good feedback loop to see the progress being made

forest vortex
stark ingot
gritty inlet
#

The amounts of copy-paste bots on there lmao

#

"Like no other"

timber dragon
#

The amount of ai used is p sad

nocturne halo
#

I really want to know if @unkempt canyon is written in Python

normal jasper
fast osprey
#

Its source code is linked in its bio

shrewd apex
#

one of my very first bots, and where I started learning python from (arguably a bad idea in hindsight)

brave sedge
#

dm it to me if allowed on here

#

was it a game?

finite salmon
#

Cool game tho

brave sedge
#

that pokelure is pretty neat, nice job with the gifs n pil

limpid nexus
#

Disnake

fast osprey
#

???

timber dragon
gritty inlet
#

Hrmm do they want me to import commands and use it from there

timber dragon
#

Yes

finite salmon
gritty inlet
finite salmon
#
[tool.pyright]
reportMissingTypeStubs = false

With a toml file you can do project wise configuration, Im not sure but there might a setting in vsc pylance to configure globally

zealous moss
#

This is a bot with no status, not online, not idle, not dnd or invisible, how do I do them using discord.py?

woeful hill
#

it is http only bot, you can't do this in discord.py

elfin torrent
#

How to get that kind of purple colour status and how to get that sticker in bio?

gritty inlet
#

The status is Streaming, I believe discord.py has that

#

!d discord.ActivityType.streaming

unkempt canyonBOT
elfin torrent
timber dragon
#

It is

fast osprey
#

Why do people actually care about the status icon so much

timber dragon
#

Because it looks somewhat "professional" and good over a sloppy, lazy one or no bio.

fast osprey
#

Didnt say anything about a bio Thonk

zealous moss
#

How to make a tree command (slash command) that is only accessible in a specific guild

fast osprey
#

Answered in the dpy server, mark with @app_commands.guilds(...) then sync on that guild

gritty inlet
#

You may also pass guild/guilds to @bot.tree.command if you're using it

#

The guild should be passed as discord.Object(id=guild_id)

elfin torrent
fast osprey
#

Same way you'd use them in your own?

gritty inlet
#

Developer Portal

finite salmon
#

checkmate buddy, just give up

faint mountain
#

I need a guy who knows compoments v2 dm me

fast osprey
#

why not just ask your question here

faint mountain
#

or its not available in python

fast osprey
#

I have no idea what you mean by rolldown thing

stark ingot
timber dragon
#

or a container + select

faint mountain
#

container + select menu

fast osprey
#

You have to put the select inside of an actionrow and then put the row in the container

timber dragon
#

Can I make ban command using cv2 embeds

burnt quiver
#

Find all the component ids of the message to form the user id

#

Gonna attempt to do this on mobile

#

Oh nvm you can’t have duplicate ids 😔

#

Actually, if there’s a duplicate id, just send a new message and record how many messages to fetch

burnt quiver
#

I don’t even know if this works lol

from discord import ui
from datetime import datetime

 
async def send(ctx):
  messages: int = 0
  user = await bot.fetch_user(802167689011134474)

  views = [ui.LayoutView()]
  str_uid = str(user.id)
  added = set()
  for i in str_uid:
    if i in added:
      views.append(ui.LayoutView())
    views[-1].add_item(ui.Separator(id=int(i)))
    added.add(i)
  before: datetime | None = None
  for view in views:
    message = await ctx.send(view=view)
    before = message.created_at

  user_id = []
  async for msg in ctx.channel.history(limit=len(views), before=before, reversed=True):
    for component in msg.components:
      user_id.append(component.id)

  await ctx.send("".join(user_id))
fast osprey
elfin torrent
elfin torrent
fast osprey
#

What exactly did you try and what happened

elfin torrent
#

It worked now 🫡

elfin torrent
timber dragon
gritty inlet
#

<:name:id>

faint mountain
#

can u give me an example code of it or its too hard

burnt quiver
faint mountain
fast osprey
#

What library?

elfin torrent
faint mountain
fast osprey
faint mountain
#

ty man

limpid nexus
#

Rapunzel.

timber dragon
#

<@&831776746206265384> ^ spammed across multiple channels and probably violates #rules 5

copper quartz
#

!help clean

scarlet scarab
#

Are nukers allowed ?

#

Not to share just to show

celest pelican
#

No

scarlet scarab
#

Ok thanks👍

fast osprey
#

How do you show something without sharing it miku_what

burnt quiver
#

Imagine it

compact gyro
#

Heyo, is it possible to leave a server (guild) via Oauth2 flow, with the a DELETE request to /users/@me/guilds/{guild.id}? I'm getting a 401 despite all the intents and scopes and tokens looking fine. For context, I'm trying to make a small local tool to help me leave servers en masse.

timber dragon
# compact gyro Heyo, is it possible to leave a server (guild) via Oauth2 flow, with the a DELET...

automating your account is against the tos, we ain't helping with that
https://support.discordapp.com/hc/en-us/articles/115002192352-Automated-user-accounts-self-bots-

compact gyro
#

ah thats a shame, I just wanted an easier way to leave ~80 servers without clickops. I guess a bot account wouldnt help either since it would only be aware of guilds its been invited to, rip

#

thanks for the heads up either way

#

I cant even shift-click to select multiple servers at once, and each time I leave one from the bottom of my list, it scrolls me back to to the top 😭 the UX makes me so sad

timber dragon
#

goodluck KEKW

regal oar
#

!e
print('hello')

unkempt canyonBOT
regal oar
#

ooooo

#

!e
D = 0

while D < 1000:
z = input('Which function would you like to use? - ')

if z == 'add':
    x = int(input('First number - '))
    y = int(input('Second number - '))
    print('The answer is =', x + y)

elif z == 'sub':
    x = int(input('First number - '))
    y = int(input('Second number - '))
    print('The answer is =', x - y)

elif z == 'mul':
    x = int(input('First number - '))
    y = int(input('Second number - '))
    print('The answer is =', x * y)

elif z == 'div':
    x = int(input('First number - '))
    y = int(input('Second number - '))
    print('The answer is =', x / y)

else:
    print('this is not a function!')

D += 1
#

?

#

while True:
z = input('Which function would you like to use? - ')

if z == 'add':
    x = int(input('First number - '))
    y = int(input('Second number - '))
    print('The answer is =', x + y)

elif z == 'sub':
    x = int(input('First number - '))
    y = int(input('Second number - '))
    print('The answer is =', x - y)

elif z == 'mul':
    x = int(input('First number - '))
    y = int(input('Second number - '))
    print('The answer is =', x * y)

elif z == 'div':
    x = int(input('First number - '))
    y = int(input('Second number - '))
    print('The answer is =', x / y)

else:
    print('this is not a function!')
#

!e
while True:
z = input('Which function would you like to use? - ')

if z == 'add':
    x = int(input('First number - '))
    y = int(input('Second number - '))
    print('The answer is =', x + y)

elif z == 'sub':
    x = int(input('First number - '))
    y = int(input('Second number - '))
    print('The answer is =', x - y)

elif z == 'mul':
    x = int(input('First number - '))
    y = int(input('Second number - '))
    print('The answer is =', x * y)

elif z == 'div':
    x = int(input('First number - '))
    y = int(input('Second number - '))
    print('The answer is =', x / y)

else:
    print('this is not a function!')
unkempt canyonBOT
timber dragon
#

#bot-commands exists

stark ingot
#

This is the channel about developing discord bots, not for using them

jaunty cape
brittle oriole
#

Hi im trying to make a bot who use the warframe wiki as data base but i have some issue abt the embeb, instead of getting sent into info["description"] instead of info, i can send a part of the code or the all code in a zip file to find the issue but ion know wich part to send, i was hoping for people who could guide me

stark ingot
#

It seems you are making a request, getting the response json, but not getting the description from the json, you are sending the entire json object

brittle oriole
#

i will try to see if i find something to fix that

#

just with the screen you may have some info on how to fix it, im on it since yesterday (im new to coding) and i still didn't figure out

stark ingot
#

I can't really help without seeing the code related to creating the embed

fast osprey
#

What did you try?

brittle oriole
#

should be that if i ain't that stupid 🙏

stark ingot
#

Have you saved your code?

brittle oriole
#

yeah

#

i have it zip without my token if needed

fast osprey
#

Try adding some logging statements to confirm that you are saving it properly and that this info is what you think it is

stark ingot
#

Do you have 2 layers of description?
IE would info["Description"]["Description"] work?

brittle oriole
brittle oriole
stark ingot
#

Not really. I was trying to see what the full JSON structure is. It is recommended that you have a good understanding of the basics of python before getting into developing a bot

fast osprey
#

if you don't have an understanding of python how did you get this code to begin with Thonk

brittle oriole
fast osprey
#

youtube is complete ass for learning. It's all random people making shit up

umbral marsh
#

I NEED A SYSTEM BOT

fast osprey
#

Use your indoor voice

stark ingot
#

also "system bot" is very vague.
also note that we help you make bot here, we dont find them or make them for you

brazen raft
proper slate
#

Am I able to post outputs from my discord bot here? I made an animated terminal style discord bot and wanted to see what people thought

finite salmon
#

Sure

proper slate
#

Here's the three color themes

#

The first one is the loading animation and the other two are content examples

#

You can choose a color theme

finite salmon
#

Thats cool

proper slate
#

Thank you. I got around rate limits by making GIFs. Instead of sending 60 frames it sends one 60 frame GIF and counts as one message.

stark ingot
#

I'm curious how this integrates with a bot?

proper slate
#

Taking a pic 1 s

azure ice
tender bobcat
#

What usually is the size of the gif file? Just curious to see how friendly it's to user with poor internet

proper slate
#

About 500 kb each

tender bobcat
#

Cool

severe temple
#

What is the best Software to code/make a Discord bot?

fast osprey
#

Are you talking about an IDE? That's incredibly subjective and mostly personal preference

#

Discord bots really aren't different than any other programming in that regard. Use whatever you like

limpid nexus
#

Only valid software to make a Discord bot.

fast osprey
#

In theory you could make a bot without having discord on the machine you're developing on

limpid nexus
fast osprey
#

Don't think that's what they asked Thonk

fast osprey
#

You don't use discord to code things

#

Discord doesnt execute code

limpid nexus
#

Never have I said it does.

fast osprey
#

That's what they asked

limpid nexus
#

He should ask better.

fast osprey
#

What he asked for was fine

limpid nexus
#

I agree.

#

Salutations my fellow intellectual.

fast osprey
wraith helm
woeful hill
#

very discord bot related

limpid nexus
#

I am a bot.

timber dragon
#

@ mods

dense swan
#

who has made a discord bot i can use? that can help moderate my server? like auto moderation

fast osprey
#

Discord has auto moderation built in

heavy peak
#

balo

#

wat dis mean

finite salmon
heavy peak
#

from just turning it on………………

finite salmon
#

chill out with the requests you're making to discord and dont hit the api rate limit

finite salmon
#

before restarting

heavy peak
#

i turned it on once this morning and that code is only 50 lines¿

finite salmon
heavy peak
#

oh

#

i understand now thz

finite salmon
fast osprey
#

This isn't a discord rate limit, it's a cloudflare block

#

Typically from collocating on an IP

finite salmon
#

I see

blissful mango
#

how to make bots in discord with python?

fast osprey
#

Discord rate limits would respond with a proper API error, cloudflare is a level above that

fast osprey
blissful mango
#

Ok thx

heavy peak
fast osprey
#

Absolutely don't use replit that's the worst

heavy peak
#

oki

gritty inlet
#

Local or VPS and such

stark ingot
# heavy peak so dont use replit?….

The problem with replit is that many people use the same IP address. If one person on that IP address hits the cloudflare ratelimit everyone on the IP gets ratelimited (as discord can't tell you apart). Also the rate limit might be hit because there are many people each contributing a little bit to the shared bucket.

heavy peak
#

so i just got up and used vsc so its kool

solid matrix
#

hello everyone

fast osprey
heavy peak
#

is it not a code editor

stark ingot
#

It is

fast osprey
#

Code editing isn't the same as running your bot business as usual

zealous moss
#

hi

#

Can i use discord.ui.Modals but pass an argument in it?

#

Like some questions will be displayed on my form that needs to pass it manually

gritty inlet
#

Subclass it

zealous moss
gritty inlet
# zealous moss how
class MyModal(discord.ui.Modal):
  def __init__(self, x: ...) -> None:
    self.x = x
    
    self.add_item(...) # Example
#

Subclassing is a basic thing in Python which I feel like you should learn before trying to make a Discord bot

zealous moss
burnt quiver
patent lark
#

is anyone familiar with using ro_py? im trying to connect my bot to roblox to manage a group, upon the base setup, i cannot even get a "whois" command to work, although ive followed the documentations exactly.

#

this is my code

#

this is the doc

#

thats my error

#

i have checked that it is taking the "username" argument correctly.

#

i tried searching multiple usernames that 100% exist

fast osprey
#

Doesn't really seem related to discord bots

young dagger
#

Catch the error, UserDoesNotExistError

#

There is no error handling

gritty inlet
#

Wth is that exception

#

Ah that's not from dpy

patent lark
young dagger
#

It means that the user does not exist, I would just use a try/except for that

#

Can you try a different user?

fast osprey
#

you should probably ask the maintainers of that library

patent lark
patent lark
young dagger
patent lark
#

xaitzxs

#

which is my user lol

#

and i tried my friends users

#

@young dagger

young dagger
# patent lark xaitzxs

Can you try this

@bot.command()
async def whois(ctx):
    user = await client.get_user_by_username("xaitzxs", expand=True)

    embed = Embed(title=f"Info for {user.name}")
    embed.add_field(
        name="Username",
        value=user.name
    )
    embed.add_field(
        name="Display Name",
        value=user.display_name
    )
    embed.add_field(
        name="User ID",
        value=user.id
    )
    await ctx.send(embed=embed)
young dagger
#

Do you still get the same error?

#

Wait

patent lark
#

looks like expand isnt a kwarg

young dagger
#

Change

roblox = ro_py.Client("My session cookie")

To

from roblox import Client
client = Client("My session cookie")
patent lark
#

alrighty

#

same usernotfound error

vagrant depot
#
embed.add_field(name="Silver_coins: ",value=result[0],inline=False)
embed.add_field(name="Gold_coins: ",value=result[1],inline=False)

how do i display name and title in a single line like:
silver_coins:1000
gold coins:10

its appearing as:
Silver_coins:
1000
Gold_coins:
10

young dagger
vagrant depot
#

ohh

#

like add the embed fields in description attribute?

young dagger
vagrant depot
#

oh i got it

#

thanks alot

young dagger
vagrant depot
#

looks good now

young dagger
#

No problem

patent lark
young dagger
#

Could be

delicate flame
#

sorry I forgot "not"

patent lark
#

i can try that, not sure if ro_py supports search by id

#

surerly it does

delicate flame
#

OH sorry I missed that part of the conversation. I would think it does right? Do roblox usernames have to be unique? I know nothing about roblox. Just an educated guess

gritty inlet
#

They could've just made it

async def get_user(u: int | str, /) -> User:
  if isinstance(u, int):
    ...
  elif isinstance(u, str):
    ...
  else:
     raise
#

Or (worse)

class User:
  ...

  @classmethod
  async def from_username(cls, username: str, /) -> User:
    ...
  
  @classmethod
  async def from_id(cls, id: int, /) -> User:
    ...
gritty inlet
#

bruh i just noticed that you also did this @timber dragon 😭 and sorry for the ping

#

What happened with yours though

burnt quiver
#

Probably hasn’t been reviewed or smth

timber dragon
#

Yeah

#

It hasn't been documented yet either so no rush

gritty inlet
#

Shall I remove mine?

timber dragon
#

Up to you Shrug

gritty inlet
#

But where did you get these names from, clearly they're not the ones that the tooltip shows

#

Maybe Discord rebranded the names, and the ones above are the official ones, Idk

crystal pilot
gritty inlet
timber dragon
#

Datamining probably

#

But I guess discord changed them

gritty inlet
#

I followed the html elements

timber dragon
#

That may only be the branding names

gritty inlet
#

That's not necessarily bad though

#

That way users can compare to the ones on the ui

#

Question
Why are we required to pass the view typevar to CV2-only items such as container?
Couldn't it internally be set to LayoutView and that's it?

#

Current, I believe:

class Container(Item[V]):
#

By required I mean you must do it to satisfy type checker

burnt quiver
#

Not too familiar with typing but I don’t think u do on basic pyright, IIUC

#

Oh hmm actually not sure

gritty inlet
#

Couldn't it just be

class Container(Item[LayoutView])
gritty inlet
timber dragon
#

That would mean .view is always a generic view

#

Instead of one of your subclasses or something

#

discord.py doesn't support strict so you're also on your own when using that

gritty inlet
gritty inlet
#

Ok yeah

#

Good point then
Although personally I've yet needed to pass my subclass type instead of just generic

#

Can't you make typevars have a default value or is that just in the new syntax

gritty inlet
timber dragon
#

Thats 3.14+

gritty inlet
#

Yup

timber dragon
#

But you can import it from typing_extensions

gritty inlet
#

What's the reason for 3.8 support

timber dragon
#

Dpy has done that for Interaction.client

gritty inlet
#

Not classes that I know of

timber dragon
#

TypeVar has a default kwarg

#

The new syntax in 3.12 just uses that yeah

timber dragon
gritty inlet
#

☠️

#

It's too late now

timber dragon
#

Pycord moves to the last maintained version when one goes EOL

#

Like now it's on 3.10 minimum

#

But I don't see dpy ever doing that

gritty inlet
#

Still no voice message support

timber dragon
gritty inlet
#

Maybe I should test that (I mean in the fork)

burnt quiver
gritty inlet
#

But last time I tried to do the waveform I couldn't do it

burnt quiver
timber dragon
#

I've done it reliably using ffmpeg

gritty inlet
#

Unlike that pull you sent, this doesn't add new functions or classes

gritty inlet
#

The content_type will be kept audio/ogg.
But, either the file from the path or the filename being mp3 doesn't seem to cause any problems. Maybe they're unplayable on ios, I do not care enough to limit users
So I'll remove the bit below ig

gritty inlet
burnt quiver
#

Ic

glass skiff
#

Hello

gritty inlet
#

broski rocking that

mild terrace
#

how could i add, delete or print a channel fixed message using discord.py?

fast osprey
#

What does a fixed message mean?

mild terrace
#

a pinned message

fast osprey
#

!d discord.Message.pin

unkempt canyonBOT
#

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

Pins the message.

You must have [`manage_messages`](https://discordpy.readthedocs.io/en/stable/api.html#discord.Permissions.manage_messages) to do this in a non-private channel context.
fast osprey
#

That will add the pin

mild terrace
#

ok, thanks, i gonna try it

fast osprey
#

TextChannel.pins lists the pins on the channel, and Message.unpin removes it

mild terrace
#

perfect, thank you @fast osprey

young dagger
#

I need to load some entries from a db and access self.bot.get_guild. I’ve heard using on_ready isn’t ideal. Should I do it in cog_load or setup_hook?

fast osprey
#

Why do you need to do it then? What's it used for?

young dagger
#

I need to restore some entires from a db and access self.bot.get_guild to restore some tasks

#

In the case of reboots

fast osprey
#

I'd recommend just starting the tasks. If they internally need some metadata they can wait_until_ready

young dagger
#

The problem is that if I use cog_load, it can’t access self.bot.get_guild

fast osprey
#

You don't need it then

young dagger
#

So where do I place it?

fast osprey
#

You need it during the execution of the task, and that task can wait

young dagger
#

You mean that I let each task call await bot.wait_until_ready()

#

Never thought of it that way thanks

fast osprey
#

Or in the before_loop would be better

junior arch
#

Anyone wanna try my rpg bot??? :D

elfin torrent
#

Hey