#discord-bots
1 messages · Page 405 of 1
Is there a way to get if a player ran a command from another bot? (listener)
Kinda boring...
If the bots are in different process it’ll be kinda annoying because you’ll need IPC
You could use sockets or a standalone message broker/queue
hm, never heard of these tbh... Like use case would be:
Someone bumps the server with /bump (disboard) and he gets like 1 vote key he can use somewhere
Interactions are sent directly to the bot. If you are interested in integrating with someone else's bot, you should contact them to establish a reliable api for doing so
Well I guess maybe you should use the other bot token? And combine it with your current bot script??
Idrk about bots much cuz I’m new to this type of stuff so. 🤔
The interaction_metadata attribute of interactions has this information.
https://discord.com/developers/docs/resources/message#message-interaction-metadata-object
There is also the deprecated interaction attribute that still exists but is not recommended that contains the name of the command run.
https://discord.com/developers/docs/interactions/receiving-and-responding#message-interaction-object-message-interaction-structure
This assumes that the other bot responds non-ephemerally, that it continues to do so, and that the structure/name/id of the command doesn't change
What's the best way to learn discord.py package cuz yt tutorials so outdated
reading the docs and examples
looking at code
and asking for help when ur stuck
either here or preferably in the d.py server
is there a way to upload images to the emoji area for the bot, through the bot?
idk if that makes any sense, but someone will understand hopefully lol
await create_application_emoji(*, name, image)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Create an emoji for the current application.
New in version 2.5.
Doesn't exist yet for disnake
alr, ty
yeah, i only use dpy
how can i make a terminal discord client with discord.py-self that i can view my DMS, group chats and also send messages on them on terminal without using the discord app
This is against tos
always wanted to make a TUI client like that but discord is mean
why would you ask about that here
Is this an area to test discord bots
no
Ok
For questions and discussions relating to Discord bot development with discord.py and other relevant Python libraries.
To test discord bot, go to your own server :)
I understand it was just wondering because it's easier to get it if it can be on discord server itself so others can see the command output to beginners who don't have to go from one place to another in rapid succession
It would make the server inherently unsafe if bot were allowed
E.g. automod would be bypassed for bot, can perform more action in rapid succession etc.
Can also malicious purpose like message listener and store in database for idk what usage
I'm sorry I thought there was a botcommand section
That might just be for pylance
How do I get the token
Where do I find the token?
What do you mean by the token
client.run('my token goes here')
Have you followed your library's getting started guide?
yes i have the code all typed up and that line uses a token
What guide are you using
Token collected
how should i name this tool
"Webhook Manager" maybe?
Webhook Man
this python bot has the option to show the users decoration on the avatar command how
also how to get the primary and accent of a nitro user
The user object has avatar_decoration_data and accent_color attributes https://discord.com/developers/docs/resources/user#users-resource
WeMan couldve been a banger name
!e import antigravity
:warning: Your 3.12 eval job has completed with return code 0.
[No output]
what
i'm pretty sure it opens a browser page. that's why you get no output
yuh
only if you ask
ask what
If you need help, you need to ask for it. We aren't mind-readers so unless you tell us what you don't understand, we aren't going to be able to help you.
i dont understand how to make the bot i tried using discord.py in visual studio code but like idk
Try giving this a read https://discordpy.readthedocs.io/en/stable/intro.html
should i be honest
i really dont understand anything here
in that site
See these
https://automatetheboringstuff.com/ (for complete beginners to programming)
https://docs.python.org/3/tutorial/ (official tutorial)
http://python.swaroopch.com/ (useful book)
http://greenteapress.com/wp/think-python-2e/ (another decent book)
http://www.codeabbey.com/ (exercises for beginners)
https://realpython.com/ (good articles on specific topics)
https://learnxinyminutes.com/docs/python3/ (cheatsheet)
Discord bots are not a good first project for beginners. You should have a good understanding of the foundations of programming and preferably some knowledge of OOP concepts
^^oh and if you think after reading that you still want to ? well take it from me who did it and now im burned out and really struggling getting back in to python dont do it.
!e
while True:
print(hi)
:x: Your 3.12 eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "/home/main.py", line 2, in <module>
003 | print(hi)
004 | ^^
005 | NameError: name 'hi' is not defined
:x: Your 3.12 eval job has completed with return code 143 (SIGTERM).
001 | hi
002 | hi
003 | hi
004 | hi
005 | hi
006 | hi
007 | hi
008 | hi
009 | hi
010 | hi
... (truncated - too many lines)
Full output: too long to upload
Nice try
How should I implement a webpage for my bot's settings? Post to a webhook the user settings to the bot? check the db for user settings on demand?
yes, you should use a database which both the bot and webpage can query (through an API, most likely)
https://discord.com/developers/docs/resources/message#create-message-jsonform-params
Message contents (up to 2000 characters)
This is ambiguous... What does Discord consider a character here? A codepoint? A byte? A grapheme?
how to go about making commands that convert a video to a audio file and making a image transparent
no asking to be spoonfeed
Codepoint. Considering that ZWS, etc., count as one "character".
That's strange, because if I try using 1000 ducks inside of a code block, it's telling me that I'm exceeding 2000 characters. Maybe it's Discord's client and the backend not agreeing on what length a message is?
(a 🦆 is a single Unicode codepoint, but two UTF-16 units)
Hm. I guess it's counted differently inside codeblocks
2000 ducks as plain text works fine
I never really questioned it 
When I try pasting 2000 ducks in a plain message, Discord just freezes
maybe let's not spam in this channel
Ome duck counts as 2 chars apparently
(maybe you have nitro, hence the 4000 character limit)
Hello
Virtual environments are isolated Python environments, which make it easier to keep your system clean and manage dependencies. By default, when activated, only libraries and scripts installed in the virtual environment are accessible, preventing cross-project dependency conflicts, and allowing easy isolation of requirements.
To create a new virtual environment, you can use the standard library venv module: python3 -m venv .venv (replace python3 with python or py on Windows)
Then, to activate the new virtual environment:
Windows (PowerShell): .venv\Scripts\Activate.ps1
or (Command Prompt): .venv\Scripts\activate.bat
MacOS / Linux (Bash): source .venv/bin/activate
Packages can then be installed to the virtual environment using pip, as normal.
For more information, take a read of the documentation. If you run code through your editor, check its documentation on how to make it use your virtual environment. For example, see the VSCode or PyCharm docs.
Tools such as poetry and pipenv can manage the creation of virtual environments as well as project dependencies, making packaging and installing your project easier.
Note: When using PowerShell in Windows, you may need to change the execution policy first. This is only required once per user:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
dont be shy ;3
Converting files isn't at all discord related
Please react with ✅ to upload your file(s) to our paste bin, which is more accessible for some users.
hey guys
I have a question im using visual studio code
my run button isn’t there anymore and im not sure what I should do
Hello, I need help with my anti-ban. When a member is banned, the bot does nothing and does not send any logs. https://paste.pythondiscord.com/XHKA
I haven't used VS in a while, but have you tried right-clicking in the top right corner where it should be, and see if you can un-hide it? The other reason that comes to mind is if your file doesn't have a file-extension on it that VS recognizes?
Also does hitting F5 work?
im new to coding
Welcome to the jungle!
thanks
I think it’s bc I downloaded the jupyter notebook
and then I deleted it then that’s when the runner got deleted
If you don't want someone banning people, they shouldn't be given that permission in the first place. Having your bot try to clean that up isn't going to do literally anything against someone who is actually motivated
helloo i am super new to coding, and I am trying to connect my discord bot to my code on virtual studio code and for some reason it is giving me a syntax error when i ran python3 with the name on the file in my terminal
are you gonna show us the error?
and that makes me think you're probably not equipped enough to make a discord bot
yes yes sorry i opened a help ticket it was because i was still in REPL in my terminal
i said i am new 😭 im learning how to atm
how to learn python or how to make a discord bot
both 
!res - learn python first then
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
discord bots require some relatively advanced concepts (stuff like OOP, async programming, etc)
they are not intended for beginners
!projects - a few of these are, so i recommend those instead
The Kindling projects page on Ned Batchelder's website contains a list of projects and ideas programmers can tackle to build their skills and knowledge.
ahhh true true but i think i could probably figure it out over time, ill do those in the meantime to learn as i do the bot as well, i have some friends helping me as well but they are busy so i sought out help here, thank you tho!! i
Also for reference, the package I referenced there is certifi
But I don't think it install that either
is there an event for when somone boots your discord server?
Nope
Messages/role change listener? For announcement message/booster role
^^
Not 100% accurate as you might not have those things set up. But this seems like a case that it is the users fault if they don't have it set up, not the bots fault
You can listen for the system message, this is brittle and will give you false negatives. I have yet to see a use case for this that isn't just repeating what discord does but with cuter language
Guys, I need help. I use wispbyte.com to host my discord bot, and I deleted a server there that has the code scripts of the bot, they contain slash commands, after i deleted the server, the slash commands are still there appearing when I type '/', any way to remove them?
You need to sync again to notify discord these dont exist anymore
Not really your place to say what is/is not a valid use case unless it is breaking TOS.
It really does not matter if the user is reinventing the wheel, it is their project.
I'm entitled to my opinion, as you are yours. Nobody is claiming tos or that people can't do things
Feel free to make your case of what the use cases are that aren't met, but trying to systemically shut me up isn't really a good look
I haven't find a way to delete booster role yet
discord automatically grants and removes the booster role in the server settings
as in changing the role that's given/removed?
What are you trying to accomplish with your bot?
Not my bot but I'm thinking how can I help accomplish that
Just trying to think some more idea and in more depth
» f-strings
» faq
» floats
» foo
» for-else
» fstring
» fstrings
» functions-are-objects
» global
» guilds
» identity
» if-name-main
» in-place
» indent
» inline
hello i keep getting
log(logging.WARNING, "Command", "Update command failed: No embed to update.") File "/home/container/bot/mtg_cogs/cog_mtg_manager.py", line 16, in MtgEmbedManager self, ctx: discord.Interaction, content: app_commands.Option(str, description="The initial embed content.")): ^^^^^^^^^^^^^^^^^^^ AttributeError: module 'discord.app_commands' has no attribute 'Option'
i have app_commands imported though
and yes ive tried ai to fix but that dumb thing cant fix it either
What library are you using?
https://github.com/Rapptz/discord.py/blob/master/discord/app_commands/commands.py#L79-L100 doesn’t show “Option” as one of the commands
import discord
from discord.ext import commands
import logging
from bot.common.utils import log
import bot.common.mtg_database as db
import os
from discord import app_commands
Maybe you want “choices”? Not sure, haven’t used this lib
^
I could not remember if you could disable the role, but I know you can disable the message
You have Option though not “options” in your code
I've tried both
What library (and version) do you have installed
of discord?
yeah
I have 2.5.2
of what library
discord ext isn't a library 
discord is a mirror of discord.py though
Anywho, what are you trying to accomplish? This isn't how you do things in discord.py
main.py loads cogs in other directories, this is a cog that is supposed to create an embed in a specified channel then let me edit the embed from a second command
specifically what you're trying to do with option
it's in the command to give me the option to put content into the embed as well as create the embed
it has a database to store the message Id and channel ID
if u want I can give access on sparked host if you wanna look at it fully
are you just trying to declare a string parameter?
basically but I want it to show as an option
what do you mean by "as an option"
@app_commands.command(name="update_mtg_embed", description="Updates the persistent MTG embed.") @app_commands.guilds(discord.Object(id=int(os.getenv("GUILD_ID")))) async def update_mtg_embed( self, ctx: discord.Interaction, new_content: app_commands.Option(str, description="The new embed content.") ):
this is where it is being used
It's unclear what you're trying to do, in discord, that the user would see
So you’re trying to prompt the user for a parameter named “new_content”?
im just trying to have it create the embed with this: @app_commands.command(name="create_mtg_embed", description="Creates a persistent MTG embed.")
@app_commands.guilds(discord.Object(id=int(os.getenv("GUILD_ID"))))
async def create_mtg_embed(
self, ctx: discord.Interaction, content: app_commands.Option(str, description="The initial embed content.")):
embed = discord.Embed(title="Persistent MTG Embed", description=content)
await ctx.response.send_message(embed=embed, wait=True) # Use ctx.response
db.store_ids(ctx.channel_id, ctx.channel_id)
await ctx.response.send_message("Embed created and IDs stored.", ephemeral=True) # Use ctx.response
log(logging.INFO, "Command", f"Embed created in channel {ctx.channel.id} with message ID from interaction")
where it asks for channel then stores message id and channel ID
then have the command before that edit it '
What do you want the user to input
You have one parameter
for the edit i just want it to edit the embed with what they type
What you do with the parameter is irrelevant
you're having an issue just declaring the parameter
If you want the user to input a string, just typehint the parameter with str
nothing fancy, no Option or whatever
ok and what abt the channel ID one?
I have no idea what you're talking about
i want /create_mtg_embed (insert channel)
You want the user to specify a channel in the current guild?
then /update_mtg_embed (string)
What kind of channel?
normal text channel
Then you can typehint with discord.TextChannel
i got it working, thank you
I know discord has a form app like feature that discord bots can use, is there a way to use it in discord.py and if so whats the module for it or is it unavailable?
you meant modal?
yeah
I think you're referring to modals https://discordpy.readthedocs.io/en/stable/interactions/api.html?highlight=modal#discord.ui.Modal
This page is a 3rd party tutorial on how to use it: https://fallendeity.github.io/discord.py-masterclass/views/#modals
official example
oh yeah another thing slightly off topic from what I asked but for some reason things like app_commands and ui dont show up in the list of modules. but I have latest version, is that just an editor bug or did I do something wrong
which editor do you use? also, are you using a virtual environment?
I am using Visual Studio Code with no virtual environment
oh and I have discord.py-message-components~=1.7.5.4 this installed too, I feel like this is the issue, but I wanted to ask before doing anything.
ok I got it working discord.py-message-components uses an older version of discord.py and it replaces a bunch of stuff with its own stuff so I am now using a venv for my project and it all works now.
nice!
t
Hello devs!
Could anyone please explain how tools like https://discord.id work?
I find it interesting because many things that discord api provides requires authorization
Rather than us speculate what other devs are doing, have you tried asking them?
The discord api is pretty well documented, and while it does require authorization I'm not sure how that's relevant here unless you're assuming that they aren't authorizing
Discord bot dev requires some interaction with the api ¯_(ツ)_/¯
It is well documented, I did get everything from id except the account age (when the user created an account) when I was trying on my own.
https://discord.com/developers/docs/resources/user#user-object even the endpoint the site tells you to use doesn't provide account creation date
(however, the creation date of any snowflake id is baked into the snowflake itself)
Yeah I was thinking to either find a way to get creation date via api or just reverse the snowflake id somehow
The api doesn't give it to you, but you can do some pretty simple bit operations to get it from the snowflake
I just wanted to know if it's possible to get creation date via api
And now I know it's not!
Looks like it's time to reverse the snowflake!!
I saw in discord api docs how the snowflake is generated etc.
Anyway that's all
Thank you very much and have a great time!
good luck 👍
Thanks!
Account age is embed in the user id
In fact it's literally documented
https://discord.com/developers/docs/reference#convert-snowflake-to-datetime
yes yes, I saw that. I just wanted to try to do it via API, which now I know is not possible.
The point is discord don't expect people to need it because it's literally in the id itself, which you would have or already have 
yep
creation could be taken using the private discord api but is it allowed? no
you can, but forbidden but i suppose for personal use you'll never get banned but don't try
i dont even know if i'm allowed to tell you the api request
you mimic
you mimic what? discord api?
discord api request
so you mean spoofing?
nope
just copying and if you do it with discord token i think its selfbot and with discord bot is user impersonation whioch is also bannable
However, I am not trying to get creation date from my own account, but from any. since discord.id tool can do it I wanted to try to make own, right now I am reversing snowflake to get the date
yeah you can get the creation date of any account usingf discord api
just forbidden
I know what you mean now
as i look rn, discord does not give out the thing in the api and must ysue the snowflakes aswell
link?
oh you mean that
I though you were looking through docs
I know it's bannable, I got banned 2 times
not a flex
I was messing with the api, did every possible thing I could and it ended up with ban
that why iot's bannable
What are you all on about. This is a simple one line bit of math on the id. I even already linked the code to it
timestamp = (ID>> 22) + 1420070400000
we are talking about the api, when I tried to get the creation date via api, like this
I was excepting to get JSON response XD
You shouldn't even want to use the api. Why would you want to wait for a network call when you already have the code written for you and it's instant

it is json response
yep, already did that
discord use this aswell to calculate it on profile
yeah, and I got 401 unauthorized, it requires token
ik
!rule 5 why we have discussion of self bot and why it even matter lmao
5. Do not provide or request help on projects that may violate terms of service, or that may be deemed inappropriate, malicious, or illegal.
yesterday did it with bot token, I got username, user profile picture etc. all in json format.
But I don't like messing with api, I like this offline way with math
Yeah, that what i was saying
you can do it, still forbidden and could lead to discord bot ban or account ban
i think when discord ban a bot it ban the account
yeah, math always better
I didn't want to talk about that anyway
idk
oh wait, yes yes
I remember I was fixing a bug in my discord bot, it was some kind of entertainment bot that I made for some people. it started spamming because I called a function inside a loop. and got my acccount banned, that was my second ban
since then I stopped developing such bots
ok enough bots and apis, and stuff against tos
math wins!!
You really shouldn't be suggesting these things in the first place. They're explicitly going against TOS, and saying "you can do this but you probably shouldn't 😉 " isn't a good idea. If it would be against the rules, you can just say "there's not a way to do this within tos" and leave it at that
hello i dont understand whats wrong with the code
You should reset your token
startswith*
it's fine bruh, just reset it
There is no such thing as discord private api. And stop recommending people to use self bots. If it is not allowed there is no reason to even mention it in the first place
oh
ok now the token is the problem
i reset it and it tells me that its not good
i pasted it into the code too
did you save the file?
what file
the file you're coding in
Strongly consider putting your token in a separate config file so you don't have to remember to blur it out when sharing your logic
i mean the undocumented one
at no point i recommend anything btw
You're severely misusing "undocumented" here
It's not undocumented because they didn't feel like it, it's undocumented because they have specifically told you not to use it with automation
still undocumented
That is a misleading term to use
"internal API" sounds more-correct to me
what the fuck did i just walk in on
idk either
don't worry that much, I am aware of self bots, discord ToS and guidelines. I just wondered if there is a way to display something like the user profile in json format, if you can view a profile, you can maybe concatenate is as json.
e.g.
{
"username": "username",
"discriminator": 0,
"avatar:": "0123456789abcdefdeadbeef"
}
ok this is it from me
I do not want to continue talking about something that could be against ToS and/or server rules.
I am pretty sure you can get it without breaking TOS, i dont know why that user even brought it up
prob because pretty much everything on discord is either discord.com/guilds or discord.com/api/v{version_number}
guilds is mostly for servers, while api is for everything else
also if anyone here thinks that I shouldn't talk about those URLs
it's very well documented in discord documentation
Yeah, using the get user endpoint in the API with a bot token can get the information you want, the bot does not need to be on a server with you or anything
Yes, I know, I did it yesterday.
some users seem to think that anything that isn't supported by bots == userbot/bad/undocumented
For anyone who's looking for command ideas, i made a repo with currently 2,000 command ideas, some may be duplicates but it's worth having a look if you don't know what else to add int your bot;
if you find any duplicates lmk ❤️
Are you looking for feedback or just sharing? There are several commands here if implemented as described are either harmful or violate TOS
tempmute vs mute
i'm just sharing them, it's just a list i have
I'd encourage folks looking over this list to think critically about the implications of some of these and to review the tos they have agreed to
8, 350 name conflict
i’ll add a disclaimer at the top of the file or something
I'm not sure why you'd put a disclaimer for things that violate the tos instead of just removing them
purge duplicate
music potentially duplicates
I am done with checking this because probably ai gen anyway
Not worth the time
Because he probably doesn't know what there are
eh im to lazy
Right, so you're fine with making recommendations that people could follow and get banned for and you don't care. Neat
!rule ai sound appropriate for this rule
it’s midnight for me im to tired to remove every single one that may break ToS
Then maybe take it down and don't share it with people until you've done your due diligence
There is a simpler solution: remove the link from the channel
It's not a problem to make a mistake, it's a problem to be confronted with that mistake and dig your heels in when it can cause harm to others
im not making people use them it’s just a list lol it’s their own choice to use them
Well clearly you are suggesting people to use your command list, which contain ToS breaking command
So don't post it here if it contain ToS breaking command?
People do whatever they want with there bot even if forbidden tho
He never said "make them"
In the process of searching a moderator...
Just because you aren't going to their house and holding them at gunpoint to make these commands doesnt mean you don't hold responsibility for misleading people into losing their accounts (or harming their users with security flaws). You may have been unaware of that previously, which is fine, but now you are not unaware
5. Do not provide or request help on projects that may violate terms of service, or that may be deemed inappropriate, malicious, or illegal.
Don't know, don't care, not my repository after all
But well
I didn't even reply to you lmao
Time to block one more person ig
Modified, by response is the cool dog sticker under
It's not something to freak out about, it's their call if they don't want to engage. Just worth mentioning when you see folks discussing things like that
It's mainly the sticker make me uncomfortable, not the conversation
Poor moxxie and millie
I saw you act like "AI bad", but isnt your profile picture AI (Cant see much but still)
I think github limits the amount of stuff you can have on the readme
nvm they dont
I'm working on a second file right now that are all compliant with ToS.
Oh nice
would be cool
because of my bored ass i'll make all of them in a working bot
is your repo updated already?
you should maybe add "explanation" for each command
where to find the badges for public flags/available badges
It's all documented in the relevant section in discord's docs
The wrapper library you're using should have it as well
Do you mean the actual images? Or just what flags correspond to what badges?
second one
https://discord.com/developers/docs/resources/user#user-object-user-flags
Your library probably has an enum for it as well
like i cant find on discordpy
Sorry, i dont use discord.py
tyyyy
@app_commands.command(name="ping", description="Ping the bot's shard.")
@app_commands.user_install()
@app_commands.guild_install()```
```AttributeError: module 'discord.app_commands' has no attribute 'user_install'```
istg i have tried everything but i cant get this to work 😭
You're not saving the 'command' return value anywhere, I would have expected that to be what has 'user_install()' on it? Haven't used this library, sorry
huh
its discord.py
Can you show the output of pip freeze on your environment
aiohttp==3.11.14
aiosignal==1.3.2
altgraph==0.17.4
annotated-types==0.7.0
anyio==4.9.0
asyncio==3.4.3
attrs==25.3.0
audioop-lts==0.2.1
beautifulsoup4==4.13.3
blinker==1.9.0
cachetools==5.5.2
certifi==2025.1.31
cffi==1.17.1
charset-normalizer==3.4.1
click==8.1.8
colorama==0.4.6
comtypes==1.4.10
DateTime==5.5
discord==2.3.2
discord.py==2.3.2
distro==1.9.0
dotenv==0.9.9
duckduckgo_search==7.5.5
exceptiongroup==1.2.2
ffmpeg==1.4
Flask==3.1.0
frozenlist==1.5.0
google-api-core==2.24.2
google-auth==2.38.0
google-cloud-vision==3.10.1
google-genai==1.8.0
googleapis-common-protos==1.69.2
groq==0.20.0
grpcio==1.71.0
grpcio-status==1.71.0
gTTS==2.5.4
h11==0.14.0
httpcore==1.0.7
httpx==0.28.1
httpx-ws==0.7.2
idna==3.10
itsdangerous==2.2.0
Jinja2==3.1.6
jiter==0.9.0
langdetect==1.0.9
lmstudio==1.2.0
logging==0.4.9.6
lxml==5.3.1
lyricsgenius==3.3.1
MarkupSafe==3.0.2
msgspec==0.19.0
multidict==6.2.0
mysql==0.0.3
mysql-connector-python==9.2.0
mysqlclient==2.2.7
openai==1.68.2
packaging==24.2
pefile==2023.2.7
pillow==11.1.0
primp==0.14.0
propcache==0.3.0
proto-plus==1.26.1
protobuf==5.29.4
psutil==7.0.0
py-dotenv==0.1
pyasn1==0.6.1
pyasn1_modules==0.4.1
pycparser==2.22
pydantic==2.10.6
pydantic_core==2.27.2
pygame==2.6.1
pyinstaller==6.12.0
pyinstaller-hooks-contrib==2025.2
PyNaCl==1.5.0
pynput==1.8.1
pypiwin32==223
python-dotenv==1.0.0
pyttsx3==2.98
pytz==2025.1
pywin32==310
pywin32-ctypes==0.2.3
PyYAML==6.0.2
requests==2.32.3
rsa==4.9
setuptools==77.0.3
six==1.17.0
sniffio==1.3.1
soupsieve==2.6
tk==0.1.0
tqdm==4.67.1
typing_extensions==4.12.2
urllib3==2.3.0
websockets==15.0.1
Werkzeug==3.1.3
wsproto==1.2.0
yarl==1.18.3
youtube-dl==2021.12.17
yt-dlp==2025.3.26
zope.interface==7.2```
oh for fucks sake
my discord.py was outdated
i see now great
guys
in discord.py i have input as "@distant pawn" how do i replace this with the pinged user's username?
What do you mean by "input"?
on message it takes the message content
for example i ping myself the input is: @azure yew
i want to use a input.replace() to replace this with the displayname
but have it use regex or smth so it works with everyone
use re.sub
how do that?
!d re.sub
re.sub(pattern, repl, string, count=0, flags=0)```
Return the string obtained by replacing the leftmost non-overlapping occurrences of *pattern* in *string* by the replacement *repl*. If the pattern isn’t found, *string* is returned unchanged. *repl* can be a string or a function; if it is a string, any backslash escapes in it are processed. That is, `n` is converted to a single newline character, `r` is converted to a carriage return, and so forth. Unknown escapes of ASCII letters are reserved for future use and treated as errors. Other unknown escapes such as `&` are left alone. Backreferences, such as `6`, are replaced with the substring matched by group 6 in the pattern. For example:
You shouldn't need to regex, you can use the mentions property on the message
though I really suggest you make a slash command instead
huh??
how is that relevant
its an on_message to AI API
and it just sees the @orchid dock string
What AI?
It is against tos to train ai on message content
its not training tho lol
its not storing anything
And how are you guaranteeing that
by seeing what google says about it
they claim it doesnt train
atleast the version im using
Paid version? Are users consenting to you sending their data to a third party?
so you are saying your bot uses no api's at all? that seems hard to believe
My bot doesn't send user data to third parties
cool so explain to me how all those other AI bots arent getting banned?
Other people getting away with things doesn't mean you get to
or that it's acceptable to do
opinions be opinions ig
It's not an opinion
its not training on user data discord doesnt have a problem with it
this is a rule of this server
discord does have a problem if you are sending user data to third parties without recording their explicit consent
their consent is adding the bot to the server and enabling the ai function
and enabling the ai function
this is a great first impression of the discord, i joined to ask a question because i needed help with someone and someone goes bitching about "wahhh you cant do this " and when i say its not doing what you say you contine, im outta here have fun!
👋
Bro wtf is this conversation
my global error handler: https://paste.pythondiscord.com/FZYA
my error from my bot.log file: https://paste.pythondiscord.com/B4EQ
my embed: https://paste.pythondiscord.com/EDGQ
why is the bot not gracefully handling cooldown errors? i want the cooldown embed to display as an ephermal, but it doesnt seem to work. i tried to integrate my cooldown handling into the /chat command as well, but nothing works lmao
Yo do you know which channel I can get aiohttp support
if it's just general aiohttp calls, probably just a post in the help forum
The general examples in the aiohttp docs are good
I'd recommend doing some logging. You're doing some if statements and it's unclear how they're behaving just reading your code
I mean, you shouldn't just assume they don't pay?
I didn't say they did. I even asked if they had the paid service or not
guys how can i hot my discord bot 24/7 for free ?
!hosting
Using free hosting options like repl.it for continuous 24/7 bot hosting is strongly discouraged.
Instead, opt for a virtual private server (VPS) or use your own spare hardware if you'd rather not pay for hosting.
See our Discord Bot Hosting Guide on our website that compares many hosting providers, both free and paid.
You may also use #965291480992321536 to discuss different discord bot hosting options.
do you think your pc/phone was free?
or the electricity that it uses
Basically you cannot
Well, electricity isn't free... So
lol
i was just asking
Hmm, can the bot not read message snapshot source
The answer is no because no one wants to pay for these for free and people just turn those machines into crypto miners if they were to ever exist
never a dull moment in this channel
I wonder if you can host something on a samsung smart fridge
I'm pretty sure you can lmfao
i bet someone's already ported doom on a samsung smart fridge so hosting something on it shouldnt be impossible
lmao right
hey all im actually not sure if i can post / ask here, but uhm Im looking for a probot ish bot for my server , mainly that has a auto response option. Where u can put a command such as : " omw " , that wil trigger random chosen GIFs. Probot is down sadly, and after looking on the net its said that Python has a similar feature? So im here wondering how that works and if thats the case? My apologies in advance, if this isnt the right place for asking
Here's what a lot of people are using. If you're brand new to it all there will be a fair amount of reading required, but people are generally succeeding it seems: https://discordpy.readthedocs.io/en/stable/
yes thanks im trying
This channel is specifically for development of bots and presupposes you have the necessary skills. If you're looking for existing bots, there are better places.
You would have to implement this yourself, there's nothing out of the box in these libraries which does this
Yes my intention was to find a similar BOT to be honest, Where I would just add the link of different GIFS that would automatically trigger in the server when a member in that server would write a specific work (that would be the command). I believe this discord server is not the right place for it 😇
Best of luck on your search then
Check out AxisBot or Carlbot maybe? Just from a quick google
how do yall typically structure your discord bots code
this is how I do mine: https://github.com/Robin5605/discord-bot-template, there are a lot of variations though
@unkempt canyon is far more complex, here's how we do it for that: https://github.com/python-discord/bot
this reminds me that i should migrate to uv for my template
Could you be a bit more specific?
I generally have a main.py and then a cogs folder with my commands, and other folders with my utility functions. I probably should put all of that stuff in a "bot" folder
Some people like to put their views and components in separate files but I personally like to keep them near where they are used
Yeah project structure is an incredibly opinionated and subjective topic. As long as you aren't introducing circular dependencies and you can quickly search for the thing you want, it doesn't really matter. This is something I prefer to evolve organically if (and only if) I ever run into tangible issues rather than trying to preemptively optimize
thing is: i got involved in a youtubers community and the server is relatively big, they got ~2.5k members and i got tasked with the task to create a bot for them. i am a hobbyist and never maintained a big codebase which this projects aims to be, so i am kinda lost here... which stack should i use, how do i keep myself organized and keep it manitanable by others aswell? ive created plenty of bots before but idk maybe its just the pressure thats making me overthink?
been programming for a whole lotta of time aswell, 3-4 years iirc
A well organized code base that doesn't do anything is worthless compared to a messy code base that actually creates value
if you spend too much time preemptively optimizing, you push your feedback loop further back
there's nothing bad about organizing your codebsae
thats true
Didn't say it was bad, just that people waste a lot of time agonizing about how long their file is or how many vowels are in their class name while their users get bored and leave
true
i'd just make some simple folders to sort correlated files like cogs, utils, etc.
Moving things around is easy
Losing opportunity cost because you weren't building the right thing, or worse yet losing your user base, is what's expensive. I prefer to keep things as simple as possible and rearchitect when there's an actual need. Refactoring isn't fun, it feels frustrating, but the alternative is worse imo
You make a one file bot, it looks like crap, but then you find out people actually didn't want the functionality in the first place. No harm done
is there anyway to determine if a user has nitro other than if there pfp is animated, if they have a banner or status contains a animated or custom emote?
also can u determine if they have boosted a server
not really the best way probably is to catch the automatic message that gets sent when the server is boosted
oh this is new
you could try this property
Discord doesn't tell you if they have nitro. This is by design.
Any approaches are merely guesses and will give you either false positives or false negatives
You can only tell if they are boosting a server
You can buy a boost without having Nitro too though right?
Mhm
hello again
I have been here a couple days ago when I had some questions about discord user creation date, which can be extracted from ID.
I did it by doing (id >> 22) + discord epoch. I could even get the creation date from my discord token, tokens are made of three parts, base64 encoded id, base64url encoded timestamp, and the last part is just HMAC. then I wondered is it possible to reverse that second part of the token.
I tried by doing it in reverse, timestamp - epoch -> hex and then base64url encode
and didn't get exatcly the same, let's say my 2nd part of token is AbC-L and then if I reverse the process to encode it myself I would get AbC-A, why is that?
If I try to extract timestamp and other things from ID, I don't get the same as what I would get when I decode the token part. something's missing.
Does anyone here know better? I tried even with bot token,it's the same.
anyway, based on this, looks like discord tokens are almost just public information, the first two parts are just id and timestamp, while the last one is the critical one actually.
Good night
oh also, I forgot to mention, I was also playing with the token in this picture, and based on the numbers that are already written, I could reverse the process easily and get the exact results.
Why are you trying to manipulate tokens in the first place
spicy
i think they're just trying to learn the format and how it works
hey if any discord developers are trying to work on a discord boost related project please message me
you should further elaborate on what
a discord boost related project
means
a discord boost bot with features like : automated boosts with sellauth and other common discord provider seller websites, boost multiple servers, tls spoofing, threading, a token checker, and much more
defo not against ToS lmao
token checker
Want to elaborate where you're getting tokens from that you need to "check"?
Amount of days / boosts left on the tokens aswell if it’s verified how many servers it’s in it’s age and what type of verification it has
!rule 5
5. Do not provide or request help on projects that may violate terms of service, or that may be deemed inappropriate, malicious, or illegal.
As far as I am aware, _ and - is not valid base64
What did I miss?
That's not what I asked. I asked where you're getting these tokens from that you need to check them.
I need help making a discord bot its really late for me so if anyone wants to help me out please dm me or put me in a ticket
It looks interesting, and the way it works is interesting as well. Imagine it as lego bricks, you take one brick, and add details with other bricks, and you get a whole structure. And the second part of tokens puzzled me so I wanted to try to reverse it. I am just tinkering with that discord weirdness (offline of course, I don't want to do something against ToS)
If it's for curiosity go nuts, but you won't ever be making discord tokens yourself. It's helpful to describe your end goal with open ended questions like these (whether it's achieving a purpose or just understanding how something works for the fun of it) so the answers can be more tailored
I am getting the impression that for some reason these people have access to the tokens to various accounts which have been made that have boosts or nitro that they can use to boost servers with. Probably somehow from a third party for cheaper and that they want to know if the account they were given by token has nitro or any boosts to use.
Two separate threads, but yes I was trying to get them to admit that
Bro just rattled off a list of tos violations and then left 😂
Excuse me sir, I want to ask something. I'm currently using an RDP with Windows Server 2019, but when I try to run a Nextcord script, it gives an SSL error. What should I do about it, sir?
That's the error I'm getting, sir.
Server has some fairly strict security defaults, any chance that's being blocked by the firewall settings?
How do I check if it's being blocked by the firewall, sir?
It SHOULD be in the Event Viewer, under uhh...
"Applications and Services Logs" > "Microsoft" > "Windows" > "Windows Firewall with Advanced Security" > "Firewall", I guess?
You might have to right-click on that and enable logging first, I can't remember if it's on by default
auditpol /set /subcategory:"Filtering Platform Packet Drop" /success:enable /failure:enable is apparently what you'd want to do to enable all the logging. I've always done it with the UI so I'm glad to learn that command.
Sorry sir, I couldn't find that.
That's all inside the 'Event Viewer' app, which you'd want to launch first
okey sir
Apologies sir, could you please clarify what you meant? I'm not quite sure I understand. I have already located the section 'Applications and Services Logs' > 'Microsoft' > 'Windows' > 'Windows Firewall with Advanced Security' > 'Firewall'.
You can right-click on "Firewall" and there should be some options. One of them is to enable the logging for that category. Just double-check that it's already enabled.
You might need to run those two auditpol commands from a Command Prompt from that superuser.com link I dropped, I'd have to try it myself to be sure.
At this point it's not remotely python related
Sorry sir, could you please explain what you mean by 'enabling logging for that category'? I’m afraid I don’t quite understand. And also, regarding the 'two auditpol commands' — could you let me know what those commands are?
Sure, open an administrator command prompt (one way is the WindowsKey-X, like right-clicking on the Start Menu)
Then run these two commands one after the other:
auditpol /set /subcategory:"Filtering Platform Packet Drop" /success:enable /failure:enable
and then
auditpol /set /subcategory:"Filtering Platform Connection" /success:enable /failure:enable
But this is about a Discord bot, and my bot is built with Python. I really do need help.
When you're done later, you can reverse that by running these two:
auditpol /set /subcategory:"Filtering Platform Packet Drop" /success:disable /failure:disable
and
auditpol /set /subcategory:"Filtering Platform Connection" /success:disable /failure:disable
You could use that argument to do anything
"I have a discord bot that trades stocks, so in this channel help me with how stocks work"
I'd suggest getting help from windows/networking resources if it's a windows/networking issue
Sorry sir, I don’t mean anything by it — I just really don’t know. This bot was developed using the Python programming language, and I’ve encountered a similar error before that was solved through Python. So if this issue ends up being something that needs to be solved through networking concepts instead of Python, I sincerely apologize. I genuinely need help.
You're good, I'm not scolding you just suggesting that you go to places meant to help with the thing you're having the actual problem with
Could you please let me know if there's a server or channel where I can get some help? I'm really having a hard time right now.
Base64url change + and / into - and _, it also removes the == padding. So, those characters are not valid base64 but are valid base64url
Ah
And I'm sorry sir, but I read the pinned message — as long as it's still related to Discord bots, it's allowed, isn't it? What I'm experiencing is still related to a Discord bot, it's just that the way to solve it is a bit different.
I'm not a mod, I'm not saying you can't do anything
just that this isn't the place for windows server expertise
Alright sir, thank you very much for your willingness to help. Perhaps we could move to the #networks channel, as this might also be related to networking.
embed.add_field(
name=f"{EMOJIS['CHAT']} **__Match Details__**",
value=(
f"Channel: {voice_channel.jump_url})\n"
f"Partner: {user2.mention if user1.id != user2.id else user1.mention}\n"
f"Started at {discord.utils.format_dt(datetime.now(), style='f')}"
),
inline=False
)
embed.add_field(name="", value="\u200b", inline=False)
embed.add_field(
name=f"{EMOJIS['DISCONNECT']} **__Session End__**",
value=(
"> *The session will continue until someone leaves the channel.*\n"
"> *When that happens, the remaining person will be moved back to the queue.*"
),
inline=False
)
return embed```
embed.add_field(name="", value="\u200b", inline=False) is still causing too big of a gap, any suggestions? i can't use newlines since discord strips them which is annoying
Does "\u2009" work interestingly differently?
I suggest putting everything in the description, that way you can put newlines between the text, which won't be stripped
does anyone know what the url format for the desktop app is (discord://) ? trying to add a link in an embed
there's a URL format for desktop discord?
oh thank you 🙂
My last message got deleted, just in case that was for policy reasons I won't re-send it. Hmm.
(Pretty sure what I said was fine but you never know)
huuh
<protocol> instead of the full url works too in url buttons and text. Not sure about embeds.
hi snipy
Hiii
Hi mudkip
Is it really work with buttons because you (used to be able to, not sure if you still can) log out with just discord protocol
Just try it :)
Hello! Does anyone know the command to edit a thread's name?
in discord.py flags, is there a way to check if a flag is used without an argument?
shiny: bool = commands.flag(default=False, aliases=["sh"])
i have this bool that I want to be False (or None, doesnt really matter) as default, but if added to a command like --shiny without any arguments for it to then be True, without the user specifying it to be True
i also cant just check the message content for it since its also being added into the arguments of other flags when ran without an argument
There's probably a way to do this, but personally if your commands are getting complex enough to warrant flags I'd strongly recommend just migrating to slash commands. It's unambiguous to the user and vastly easier for them to fill out
i have slash commands as an option too, but users generally do not like slash commands so text is almost mandatory
I see this a lot, people rolling over to stubborn users. Slash commands are the supported way to do this, they're better in pretty much every way and people only resist because they hate change. Up to you if you want to go out of your way writing messier code to end up with a worse experience
If you wanted to go ahead with this, you might need to look through what's available in the context. Though as a user, I'd find this frustrating and unintuitive if there were two different defaults
Use whatever makes you happy, I see nothing wrong with it
Hey folks, I'll start by saying this server is very useful: it's helped me a ton already!
Now, I have a huge issue: I've successfully embedded deepseek in my Discord bot, but holy moly if it's slow. 2 mins only for the reply to be "sorry I can't help".
How can I overcome this issue? I'm running it on my machine, and it clearly isn't the way to go. Where could I host the AI to get fast (not saying blazingly fast, but not more than 5 seconds, lol) responses? And how different would the implementation be from running it locally? I know nothing about this topic.
How are you "embedding" it?
I might've used the wrong term? What I mean is that I'm using deepseek in my Discord bot.
Via Ollama.
But how?
Do you want the API?
I am importing from the ollama library some packages (chat, ChatResponse, AsyncClient), defining an async function to ask the AI what the user asks (when an !ask command event is being fired) and send it back to the user in the channel.
You may wish to review the developer tos and policy
What's up with it?
It is against policy to train models based on user message content (which it seems deepseek does), and it is against tos to send any user data to a third party without specifically getting the user's consent and publishing that in your privacy policy
You talked about sending user data to deepseek. And a very cursory googling says that deepseek trains based on input
I talked about sending the user message to deepseek.
That's exactly what I just said
It's ran on my machine in any case.
What's the matter with it?
In the worst case it'd be collecting my data.
Isn't it the case?
If you can guarantee that no data goes to a third party and the model isn't being trained, you're fine
And I believe that users are aware of what's happening, when they invoke a command to explicitly ask deepseek.
I don't think deepseek can get any data from users besides their messages, since it's all ran locally on my computer.
So I guess I'm safe.
Their messages are protected data
Lol.
Both of these need to be true
Is this fr or you're trolling atp I don't know.
You can read the policy if you want to, which you should have already
I don't think there's any violation going on.
Just add "Submitting this command will send your data to a 3rd party" to the description of the command or something
There already is smth like that.
And again, it doesn't matter if there is consent or not, models cannot be trained based on user inputs period
In the command description.
And no one ever said that it was!
Anyways, back to my question, lol.
This was it.
Either way, this isn't the channel for how to make your ai faster
Doesn't seem to be any issue with the discord wrapper, so long as tos are being met
Including me, it was left ambiguous and if you actually read the conversation they never confirmed what the settings on their model were
I'm asking just if my AI would be connected to my Discord bot in a similar way as it's done locally.
Would I have to send https requests to the server to send and retrieve the data? I guess that's the only difference.
It's up to you if you want to farm that out to a separate process on different hardware
Could probably get better results, the actual process connecting to discord won't need many resources at all
You would have to factor in network latency at that point if it would offset any improvements
(Or just also host your discord process on that same faster hardware)
Not being a dick here, data privacy is serious stuff so if you're going to be developing an app people use I highly suggest you read both the dev tos and dev policy very closely
I understand it.
Bro just get a stronger GPU
will probably have to use deepseek's API. not sure if it's free or paid, though
and yeah just make sure to do your due dilligence when it comes to data safety
God bless.
these AI companies usually have dedicated hardware and are running the max parameter count so it will usually always be faster and better than what you do locally
Yeah. Thanks for the link and the tip. 👍
4.3 In order to fulfill the requirements stipulated by laws and regulations or provide the Services specified in these Terms, and under the premise of secure encryption technology processing, strict de-identification rendering, and irreversibility to identify specific individuals, we may, to a minimal extent, use Inputs and Outputs to provide, maintain, operate, develop or improve the Services or the underlying technologies supporting the Services. If you refuse to allow us to process the data in the manner described above, you may provide feedback to us through the methods outlined in Section 10.
Our use of Materials. We may use Materials to provide, maintain, and improve the Services and to develop other products and services. We will not train our models on any Materials that are not publicly available, except in two circumstances:
If you provide Feedback to us (through the Services or otherwise) regarding any Materials, we may use that Feedback in accordance with Section 5 (Feedback).
If your Materials are flagged for trust and safety review, we may use or analyze those Materials to improve our ability to detect and enforce Acceptable Use Policy violations, including training models for use by our trust and safety team, consistent with Anthropic’s safety mission.
I’m looking for people to give me feedback back on my new AI bot is this the right channel?
It’s a bot that analyzes bitcoin price trends and gives a detailed response about them and ends with a recommendation to buy/sell/hold
Aside from the horrible ethics of an AI giving financial advice on a volatile asset?
Depends if you're looking for critique on the code itself or the functionality
not really, no
Kinda both. Mainly just need users to check out what I have so far so they can tell me what they like/don’t like.
Where would that channel be? I need devs opinions which is why I’m here
we have a code review tag in #1035199133436354600 but its only really for reviewing the actual code itself rather than giving feedback on the ai bot
you might have better luck trying in a crypto discord server
I disagree, maybe you don’t trust it but being that I developed it I understand how it works and the risk factor is actually going to be pretty low once enough data is logged. As of now it mainly says “hold” but I expect to see different predictions within the next month or so
Got ban in some of those because they don’t line the buzz words like “AI” and “data analysis”
Would rather not open source it since I eventually want to make some money with a subscription tier
But thank you for the help : )
Then how are you expecting feedback if you're not willing to share code? 
=basically advertising/j
Not here to get customers. Here for beta testers
Feed back on the finished product. Apple wouldn’t send you the schematics of an iPhone for feed back, they would send you the iPhone (the product)
Just in mind that people here care about code, not cryptocurrency
So if you want feedback on the "product", not code, you are probably in the wrong place


It’s more that it’s easier to talk to developers since they know the language. They can say implement this library or this function
Not so much the content of the output more the structure
We aren't users of this thing you're making, and you refuse to share code. This isn't going anywhere
Telling anyone to invest into crypto sounds like a crazy idea and a real clean way to end up being sued. Especially since you're wanting to sell this financial advice.
There's also a myriad of other issues you have, like the AI forgetting or not fully taking into account a users current financial situation, the real life situation of a crypto (like if you're only reading, but not what the real life players like the various leaders of countries)
Or since we haven't seen your outputs the idea that you're not taking a users financials into account and having them invest into something more secure or take proper margins
A subscription for a Discord bot that gives AI-powered advice on which crypto to invest into is wild.
And also finally, the majority of your code should be about the AI and your discord bot should really just be an output of that code, which is relatively easy
And you're going to be competing with the smartest people in the world when trying to create any sort of product that's reading financial graphs. If a model could simply tell you what are good investments, then everyone would be following them
But also a piece of advice I would give you that's not "please don't do this" is to have the bot run in DMs and only run in DMs and delete any user message that isn't the DMs (or honestly delete them from DMs too)
You don't want users putting their financial info just in random servers
That's all well and good but my issue was that I couldn't get it working so I couldn't use the "whatever"
I asked in the dpy discord + some more research, it's just actually not possible without editing the library which 🙃
I mean
Subclassing and extending the functionality isn't really editing the library
I haven't done it yet, but the library throws an error when I try so I assumed I have to get rid of that. What would a better descriptor be?
Only if you give us the code we could help that
Otherwise we don't know what you have used and cannot give any meaningful feedback about this
What's was the error?
That the flag required an argument. This was intentional I think to mimic slash commands more
with the custom subclass that allowed boolean flags?
No. Boolean flags worked fine with the library, but they absolutely require you to set them to true in the command
When I wanted them to be true when passed without an argument
But passing them without an argument gives you an intentional error
That's what the subclass was for..
The library indeed doesn't have such option
That class allows for stuff like --shiny
Yes that's my thread where I asked there for help
Yes and it seems like you ignored the solution
i thanked them and said that I would try it today
I think what all do you are forgetting is that this is a new AI model that is designed with the sole purpose of analyzing trading data
Yea that's fs never been done before
Haters gonna hate ig 🤷♂️
I wrote you a paragraph on why what you were doing is whack and that's your response
as much as I'm sure I'd love to dunk on the combo AI+crypto bro, this really isn't the place IMO. You're not asking for help on how to specifically implement something in python relating to a discord wrapper
if you're just fishing for opinions on the product itself, that's better done elsewhere
@Deleted User @Deleted User
Hii
Is possible to bypass this or remove bcs i set task.loop to edit an embed in specific channel on 30 seconds
No
Though editing once in 30 seconds should be fine. maybe check that it is in fact running once per 30 seconds and not more
Kk thanks
But its gave same warning on 30 sec
I think if i remove the edit message warning will be removed ? @sick birch
The ideal solution is to not edit a message every 30 seconds. Why do you need to do this?
if you're trying to post updates on a timer, sending it to a webhook is a lot more forgiving than repeatedly editing a single message
i keep getting this error SyntaxError: 'await' outside function im not good at scripting can sm1 help me fix it
You'll need to understand asyncio if you want to use it here
SyntaxError: 'await' outside function
what does this mean 🙏
it means you can't use await outside of a function...exactly what the error says
ok
awaits are only valid inside of async functions
that's not what your error says
show your code @warm stratus
its literally inside async function what
it is probably just an indentation issue then. shwo your code
errors don't lie
wait i think i fixedit holon
dunno why u got an attitude fo
dunno why you're assuming I have an attitude 
im not assuming u just do bro
whatever you say
om,,g this error is making me mad broeoa
The error should come with a traceback identifying the line that's an issue
@warm stratus you from NY?
Does forwarding a message have it's own event in discord.py? I didn't find anything like this in the docs
it just fires on_message no?
Oh, okay
class discord.Message```
Represents a message from Discord...
My bot is not behaving as expected with forwarded messages as opposed to normal messages, I guess it's worth trying to update dpy first
I didn't spot anything for this, only a forward method
ah it's in the flags
!d discord.Message.flags
Extra features of the message.
New in version 1.3.
!d discord.MessageFlags.forwarded
Returns True if the message is a forwarded message.
New in version 2.5.
thanks for the help
yea
!d discord.MessageFlags.is_crossposted
Returns True if the message was crossposted from another channel.
Usually it means the same message is posted in multiple channels (could be spam, for example), not sure how exactly this flag gets triggered though
is_crossposted is for when you have a channel that follows another channel, an update channel on another server for example, and when they post in theirs it gets crossposted into your channel.
That makes sense, thanks
let’s say in theory i’m doing something like mass adding emojis, how long would i have to sleep between emoji addition to make sure i don’t get the rl of eternity 
Discord sends you the rate limits, and most libraries will respect these limits and slow down accordingly
you shouldn't need to do any limiting yourself
For guild add emoji, I think it is 50/1h (or 30mins) probably per guild
No idea about application add emoji
More issue is they don't always tell the exact limit
More need trial and error and see if it's RL or not
Library usually automatically respect global limit but since individual limit is not disclosed, it just use the 429 rate limit header thing to figure out how long to wait
Discord responds with the local limits. Modern libraries respect this. It's not a mystery
It just isn't a static limit that's true for everyone all the time, the API responds with the limits when you interact with it. The libraries read this response and throttle accordingly. You as the developer don't need to do that sleeping yourself
does a tasks.Loop keep running the next iteration if an unhandled exception occurs? I have a loop error handler that logs out the error and does some extra stuff, but I want the loop to just run again the next time around, though I don't know if this is the default behaviour and I can't find more specific details about exception handling for tasks in https://discordpy.readthedocs.io/en/stable/ext/tasks/index.html
It does not
ah, unfortunate. so I'd just start the task from my exception handler then?
Yeah that’s the easiest way to do it
wouldn't it run immediately after? I can add an asyncio.sleep in the error handler before starting it again but it feels hacky
It would, but as you said it would be hacky
are there any more idiomatic solutions?
There are a few let me pull up a resource real quick
This is not entirely accurate to your question but this is always good to read https://discordpy.readthedocs.io/en/stable/ext/tasks/index.html? and you could use a loop decorator
That’s what I would use atleast
i've been referencing that, and i am using the loop decorators. I'm just looking for an idiomatic way to skip a run if there's an unhandled exception, but if there's none I'll just have to restart the task in the error handler
@sick birchhii
im trying to use roblox api to fetch a users groups
but all of the apis i try just dont work
This command instructs the bot to send a list of files from os.listdir
It for some reason doesn't like the letter L. how do i fix this?
hai
Please How are you doing
good, you?
Amd its only if it at the end
"sma" is supposed to be "small"
I'm fine.
code?
I want to know how to code the following:
I am a student who is eager to learn
Check out the python docs
Please send
name_list = []
for file in file_list:
if ".flf" in file:
name_list.append(file.rstrip(".flf")
await message.channel.send(", ".join(name_list))```
the way .strip works is by removing any of the characters provided
"Hello".strip("Ho") will result in ell even tho there is no Ho at the start or the end
oh what i thought it was just from the eddge of the string
Yes that's what it does
But it checks if the character is in the string you provided and if it is, it removes jt
use str.replace or slice to remove the suffix
^
noice
@bot.command()
async def babalarim(ctx):
em = discord.Embed(title = "Çağdaş", description =" ", color = #a11010)
em.add_field(name = "Babalarim", value = "@xDoly, @bigmac, @Emekli Padişah, @Omewii")
await ctx.send(embed = em)
how to ping people here ?
doesnt ping here
it wont ping, it will just become a mention
also field name wont accept mention markdown
Or use the user id
f"<@{userid}>"
em.add_field(name = "Babalarim", value = "f"<@{userid}>")
just the same as <@id>
like this?
one is you hardcode the ids to the field value, one is using f-string
both are still <@id>
they result the same
k thanks
hmm?
Worth noting that an embed won't ping people, it has to be sent outside of the embed
Inside an embed it'll just be a mention
yes yes i meant mention
Loop.add_exception_type is what I used
wdym
thanks
I need help for making my discord bot
with?
I have code but some error is coming
show us the error then
Sorry but I don't have it right now
Can I dm it later?
I have made the bot recently and its working i think we can help you
GOJO bot is name u can try it in my srvr
Something is wrong Config file ig
Okay DM me
I am out of station right now soo I can't upload it
Thanks

me is confused too lmao😭
I'll never understand people who say they need help and then immediately that they can't share code.
sometimes they can't share full code
cuz they don't want you to use yourself code or someone else
More so talking about the people that say they're away and can't share any details at all besides "I need help"
i did not say, about any details they should share code erorr and error line
what does this bot?
its a TTS bot
What's your current working directory? Also are you trying to use a json file as a database?
wdym
Try to use .env file rather than json
so should i change botdata.json to botdata.env?
If u story ur token in json
It depends what this is being used for
No just .env
How are you using this file
The json file
Okay keep it simple first tell me
What is is to being used for
Json file is storing authtoken?
If it's just static config it doesn't matter what file type they use
Env isn't any better and in some cases is worse
I think in cases of bots env is better
and it says no customvoices.json
Anyways the issue is probably with your current working directory
Cuz I have made my bot recently
but there is customvoices.json
And its working perfectly with env
so how do we fix that
Do you know what a current working directory is to begin with?
no
How are you running the code?
Cuz ur calling files but the error is not found files
Maybe some folder structure problem or calling files logic problem
if i run normal it says this in the terminal but if i run debug it works but when i do the tts command it doesnt work
how are you running the code
Describe what you're doing to get this code to run, step by step
just this
Do you know what that does?
So when you run python, you do so in a directory on your machine. That is your current working directory, and everything in your script runs relative to that.
If you aren't picking it yourself, then this button is picking it for you and you have no clue what it's picking
how do we run it as the directory my folder is in right now then?
Either figure out what this button is doing and fix it to run python in the right directory, or just run your code yourself in a command line
python bot.py (in terminal)
run
i did py bot.py because it doesnt recognize python
Just running it isn't sufficient. You need to do it in the right directory
wait i didnt understand that part like can you explain to me step by step what i need to do , to make it in the right directory
@fast osprey it's not a run related error🤦
You don't understand what that button does
can you explain it
What do you think your current working directory is in that terminal?
Yes. And your file isn't there
You need to get your current working directory to be wherever you want your code to run from, cd'ing into it would work
alright done thanks
This basically just invokes your selected python environment on your current file, and itll use whatever working directory you already have in your terminal afaik
without python async func knowledge, should i learn dc library?
cuz idk very well about async funcs
and discord is using async funcs
You will need to understand the fundamentals of asyncio to use these libraries effectively
i am learning very easy
cuz i have good math knowledge
and i learnt very easy and understood python fundamentals
Async concepts aren't too terribly confusing in my experience, just have to understand the terminology and what's happening under the hood. A lot of people just slap awaits everywhere to make the errors go away without actually learning what these things do
alr ty
you can get pretty far by just slapping await on everything a good rule of thumb is if it's making a request to an external service. I.e the discord api or a database. You use async await. There's obviously a lot more that goes into it especially if you wanna have a scheduler and other things like that but you will defiantly be able to get away with just slapping async await on functions that make a call to an external service.
I can give you a quick explanation though, it basically allows your program to do other things while it's waiting for idk a timer to finish, a server to respond, pretty much an io bound tasks.
So here's a code example
ty
is it hard to do program yourself which responds any message different things like ai sometimes
no worries at all, if I say anything too complex just lmk I can re explain
or take ai api and change things so you do not need to code yourself bot like ai
i am interesting about ai
how it works and machine learning
that takes years of experience and schooling because a lot of it is just applied math
but here's the asyncio example
i know like logarithms
i learnt it myself from yt
!e
import asyncio
import time
async def say_hello():
await asyncio.sleep(1)
print("Hello")
async def say_world():
await asyncio.sleep(1)
print("World")
async def main():
start = time.perf_counter()
await asyncio.gather(say_hello(), say_world())
stop = time.perf_counter()
print(f"Total time: {stop - start:.2f} seconds")
asyncio.run(main())
:white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | Hello
002 | World
003 | Total time: 1.00 seconds