#discord-bots
1 messages · Page 400 of 1
code may not be identical, either, depending on what you're doing
well im still learning the basics atm so i think i can get a way with a change of wrapper but yeah ill just have to learn whats different and all that
@commands.hybrid_command(name="jumbo")
async def jumbo(self, ctx, emoji: str):
"""Enlarges an emoji from a server or Unicode emoji"""
custom_emoji = re.search(r"<a?:\w+:(\d+)>", emoji)
if custom_emoji:
url = f"https://cdn.discordapp.com/emojis/{custom_emoji.group(1)}.png"
await ctx.send(url)
else:
codepoints = "-".join(f"{ord(char):x}" for char in emoji)
url = f"https://twemoji.maxcdn.com/v/latest/72x72/{codepoints}.png"
await ctx.send(url)
this doesnt embed, why?
ask twemoji
I wondering how could i use other flies like a variable
Like i make a flies name tokenbot.py and have variable, token = "bot token"
And i need transfer the variable to bot.py
Just import it like you did with other library
Something like env
I still learning how to use env because i hear is very usefull to hold storage
You can just make a config.py file and then add it to .gitignore to avoid uploading credentials to github
If you use env it's the same story but you need dotenv package
there's absolutely no reason to use a .py file to store environment variables, thats literally what .env is for
What should i use
MyClient or @bot.command
I kinda fucked up when i realize that after i learn how to use myclient
I not sure how to use it
Your token need to be a string
!traceback
Please provide the full traceback for your exception in order to help us identify your issue.
While the last line of the error message tells us what kind of error you got,
the full traceback will tell us which line, and other critical information to solve your problem.
Please avoid screenshots so we can copy and paste parts of the message.
A full traceback could look like:
Traceback (most recent call last):
File "my_file.py", line 5, in <module>
add_three("6")
File "my_file.py", line 2, in add_three
a = num + 3
~~~~^~~
TypeError: can only concatenate str (not "int") to str
If the traceback is long, use our pastebin.
those are two completely separate things
you're comparing boeing 767s and oranges
hm nvm thats valid
it's just a chain it can't load the token
Traceback then?
show your traceback
I change them
restart terminal and run the python file again
the .env file loads but it doesn't find the token + it shows me File "C:\Users\User\Documents\discord-bot\src\bot.py", line 39, in <module>
Yeah my bad, i didn't realize it at firat
I also have the same issue
My friend told me "just use env" and i was confused why my variable token .env didn't work at all
he still can't find the bot token 😦
Same for me, that why i use py
Probaby need install something, i saw a tutorial video and i still don't understand
You need to actually load the env variables into your system
A package called python-dotenv can do that
But you might aswell use a json or python file for this
pip install python-dotenv
i think this is correct
It installed the package to the global python installation yes
is the same
Did you see that
Also, an env file is usually just called .env not cool.env lol
They are, no?
Idk? It's your code
Its not my code, I'm just saying I think they are loading the dotenv here
Just creating a file called .env doesn't automatically load them if that's what you're asking
i know that 🫠
Oh yeah they are if dotenv can find the file
They may need to specify the path in the load call
@bright oasis try it for me
ok
he still can't find the token lol
Show us your code
You gotta use import and other stuff too
Could you try moving the .env outside the src dir
it is already moved
Are you still having an issue?
Are they having issues loading the .env or getting the variables
Loading
They're getting the variable correctly but it's None
#discord-bots message
Reload your terminal if you are using Venv
Dotenv requires usually the use of venv
Til
And when you change a var you need to reload the venv by closing and reactivating which VS Code does automatically on terminal launch.
It looks like the last changes are not saved
so should I record?
If you get a error send it in here so we can see
Current directory : C:\Users\User\Documents\discord-bot Loaded .env file Token chargé: None Type du token: <class 'NoneType'> Traceback (most recent call last): File "c:\Users\User\Documents\discord-bot\src\bot.py", line 39, in <module> raise ValueError("No tokens found. Please set DISCORD_TOKEN environment variable in .env file") ValueError: No tokens found. Please set DISCORD_TOKEN environment variable in .env file
Put a print token statement before your if statement
What happen if you quote your token in the .env file
Check and see if you are getting the token passed
Aka make it a literal string
Shouldn’t need to
!code - you don't have to do this for every line
Last time i didnt make my token a literal string it didn't work, so worth a try
print("""You can do
multiple lines
at once,
and have cool
syntax highlighting
too.""")
Odd i have never had that issue
I will try to record and see
Replace if token is None
with if not token
token = os.getenv('DISCORD_TOKEN')
print(f"Current Token: {token}")
if not token:
raise ValueError("A Token was not supplied in the .ENV File")
bot.run(token)
@hybrid jungle @woeful hill thank you very much I had to save the files
No problem
I spent 3 hours for this little problem lol
Enable autosave in settings
ok
Literally a life saver sometimes
also a small question when I mark the file help.py the terminator tells me that there is already a file called help how could I do it?
show a screenshot
also what is the "terminator"
I found the problem
@thorn imp It works for me, is there still the problem?
Later, i gotta redeem myself from how i treat it my ex🙏🙏
ok xd
is there anyway or anything that can block nsfw links
like all, like without making a list myself? im going to make a cmd that screenshots a website
"nsfw" isn't a globally objective term. Maybe someone out there curates a list but these pop up all the time
mmm
Also consider things like Twitter, which can absolutely have nsfw content and you wouldn't know unless a human looked at it. If you care about making this distinction, you need a human to enforce it and review this content. Or you just let people post it and others report them
"explicit content"
Anyway can teach me how bebug Define error
Can someone tell me what’s going on here?
Can you show your pip list
What’s a pip lis-
Also your code has a lot of unnecasary stuff.
Intents.default() includes all intents except the 3 privileged intents so intents.guild = True and intents.messages = True are uneeded
You also just have intents.all() sitting there not being assigned to anything.
You also create a permissions object but then immediately overwrite it
-# Note this is assuming py-cords intent system which is similar to but not gurenteed to be the same as other libraries
It shows all the packages you installed. You have probably done pip install ... at some point. If you run pip list in your console it will show everything that you have installed
uninstall discord and discord.py then reinstall discord.py
Done
same error?
Also I just noticed the error you sent if from a different part in the code.
If you could look at the line number of the error and send that chunk of the code as text that would help
intents = discord.Intents.default()
intents.all()
intents.guilds = True
intents.messages = True
intents.message_content = True
permissions = discord.Permissions()
permissions.manage_channels = True
permissions.manage_messages = True
intents.members = True
permissions = Permissions()
permissions.administrator = True
client = discord.Client(intents=intents)
that is still the wrong lines. In the error is shows the line intents.message_content = False that is not in the code you provided
Have you saved your code?
Yeah
Can you post the full traceback here. You can take out the foldername of your user but you blacked out to much in the first image.
Please provide the full traceback for your exception in order to help us identify your issue.
While the last line of the error message tells us what kind of error you got,
the full traceback will tell us which line, and other critical information to solve your problem.
Please avoid screenshots so we can copy and paste parts of the message.
A full traceback could look like:
Traceback (most recent call last):
File "my_file.py", line 5, in <module>
add_three("6")
File "my_file.py", line 2, in add_three
a = num + 3
~~~~^~~
TypeError: can only concatenate str (not "int") to str
If the traceback is long, use our pastebin.
ape sequence '\L'
await ctx.channel.send
Traceback (most recent call last):
File "C:\Users\User\Downloads\Collecter-Hat\Hat-Collecter\main.py", line 23, in <module>
intents.message_content = False
^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'Intents' object has no attribute 'message_content'
Can you show from the top to line 31
Also are you sure you saved the code, the error still says that you are setting message_content to False but in the code you provided you are setting it to True
Wait, I forgot I set it to true
What do you mean you forgot? If you set it to true and it is false in the error that means that
A. You did not save the code
B. You did not rerun the code
C. You are running different code than what you are editing
I saved the code
Can you paste your code into the pastebin, make sure to remove your token
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.
C:\Users\User\Downloads\HatCollecter-HatCollecter\HatCollecter-HaterColle\HatCollecter.py:52: SyntaxWarning: invalid escape sequence '\W'
hwid = subprocess.check_output('C:\Windows\System32\wbem\WMIC.exe csproduct get uuid', shell=True,
C:\Users\User\Downloads\HatCollecter-HatrCollect\HatCollecter-HarCollect\HatCollecter.py:668: SyntaxWarning: invalid escape sequence '\L'
await ctx.channel.send Traceback (most recent call last):
File "C:\Users\User\Downloads\Hatellecter-Haterllecter\HaterCo/Hat\HaterColle.py", line 23, in <module>
intents.message_content = True
^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'Intents' object has no attribute 'message_content'
That’s the full error
Where did you get this code?
GitHub
What is your goal with this project
Just a discord bot that can control my pc for me
Are you sure you imported discord correctly?
I suggest that you build that from scratch if that is actually your reason for using this code. The code overall is terrible anyways
!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.
We will not help you further with this specific code
I am not going to share the link to the github but it was for a RAT (Remote Access Trojan) virus
try setting it in the constructor with a keyword argument or something
That should not make a difference, I think I know what the issue is but I am not going to share it as like stated above they were trying to get malicious code working.
I think it would if it was intended to be immutable or something
@rare nymph Please delete your message. You leaked your webhook URL (which is sensitive information) You should remove the webhook from your server so that you dont get random messages.
You can repost your code, but you should ask a question. Just giving your code will not get you any help
you do realize their message is a malware component?
Yeah just saw that now
<@&831776746206265384> ^
@rare nymph, I see you've just joined the server. Do check #rules and #code-of-conduct again. We don't sharing or discussion of malicious code
My code:
import requests
import asyncio
YOUR_CHANNEL_ID = 1335475367145902172
def load_users():
with open('users.txt', 'r') as file:
return [line.strip() for line in file.readlines()]
async def check_users_status(channel, users):
online_users = {user: None for user in users}
while True:
for user in users:
response = requests.get(f'https://api.roblox.com/users/get-by-username?username={user}')
data = response.json()
if data and 'id' in data:
user_id = data['id']
game_response = requests.get(f'https://api.roblox.com/users/{user_id}/onlinestatus')
game_data = game_response.json()
if game_data['IsOnline']:
if online_users[user] is None: # User just joined
online_users[user] = True
embed = discord.Embed(title=f"{user} has joined the game!", color=discord.Color.green())
await channel.send(embed=embed)
else:
if online_users[user] is not None: # User just left
online_users[user] = None
embed = discord.Embed(title=f"{user} has left the game.", color=discord.Color.red())
await channel.send(embed=embed)
await asyncio.sleep(30) # Check every 30 seconds
intents = discord.Intents.default()
intents.message_content = True
client = discord.Client(intents=intents)
@client.event
async def on_ready():
print(f'Logged in as {client.user}')
channel = client.get_channel(YOUR_CHANNEL_ID)
users = load_users()
client.loop.create_task(check_users_status(channel, users))
client.run('')```
my error:
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='api.roblox.com', port=443): Max retries exceeded with url: /users/get-by-username?username=darkpalidin (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x0000021BE2DFB170>: Failed to resolve 'api.roblox.com' ([Errno 11001] getaddrinfo failed)"))
Can anyone help me?
this isn't necessarily a discord bot issue, but here's what I found: https://devforum.roblox.com/t/action-needed-sunsetting-apirobloxcom/1796897
[Update] May 8, 2023 Hi developers, In order to increase the reliability of our platform and improve scalability, we are migrating endpoints away from the monolithic api.roblox.com web API. Beginning on July 15, 2022, we will start removing individual API endpoints from api.roblox.com. All endpoints are scheduled to be removed by the end of...
Sorry, apparently I opened a python file and it turned out to be a virus that manipulated my dc to send that chain code to all the servers that I have added, if anyone has any recommendations or advice, I would appreciate it. and an extra fact is that he wasn't even added to this dc group before being hacked.
Honestly that forum is pretty confusing. Is it saying they are switching to apis?
seems like they're switching to specific APIs for different things.Further down in the post there seems to be a list of endpoints and their replacements
Do you have any idea on which one I could use to check a users status?
I've never done any roblox stuff before, but it might be this one
I noticed that, but why does it say docs
because it is the documentation for the endpoints:
https://accountinformation.roblox.com//docs/index.html
or
https://create.roblox.com/docs/cloud/legacy
while True in async environment will make your bot stuck
Even with asyncio sleep afterward
If you want a code that will trigger every certain amount of time, use task
That's an oversimplification. If you are awaiting things inside that loop, it won't block. If the loop takes a short time, it won't block.
Discord.py's main logic (listening for gateway events) is just a big while loop. One just needs to be aware of the nuance.
leo, does putting a while True in a coroutine make it non-blocking?
You are either asking the wrong question, or I am misinterpreting you because putting a while True loop inside a coroutine function could make it blocking, not make it non-blocking. As I said, what matters is what you put inside that while block.
async def block():
# This would block
while True:
pass
# This would not
while True:
data = await session.get(...)
print(data['key'])
# this *could* block if the condition isn't met.
while True:
thing = get_thing()
if isinstance(thing, GoodThing):
break
```Top block would never yield control back to the event loop, and just run forever- not allowing other queued coroutines to run. The middle loop wouldn't, since it's awaiting stuff, hence allowing other scheduled coroutines to run in the meantime. The bottom loop could block, depending on (a) how long `get_thing` takes to run and (b) if that condition is ever met.
-# And by *to block* I mean to block the event loop for a considerable amount of time. Blocking calls are inevitable,**everything** blocks the loop to a certain degree, since asyncio is single-threaded. The problem is if you're blocking it for enough time that it disrupts the rest of the code from running smoothly.
yo
How can i make my bot send a message to a specific channel?
@commands.has_role("Customer")
async def review_command(ctx, stars: Literal['⭐️', '⭐️⭐️', '⭐️⭐️⭐️', '⭐️⭐️⭐️⭐️', '⭐️⭐️⭐️⭐️⭐️'], product: Literal['Gfx', 'Video editing', 'unknown']):
await ctx.response.send_message(f"Successfully send your feedback of {stars} star(s) and the product {product}", ephemeral=True)
bot.get_channel(1335576680869400648)
embed = discord.embed(
title="**New feedback!**",
description="** {ctx.author.name} left a feedback!**",
color=discord.Color.blue
)
embed.add.field(name="**Stars:**", value="the customer left a review of {stars} star(s).")
embed.add_field(name=":package:**Product:**", value="the custom bought the product {product}")
embed.timestamp = discord.utils.utcnow()
embed.set_footer(
text=Footer,
icon_url=FooterImage)
embed.set_thumbnail(url=thumbnail)
await channel.send(embed=embed, ephemeral=False)```
this my code
you just made a help post
yh
dont crosspost
Alrighty
https://dis.gd/hacked-account fill out this form, and don't run random python files without knowing what they do
hello I have a problem with a command the bot cannot put the id of a room in a json file
You shouldn't be using a flat json file as a database if that's what you're doing
ah but what if we make it nested? 
in discord py, any way to get nicknames, of people who installed your app?
not to server, but to their apps
Nope you cannot get a list of users that installed your app
Also "user" apps aren't part of any guild
am bit confused
You install an app to your profile
yea
So, where does a guild come in?
it doesnt but i dont rly see how that changes anything about my question
You get a member object in your interaction objects when the interaction was invooked in a guild. You can get the members nickname from that member object.
ik ik but, you can install apps to your server, or to your profile (so you can use them everywhere) and i was curious if you can get who, added your bot to their profile
so not to server
You would need to use webhook events to listen for when a user adds it
https://discord.com/developers/docs/events/webhook-events#event-types
Or track it via command uses using the events provided by the library you use
These are separate from gateway events so I dont know if discord.py supports it but it is likly you will have to set up the webserver yourself.
i see, thanks
how to like do commands group but like hybrid
!d discord.ext.commands.hybrid_group
@discord.ext.commands.hybrid_group(name=..., *, with_app_command=True, **attrs)```
A decorator that transforms a function into a [`HybridGroup`](https://discordpy.readthedocs.io/en/stable/ext/commands/api.html#discord.ext.commands.HybridGroup).
This is similar to the [`group()`](https://discordpy.readthedocs.io/en/stable/ext/commands/api.html#discord.ext.commands.group) decorator except it creates a hybrid group instead.
Sometimes worth searching/scrolling through the docs
Can someone help me fix an issue?
C:\Users\User\Downloads\New folder>python3 new.py
pygame 2.6.1 (SDL 2.28.4, Python 3.12.8)
Hello from the pygame community. https://www.pygame.org/contribute.html
Traceback (most recent call last):
File "C:\Users\User\Downloads\New folder\new.py", line 38, in <module>
bot = commands.Bot(command_prefix="!")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: BotBase.init() missing 1 required keyword-only argument: 'intents'
You need to declare intents when creating a bot
I have
I have
You have not
The traceback shows your code where you're creating the bot and not telling it what intents you're requesting
intents = discord.Intents.default()
intents.messages = True
intents.guilds = True
intents.voice_states = True
bot =
commands.Bot(command_prefix="!", intents=intents)
That's not what the traceback says
I have updated the code and it’s still doing it
Show the entire file (redact the token obv)
The traceback doesnt lie about the code python is running
guilds and voice states are enabled with .default() btw
Never mind, I have fixed it but now it is saying
C:\Users\User\Downloads\New folder>python3 new.py
pygame 2.6.1 (SDL 2.28.4, Python 3.12.8)
Hello from the pygame community. https://www.pygame.org/contribute.html
[2025-02-02 19:59:37] [WARNING ] discord.ext.commands.bot: Privileged message content intent is missing, commands may not work as expected.
[2025-02-02 19:59:37] [INFO ] discord.client: logging in using static token
[2025-02-02 19:59:38] [INFO ] discord.gateway: Shard ID None has connected to Gateway (Session ID: f04918ee390ce17a5095f7d700642c1e).
Bot is online as Rover MP#9917
nothing wrong
What about the warning?
message content intent is missing
read it, you don't have the intent enabeld so prefix commands won't work
!mcintent
The Discord gateway only dispatches events you subscribe to, which you can configure by using "intents."
The message content intent is what determines if an app will receive the actual content of newly created messages. Without this intent, discord.py won't be able to detect prefix commands, so prefix commands won't respond.
Privileged intents, such as message content, have to be explicitly enabled from the Discord Developer Portal in addition to being enabled in the code:
intents = discord.Intents.default() # create a default Intents instance
intents.message_content = True # enable message content intents
bot = commands.Bot(command_prefix="!", intents=intents) # actually pass it into the constructor
For more information on intents, see /tag intents. If prefix commands are still not working, see /tag on-message-event.
*may not work as intended
hi guys, I have a question for you, I made a language system, e.g. the bot supports two languages, it works so far, but I always have to restart the bot, but I have no idea why, can you help me, I actually saved the language in the database, that's why I don't understand ```py
await self.set_lang_cache()
async def set_lang_cache(self):
result = await self.all("SELECT guild_id, language FROM guilds")
LanguageSettings.languages = {guild_id: lang for guild_id, lang in result}```
You have to restart to do what?
can anyone help me with this issue, i can't host my bot
Maybe bottest.py?
you need to run a file
not the folder
i not sure how tho
Go into bottest
whats in bottest?
other one is a fail test
'src' > 'foad discord bot'
i combine the two folder into one because i was trying fix the issue
just discovered you can have a __main__.py file that runs when you try to run a folder
thats pretty cool
whats in foad discord bot?
Is probably the issue with me combine the two folder into one
I was trying fixed the problem but made it worse🙏
Well, i started new folder and quite the old folder because was using MyClient
Let me move the bottestout from the foad discord bot
only .pyc files should be in __pycache__. move the files out of there
pyc? My flies only had . py
.pyc files are python cache files. they're saved so python doesn't have to recompile the language
i kinda confuse
isn't this correct
no
move the files out of __pycache__ and into foad discord bot
Are you sure tho, the bottest is the new main folder i'm using
Oh wait i get it
i dont see why you're nesting your code in so many folders
but if you must, then add a main.py file that just imports from your bot.py file (causing it to run) and then run that file instead as a proxy
Is working now but i fucked up my new code
I able to restored my old script, thank for your help 
I'm working on a Discord bot using discord.py and app_commands. I want to make sure that certain commands in my dev_group are only accessible to the bot owner.
i tried
def is_owner(interaction: discord.Interaction) -> bool:
return interaction.user.id == YOUR_OWNER_ID
@app_commands.check(is_owner)
.....
but it doesn't seem to work. I also considered @commands.is_owner(), but I'm not sure how to properly apply it to app_commands.Group.
How can I make sure that only the bot owner can use and see these commands
You should not use app commands at all for this, IMO. The entire point of app commands is to publicize and democratize them, which is the exact opposite of what you're trying to do
If you don't want a random guild owner to decide who gets to use it in their guild, don't make it an app command
(or if you do, only sync it to a private guild and apply permissioning there)
I also have one quick guestion
I wanted use testing.py for something but i also want use bot.py for other project but i can't enter both of them into one "c:flies/testing.py/bot.py "
I only can use testing.py or bot.py one at a time
"use" is a pretty vague goal here. Python runs with one file as its entry point/__main__
So it depends on what exactly you want to happen when when you run python ...
Oh uh, i was trying learn slash and event, i use more flies to make the script less long and less harder to read, i through there was a way to combine those and execute them
If using discord.py (and probably in most forks), there's a concept of extension which allows you to load external files and make your bot object available to them (such as for the purpose of attaching listeners/commands/cogs/whatever)
Yeah how could i do that, that be very helpfull when i can organise it
Thnak you, that i was looking for!
If all commands in the dev group should be limited, you can use guild commands. You can register them to a specific guild and they won't show anywhere else. This would be better than prefix commands as you don't even need to use the message intent if you are not already using it
thanks i just convert them to normal command found it the best solution
You get to make your own decisions but in the long run "normal" commands (which I am assuming you are talking about prefix commands) are worse.
- You need message content intent approval once you pass 100 servers unless you want to mention the bot every time
- You need the message intent which just uses a bunch of bandwidth for the 0.001% of the messages you will actually care about. This also means that you cant have an interactions/http only bot.
- You never know if discord will make message content even more restricted (it is magnitudes less likely discord will restrict app commands)
You do not need message content intents to run prefix commands
You receive message content when the bot is mentioned and in dms, both of which are reasonable for owners/dev teams to do
Still need to consider their third point tho
Getting the content if mentioned etc is considered a workaround by Discord: https://support-dev.discord.com/hc/en-us/articles/6383579033751-Message-Content-Intent-Alternatives-Workarounds
Huh they added a lot more to that post since I last read it
I did mention "mentioning" in my message.
And to be honest switching to a DM is the same amount of effort as switching to a test server with the guild command.
Debatably, I'm just challenging that prefix commands are worse as they work perfectly fine and in fact better than slash commands for my workflow without the message content intent
slash commands are nice but sometimes it's lacking for a specific feature you want to implement
I have only ever been able to come up with 3 reasons that prefix commands would be better in niche circumstances
-
Accepting a variable number of attachments is annoying
-
/tagand/tag editcant coexist -
You cant have discord side permissions checks for subcommands
-
Can be fixed by just appending whatever the main feature of the base command would be IE
/tag get -
Is kind of a non-issue because prefix commands dont have discord side permissions checks at all.
Should I use discord.client or discord.ext for my discord bot
Depends on what you want, for most cases discord.ext.commands.Bot would be enough for you, unless you want to do some lower level stuff with the api you can use discord.Client, it also doesn't have many useful methods which commands.Bot has
Thanks, jiggly balls?
👴🏿🙏🏿👍🏿
Does anyone know how to fix this?
are you using a JSON file for a database? 
yes
Source code: Lib/sqlite3/
SQLite is a C library that provides a lightweight disk-based database that doesn’t require a separate server process and allows accessing the database using a nonstandard variant of the SQL query language. Some applications can use SQLite for internal data storage. It’s also possible to prototype an application using SQLite and then port the code to a larger database such as PostgreSQL or Oracle.
The sqlite3 module was written by Gerhard Häring. It provides an SQL interface compliant with the DB-API 2.0 specification described by PEP 249, and requires SQLite 3.15.2 or newer...
waitlist is an empty dictionary
!code too
I mean, the error is pretty clear
The thing is the log directly above shows as having added something to that dictionary
True
Provide some code @fallen kettle
As of now, we can only speculate
I will when i’m home
Anything that stores data could be a database
Would it be good in production? Is another question
"good in production" downplays how horrid flat files are everywhere
ok then i correct myself: JSON should not be used as a database
!pypi asqlite
hey check #1336514859566760018
yo
hot take json should not be used at all and its only redeeming quality is being human readable
Yaml on top
toml >>
hi can anyone help me make a discord bot?
i wondering is this correct because i trying learn how use extensions
I kinda confused how to use extension
it has its use cases like in sending data over a network through HTTP requests and static data like config files, loot tables, etc. but for more complex things, constantly loading and dumping JSON is an awful idea in production
why are your python files in __pycache__?
whats your issue?
and why is your main.py in your cogs colder
I don't know how mange folder yet 
mange?
move ur bot.py file out of __pycache__
show the contents of ur main.py and bot.py file
show the contents of ur button.py and testing.py file
only then we'll be able to tell if ure using extensions properly
i wanted help making a bot for my discord server
Well yesterday i trying learn how use extension because i can't execute other commad in button.py because i was running python "c:flies\testing.py" and one of my friend told me to use extension so unload testing.py and reload button.py and discord python library wasn't clear about it
yeah. how far have you gotten?
can you rephrase? i didnt quite catch that
Well my main.py had nothing in it yet, was old project i trying learn
And my friend told me there something wrong with the pycache and i was confused and end up in this situation again
i gave up bc it wouldnt work
define "it wouldnt work"
and do you want to learn how to make one or do you just want someone else to make one for you
i wanted someone to like make on for me
or help a lil
people are unlikely to do that for free
oh
what do you need help with?
thats really messy, you have a Bot and also a Client
You could try to learn how to make a bot from here https://fallendeity.github.io/discord.py-masterclass/
A hands-on guide to Discord.py
i wanted like a command

try the masterclass infernum showed
yeaaa i know and i trying change to @bot.command
keep in mind the library is massive so you might have a hard time
but its relatively simple at the same time
ill try
well i wanted i execute other command from other flies but sure how and i trying do it myself and end up mess
help
Just try to follow the guide I linked, it'll be good to get u started neatly
okay
environment variables
.env files store environment variables
if its for your token, dont bother
just use a txt file
ok
bot.run(open("token.txt").read())
then use Bot
TOKEN = os.getenv("TOKEN")
now make a .env file in the root directory of ur project
TOKEN = your_discord_token```
she said a txt file is fine bc idk how to make .env
.env is better practice
Youre skipping thru the guide so slow down and read it again
^
@quick gust I also have one main guestion, should i go for @bot.command or MyClient
not a good idea
two different things completely
I don't know what you believe you're comparing
Two is different?
I thought was the same thing😭
Youre going to get more problem watching out dated youtube tutorials
"MyClient" is the name of your discord.Client subclass (according to the code above)
@bot.command() is a decorator for registering specific functions as commands
If you find all this thing is so difficult and you don't understand one bit, you should learn python first, really
!res ^
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.

nah im watching normal yt
Can you tell me how to do this part because i'm fear of messing up again
The extension path is similar to python's import mechanic
Isn't that really hard, the problem is, is very hard to understand few day ago i was struggling how to use env and i end up learning by doing few mistake and corret it and asking the commuity for help
im new to python its hard
I not sure how to set up the flies correctly
That the issue i'm getting
I end up making the problem worse if i trying mange the flies and end up putting like 5 folder in one
Tbh you can just put everything in the working directory
When you learning something new is hard but don't over think it that all
I thought my first ever laptops like 2week ago and i not sure how to mange flies 🙏
Do you know what a directory is
In windows world it is called "folder"
Your working directory is where your, usually, main.py file is
And if you create another file, namely config.py
You simply do import config
Because they are in the same directory/folder
However if you create a directory/folder, say ext and you put your config.py there instead
or import ext.config
Because the path is ./ext/config.py
no
One working directory is one project
However, if you want to make small files for small projects in the same directory, you can
They are still in the big project
well, my wording is bad
Could we dm because i have guestion
Are you sure about that because one of my friend said don't do that because when you trying execute !help won't actually execute the main.py
He told me do something like this
import discord
from discord.ext import commands
import os
intents = discord.Intents.default()
intents.message_content = True
bot = commands.Bot(command_prefix="!", intents=intents)
@bot.event
async def on_ready():
print(f"Logged in as {bot.user}")
# Load all cogs in /cogs
for filename in os.listdir("./cogs"):
if filename.endswith(".py"):
bot.load_extension(f"cogs.{filename[:-3]}")
bot.run("your_token_here")
Out dated code
load_extension is async on discord.py v2+
That's why your cogs are not loaded
Hence the command inside it won't work
Oh wait i didnt read the message before codeblock
The code is still outdated tho
I'm not talking about cogs, i was talking about path and import
When you load extension you give it a path
I feel so dumb
cogs.filename = ./cogs/filename.py
In the case of load extension
os.listdir will list all the files inside the folder
So it will return something like
["filename1.py", "filename2.py"]
And you wrap it in a for loop to iterate thru the list
Oh i see now, i understand
So filename variable will be filename1.py in the first loop
Since it ends with .py, the if statement passed
to load_extension
The load_extension finds a file inside the cogs folder, named filename1.py and try to load it
I try later when i'm available
How can i make it that if i execute a command it is not replying to my message just sending for example an embed?
@calm vector ^
I suggest you re-read the Discord terms of service that you agreed to when you made an account.
https://discord.com/terms/#4
You agree not to license, sell, lend, or transfer your account... without our prior written approval.
Hm what?
Its just an example doesnt mean thats mine?
I am just curious how to make a command like that and not how to sell accs or sum
It is yours, it is on the server that you have linked in your status. The server linked in your status is owned by you. You have asked for help with this bot before
I have never asked help for this bot before i asked for an other bot but not this bot you can see in the picture the bot in the picture is not coded by me so i never asked for help abt this bot.
If you have these examples this is worth just sending them to mod mail. People do this indirection all the time to get help with their problematic bots
Do webhooks trigger on_message? I was trying to add this code, but it doesn't add the reactions to the embed
if message.channel.id == self.appeal_channel_id and message.webhook_id:
await message.add_reaction(self.check_mark_emoji)
await message.add_reaction(self.x_emoji)
return
does the if clause pass?
Wait my bad
I forgot I had added this condition before 😭
if message.author.bot or not isinstance(message.author, discord.Member) or any(
role.id in self.staff_roles for role in message.author.roles):
return```
Webhooks are technically considered bots
i don't think so
oh on the client side
yeah maybe
it might be clearer to use discord.Message.webhook_id
Hi
Is sending audio files the same as sending regular files?
Webhooks are indeed technically bots
Why you using webhooks?
@young dagger
This is an open question to anybody who has experience or wants to opinionate (anything is welcome)
I am creating my own trivia bot because I can and one of the features I want to have is the ability to just send small audio files. Like a "What is this sound?" kind of thing. Would it be better to send the file as a direct file to discord, therefore I'd have the files on my local machine or should I upload them to youtube and send a youtube link?
shouldnt the bot just use the voice channel to play sounds
Na I dont want to do that
I don't want to force users to have to join a voice channel
They should be able to participate anywhere.
Also the users should be able to replay the sound as many times as they want
local file
I'd rather be forced into a vc than opening yt for smth like this
and then u get a 15s ad 
Alright so local audio files and send those
;-; I dont want it to send like that. I want it to send like an actual audio file
Like this lol
change the file extension
when you make a File instance, change the filename to be "whatever.mp3"
!d discord.File
class discord.File(fp, filename=None, *, spoiler=..., description=None)```
A parameter object used for [`abc.Messageable.send()`](https://discordpy.readthedocs.io/en/stable/api.html#discord.abc.Messageable.send) for sending file objects.
Note
File objects are single use and are not meant to be reused in multiple [`abc.Messageable.send()`](https://discordpy.readthedocs.io/en/stable/api.html#discord.abc.Messageable.send)s.
filename kwarg
who can help me make SSF USER INSTALL BOT also known as self bot ill pay 25$
Yeah it was my filename
!rule paid
Self bots are against TOS and therefore nobody here will help.
!rule tos also
5. Do not provide or request help on projects that may violate terms of service, or that may be deemed inappropriate, malicious, or illegal.
2 rules broken with 1 message
game is game
and he left the server

🤔 can discord bots not delete ephemeral messages they've sent?
or edit apparently?
:( Apparently not according to ye ol' google
they can
well I cant D:
I tried interaction.message.edit and interaction.message.delete coz im using buttons in the ephemeral message
only via an interaction
Well.. https://youtu.be/T7MbKr1As2A here's a preview of my bot so far lol
aka using interaction.delete/edit_orginal_response
Is there any way to add multiple reactions in a single call?
Buttons are better. You get like 9 of them. Maybe more, but I've never gone above 9. They're interactions as well so you can do wild stuff like respond in ephemeral. respond with more buttons. Respond in modal. :D
Use voice messages
IMO there's no reason to rely on reactions anymore to determine a persons response to something
You can also respond with the dropdown menu thingy
Maximum is 25 per message
25 buttons per message?!
Buttons are lit yo
So really. If you're using reactions, you're using outdated tech. Move to buttons.
You can have 5 action rows per message. Each action row can have 1 select menu or 1-5 buttons
So I can have many select menu and many buttons in 1 message?!
I am blessed.
It honestly amazes me how much of discord is still free and not hidden behind a paywall lol
Like discord does such a great job to put stuff behind a paywall but only if you absolutely need it while the rest is free.
5 rows of ui elements per message
You can have 25 buttons OR 5 select menus OR 3 select menus and 10 buttons OR 1 select menus and 20 buttons, and more combos
By the looks of it you might be able to add up to 10 action rows per message soon™️ leading to 50 buttons
Discords like "Hold my free shit. lets go deeper."
Also is there even a reason to need that many action rows or buttons or menus?
like at what point do you say it's too many?
I've tested it and for me personally I have 2 rows at any given time (except for my above trivia bot thing) and 2 of the buttons are dedicated to pagination just to try and keep it neat
I tried doing 3 and 4 rows and even with a few characters per button it just felt too cluttered. I can't imagine having 50 buttons
I cant really see a reason to have 25 lol
if they add more buttons i can use buttons to display a wordle letter status even
wordle in discord?!
there are multiple ways
that's a very strange way to display that
hhmm
If I were to make wordle in discord using buttons i'd be limited to just 5 word max. right?
Coz having it on multiple lines is weird
Coz I could display the 3 or 4 colors needed using default button colors.
I assume the attempts button opens a modal?
nah the you won button is a guess button
attempts just there cuz i think disabled button looks nicer than a field text in embed
Perhaps for alignment you could put it on a separate row?
And you could even change the color as you get fewer attempts.
Green at start. yellow by 3rd. red on last
Or maybe green, blue blue, yellow red
You could also do the same for the embed color. Change its color based on number of guesses remaining
there are some. the biggest one for me is they're huge and disruptive
but its mostly situational
Can you show or tell me an example where emojis is better?
better than say buttons or select menu
Big Brother
!bigbrother
Monitors users by relaying their messages to the Big Brother watch channel.
!bigbrother unwatch <user> <reason>
Stop relaying messages by the given user.
!bigbrother watch <user> <reason>
Relay messages sent by the given user to the #big-brother channel.
Bot
!echo [channel] <text>
Repeat the given message in either a specified channel or the current channel.
!embed [channel] <text>
Send the input within an embed to either a specified channel or the current channel.
BotSource
!source [source_item]
Display information and a GitHub link to the source code of a command, tag, or cog.
Branding
!branding
Control the branding cog.
well, for these we probably should have buttons. but assume it was just the trash icon
i prefer having a small trash emoji than an obnoxious big red button
especially when the embed is fairly small. at that point the delete button is almost the same size as the embed itself
If buttons are not viable you could move to select menu instead?
Select menu imo would be more ideal as it would allow us to jump directly to a specific page instead of having to scroll
Reactions seem to be more buggy though. I also find it anoyying when the text shifts because it took a second to start adding reactions. Plus reactions cant be disabled. And it is unintuitive for the user because anyone could add a reaction to a message, it can be unclear that it is actually part of the bots functionality
whole ass keyboard is insane
"Hold my emojis."
Holding emojis:
![]()
32%
lol
Emojis successfully held!
![]()
100%
Thanks. You can put them on the floor over there
no problem 
the problem with using emoji is that...
i have the whole ~150 lines of code saving the emojis
yeah, better way is to automatically do that using discord.py 2.5 feature
it will be shorter but the emojis need to be sorted when upload for easy iterating thru
I mean, assuming the pattern for emoji names remains the same, it wouldnt be too difficult
i did that, im just lazy updating to discord.py beta
the fun part is, you actually don't need the name, you need the id
Yes but the sorting part would be easier if u went by name
what feature is that?
16
Lets see
the first one is no resampling. the second one is with Resampling.NEAREST
That’s great!
Just ask your questions here or in #1035199133436354600.
People won't randomly join calls for basic things and questions.
If you're looking for a human to do for free what an AI used to do for you, that's not a good mindset. AI holds your hand, doesn't teach you anything, and lies through its teeth.
If you aren't comfortable reading documentation, understanding the concepts, and trying out code yourself, you are setting yourself up for failure.
json files are not a database, too
ai doesn't write the code
basic things that was wrote by ai
free all day basically
We're not your personal assistants
As mentioned, if you have clear questions we can help
We won't code for you as it's contra productive
We'll give guidance and resources for you code it yourself
Humans are humans, AIs are machines.
Treat a human like AI and nobody will help you.
He's gone :( I wish I got to see the original questions.
Ahem? I beg to fricking differ. The amount of discord bots I've seen being sold that using a json file or similar as a database is astounding.
You can use a json file as a database but it presents its own issues that you will encounter almost immediately lol
they got upset and deleted all their messages
lol the walk of deletion
like 95% of people selling discord bots are not that great at programming and sell low quality products
lol this is true. I spend most of my time rebuilding or fixing shitty discord bots sold to people
they don't even do the bare minimum like containerize it so it's easy for their clients to run
My favorite one is "give me your token and I'll run the bot just trust me bro"
lol
The amount of trust some people have in me when I build discord bots for them... I could destroy their entire life in like 2 seconds flat if programming wasn't fun lol
I'm often given complete access to not only their discord servers but their gaming servers as well. One script could delete everything.
But alas. That'd be lame lol
People are uneducated, don't care, or both. The amount of bots that request admin and people just grant it is obscene
Well unfortunately the bots I make actually require some high level permissions. I create discord bots for gaming servers and usually it's to help them catch cheaters and what not. So this requires the bot to be able to ban people and get some data etc. Which unfortunately requires a specific set of permissions which could cause a great deal of harm.
It would be nice if the systems I use had better management over permissions so it wouldnt require such access
The main problem is when a bot specifically requests the "admin" permission because that just means that the owner put no thought into what permissions the bot actually needs
I once fixed up and extended a telegram bot that was like 20 lines of code, and paid $180 for. And everything it did I could find how to do on Google, with written tutorials.
And that's why most of my friends who once regularly asked me for help, now know how to program
thats a whole dollar short of 10 dollars
probably two if you split your money right
thats a whole two dollars short of 11 dollars
So i made a /review which should be only for my customers so they can give my service a review but for some reason even if i dont got customer role i can just bypass it and execute the command how can i fix this bc i tried everything
Kinda crazy ngl
Is the bot only in servers you control? Otherwise people can just grant whatever roles they want
yh i was thinking of that but i want it to be like when you dont have the required role and try to execute the command it will say smth like ,,Hey! You dont have permissions to use this command."
I can't do this for subcommands can I?
Why do you want people to be able to see and bother running a command that does nothing
And that you have to redeploy code if you want it to change
yh
Wait i can show you my command
@bot.tree.command(name="review", description="Give the Service a Review")
@commands.has_role("Customer")
async def review_command(ctx, stars: Literal['⭐️', '⭐️⭐️', '⭐️⭐️⭐️', '⭐️⭐️⭐️⭐️', '⭐️⭐️⭐️⭐️⭐️'], product: Literal['Gfx', 'Video editing', 'unknown']):
await ctx.response.send_message(f"Successfully send your feedback of {stars} star(s) and the product {product}", ephemeral=True)
channel = bot.get_channel(1335696976096002150)
embed = discord.Embed(
title="**New feedback!**",
description=(f"** {ctx.user.name} left a feedback!**"),
color=discord.Color.green()
)
embed.add_field(name="**Stars:**", value=(f"**the customer left a review of {stars} star(s).**"))
embed.add_field(name=":package:**Product:**", value=(f"**the customer bought the product {product}**"))
embed.timestamp = discord.utils.utcnow()
embed.set_footer(
text=Footer,
icon_url=FooterImage)
embed.set_thumbnail(url=thumbnail)
await channel.send(embed=embed)```
If you want to limit access to a command by role, use the permissioning system already given to you
No, but if you want subcommands to be permissioned differently you're not using subcommands as intended. They're just options of a parent command and grouped together for pretty much all metadata purposes
Hmm
Is that the only option?
It's not, but it's the most correct one
@commands decorators don't work on app commands, entirely different packages. You need the @app_commands decorators. There's one for a local role check, but this is worse in every way than just using the permissions discord gives you. Users will be presented and cluttered with a command you don't want them to use anyways, and your bot wastes bandwidth processing a command that shouldn't have been run in the first place
yh true that makes sense thank you, i will use the discord Integrations permission instead.
!d discord.app_commands.checks.has_role
@discord.app_commands.checks.has_role(item, /)```
A [`check()`](https://discordpy.readthedocs.io/en/stable/interactions/api.html#discord.app_commands.check) that is added that checks if the member invoking the command has the role specified via the name or ID specified.
If a string is specified, you must give the exact name of the role, including caps and spelling.
If an integer is specified, you must give the exact snowflake ID of the role...
This is the check if you do decide to use it, but it's your call
Okay thanks
Hello ,i want to learn discord bots do anyone recomand some tutorials?Even tho i have a few bots i want to learn them better
python -m pip install audioop-lts
Or downgrade to python 3.12. You should be in the habit of checking your library deps support
Basically don't use any tutorial you find by searching "python discord bot tutorial". They are all outdated. You should use the examples and docs of the library you are using, you can also ask if they recommend any tutorials
How I can host my discord free boot
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.
hello, im just here to ask if pycode is a good idea to keep the bot online, im trying to use pycode since termux takes quite a while to edit the codes in my opinion, since it has quite a messy interface. of course, im only a beginner at this type of stuff, so im just here to test out some opportunities, and not create famous bots.
so that means the bot doesnt necessarily needs to be online 24/7
im going to be using pycord by the way.
all of the mobile IDEs will be fairly bad/lacking. pretty much nobody programs or hosts on mobile so the ecosystem around it will not be great
@fast osprey would you mind reviewing a pr for the discord.py-masterclass guide (help command)
https://github.com/FallenDeity/discord.py-masterclass/pull/88
Hello, can anybody help me with a bot I am working on for a server called Arcadia. I am an beginner-intermediate, looking for those who can help keep up the work or help maintain it. I am also looking to work on it and make it a bot which actually makes the server unique. Looking for assistance, please help.
link the repo
i wanna see this
What's wrong with this?
@bot.tree.command(name= "send_results", description=("Sends R/A results!"))
@discord.app_commands.choices(results=[
discord.app_commands.Choice(name= "Passed", value= "1"),
discord.app_commands.Choice(name= "Failed", value= "2")])
async def results(interaction = discord.Interaction, results = discord.app_commands.Choice[int]):
await interaction.response.send_message(f'Results: ',{results.name})```
you'd do better typehinting to an enum instead of using .choices
from enum import Enum
class Outcomes(Enum):
Passed = 1
Failed = 2
@bot.tree.command(...)
async def results(..., results: Outcomes):
...
oh wait @wheat summit you're supposed to typehint results to ...Choice[int], not set it as a default
(as an example) instead of doing a: int, you're doing a = int
Sorry I don't understand, could you write the code for me?
is this code AI generated
Nope, all by my self.
you sure?
Yep.
I'm not that good, I'm still a beginner.
Watching a video but I don't understand the error.
do you understand how typehinting works in python?
Not really.
ok thats something you should look into then
python is dynamically typed so typehints are stripped at runtime
but they're used to annotate what types variables, parameters and functions / methods involve
def mul(a: int, b: int) -> int:
return a * b
this is the same as ```py
def mul(a, b):
return a * b
but we see that it takes two integers and then returns an integer
I see.
this can be useful for more complex code
this is just a basic example
assignment and typehinting are two completely different things
like i said, typehints are stripped at runtime, so weird stuff like this works
Alright.
!e ```py
a: int = "hello world"
print(a)
:white_check_mark: Your 3.12 eval job has completed with return code 0.
hello world
So, how should I implement it in my code?
we said a is an integer, but we can put a string there instead
because python is dynamically typed
variables can change types
Yeah I've done that before.
you want to typehint to the Choice[int] instead of assigning to it
and after you fix that, change it to an enum
or use a Literal if the integers mean nothing to you
ask concrete questions
ask your question directly
dont ask "can someone help me ? "
if its a niche question , ask it in #discord-bots or in a thread
no i need help on how to start making one
Pick a library -> follow that library's getting started guide
have you checked out resource list ?
!res checkout discord resources on here
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
Is there anything for this?
on_member_join and check for this value and if true, just kick / ban?
No, I dont have an official source but I have heard that it is not available to bots to prevent that specific thing. They dont want servers to trust those indicators 100% so you should not take automated action on them.
!d discord.PublicUserFlags.spammer
Returns True if the user is flagged as a spammer by Discord.
New in version 2.0.
That?
Or maybe it's the undocumented "unusual_dm_activity_until" field in the member object, if it still exists
would you mind reviewing a pr for the discord.py-masterclass guide, sorry if i am disturbing you 
this one for reference https://github.com/FallenDeity/discord.py-masterclass/pull/88
ty so I don't need to review it
are your semester exams over?
Soo many lines 
So you just copypasted the whole ext.commands help implementation and changed everything to HybridCommand / app_commands.Command and added a paginator
the pagination stuff can be skipped, mostly want a review for the internal help command injection/callback stuff
pretty much yeah with some injection stuff for app command callback and related metadata
figured it out 👍
Excellent.
also btw you can mention commands
makes them clickable, so it would be pretty neat if you used that instead of the blank /help
Not much useful in a channel people likely can't send messages in
ah nevermind then
hello
is there a resource on how you did this?
@viscid hornet
did you use pillow?
ooh they do have it
!d PIL.Image.Image.resize
Image.resize(size: tuple[int, int] | list[int] | NumpyArray, resample: int | None = None, box: tuple[float, float, float, float] | None = None, reducing_gap: float | None = None) → Image```
Returns a resized copy of this image.
so it's im.resize((new_width, new_height), Resampling.NEAREST)
Thank you for sharing!!
thank you so much for real this is super useful!
no problem, to both you and @frail raven. thank dharem for introducing me to that in the first place
yall is there a way with slash commands to only allow a specific list of strings as input
You would want choices
There examples here
yes
thx idk how to find stuff in the documentation
Note that this is limited to 25 options
And is only able to be updated by syncing your command again
you do not need to find anything, they literally gave you the exact thing you are looking for and it also has examples
no i mean when im looking for something
why is my on_member_remove event sending multiple embeds when theres only one instance```py
member leave
@client.event
async def on_member_remove(member):
print(f"{member.display_name} left.")
embed = embeds.leave_embed(member)
leave_channel = client.get_channel(Config.Leave_Channel_ID)
_ = await leave_channel.send(embed=embed)```
idk if its going to be the same for you, but i just restarted whatever program I was using. I was using Visual Studio Code and i had two tabs open in the terminal thingy at the bottom, with the same code. so when I ran it, it ran both
i know jack shi about coding, so idk if that was the real issue but, yeah, closed the second tab and restarded my app, and it fixed it
2 instances of the bot running could cause this
Also if it happens only every few times it could just be discord.
never had it happen randomly
can someone help me
idk why coding isnt working for me
tried it all and nothings working
(dm me pls)
we don't do DMs
Neither do we without any details
Create a post in #1035199133436354600 and give us the details of your problem
i’ve tired nothing helped
sooo maybe make a post describing what you tried, what your goal is, and what the problem is?
is there a partial channel class?
some way of sending a message into a channel but only having the guild and channel id
PartialMessageable
nice, thanks
When New User Join -> [DISCORD BOT] (Sends Request to User Bot) -> [THIS USER BOT IS IN A SERVER EXAMPLE ADOPTME] (IT WILL CHECK IF NEW USER WHICH JOINED YOUR MAIN SERVER IS IN ADOPTME) -> {IF YES} -> {IT WILL SEND MAIN BOT TRUE (MAIN BOT WILL KICK THAT USER)} || {IF NO} NOTHING HAPPENS
who can help?
Thanks to discord.py, sending local files as embed images is simple. You have to create an instance of discord.File class:
# When you know the file exact path, you can pass it.
file = discord.File("/this/is/path/to/my/file.png", filename="file.png")
# When you have the file-like object, then you can pass this instead path.
with open("/this/is/path/to/my/file.png", "rb") as f:
file = discord.File(f)
When using the file-like object, you have to open it in rb ('read binary') mode. Also, in this case, passing filename to it is not necessary.
Please note that filename must not contain underscores. This is a Discord limitation.
discord.Embed instances have a set_image method which can be used to set an attachment as an image:
embed = discord.Embed()
# Set other fields
embed.set_image(url="attachment://file.png") # Filename here must be exactly same as attachment filename.
After this, you can send an embed with an attachment to Discord:
await channel.send(file=file, embed=embed)
This example uses discord.TextChannel for sending, but any instance of discord.abc.Messageable can be used for sending.
self bots are against discord tos and don't get helped with here
its not selfbot/
its proctetion
bot
Why would that matter at all? Rules are rules
You can write your question without it being IN BOLD AND ALL UPPERCASE, painful to read.
Because of you using "user bot" it implies it's a selfbot, which is not allowed as per ToS - though protection can be done with normal discord applications/bots. You just need to invite the bot in both servers. Kind of like a global ban bot.
There is no point to have 2 bots that communicate when one bot can do the work
Add your bot to both servers and do it
this somehow dont add a application command for me
@app_commands.command(name="verification",description="der command für die verifikation")
@app_commands.choices(option=[
app_commands.Choice(name="zeig den code",value="zeig"),
app_commands.Choice(name="gib den code ein",value="gib")
])
async def verification(self,i : discord.Interaction,option: app_commands.Choice[str]):
if option.value == "zeig":
self.bot.vercursor.execute(f"Select * where Discord_ID = {i.user.id}")
x = self.bot.vercursor.fetchall()
print(x)
can someone help me
Did you sync?
no it works now
this sql query doesnt look right
it looks like it is missing a table
how can i make bot press button?
Bots can't perform interactions
but like this, like not a bot like self-bot
Bots cannot perform interactions
if it's a url button, you can read that and hit that url sure
its an example of button
i just need to know how can i fire that logged user will press button

bruh
what is a logged user, and what is fire
were you born yesterday
Questions can be an insult, which that was
google insult
is that another question
logged trough token trough .py script, firing = firing event (in this scenario, its pressing button)
can u help?
<@&831776746206265384>
@sleek shale using "gay" as an insult is not acceptable
please make sure you read and understand our #code-of-conduct if you want to remain here
man
tell me you're not after lgbt
tell me you have b4lls
!ban 1330643318471790617
:incoming_envelope: :ok_hand: applied ban to @sleek shale permanently.
Ban much deserved, it's not like anyone was gonna help him here after that. 😂
Thank you, much appreciated
also i think you'd make better use of an enum instead of a list of choices
What a primitive individual
There's too much hate in this world. If you want to be special, spread some positivity
hello
can anyone help me make a discord bot
like this but without the worrds
when i click the green one i want it to make a support ticket
Looks like an average scam bot (the image)
oh well i want like a ticket bot
like this https://tickettool.xyz/
yea but i want my own i wanna make my own stuff
sounds against discord dev tos
did you already write some code?
Don't think you'd be able to make a decent ticket bot (looking at your last post)
Edit: https://discord.com/channels/267624335836053506/1339372157553213492
no im bad with discord bots
not at all, go read the terms for API usages
read the monetization part.
can you link?
any paid offerings must be done via their monetization feature
not some random paypal transaction (only)
i mean some of the biggest bots have their own websited that ppl pay on so
i linked a ticketbot
well, that example is against the rules of this server
which rule?
website != discord
can't say "!rule paid"
!rule tos
5. Do not provide or request help on projects that may violate terms of service, or that may be deemed inappropriate, malicious, or illegal.
still not using discord monetization feature even tho you said they have to use the feature
take mee6 as an example
user i think we have dms still can u dm me and help me ima go make some pizza rq
ill be back soon
mee6 and dyno are bad examples either way, they're somehow excluded from any restrictions of discord
okay, dm me
wouldn't be the first time
i know of a bot that still does this and isnt being banned
its mainly for donations
All Applications attempting to monetize through our services must abide by Discord’s Monetization Terms and Monetization Policy.
https://support-dev.discord.com/hc/en-us/articles/8563934450327-Discord-Developer-Policy
Enjoy the reading ^^
ty
For what its worth this seems to only apply to bots (which is true in this case)
Beginning on October 7, 2024, in regions where Discord supports monetization through its Premium Apps products, all developers who offer paid features or capabilities for their Application will be required to:
(i) support purchase of such features or capabilities through Discord’s Premium Apps products; and,
(ii) offer such features or capabilities at prices on Discord that are no higher than the prices at which they are offered through other payment options.
Only paid features or capabilities that are offerings supported by Discord’s Premium Apps products will be subject to these requirements.
Currently I think only US, EU, and UK support these features. Also I do not know if discord supports exactly what this user needs. Discord left the door open with that last term. I think you could easily set up a system that is unsupported just to get around the requirement.
With that said, it is more than likely that the user is breaking TOS with whatever thing they are selling.
TL;DR - Give discord some of yer money :D
Not just some, more like half
i mean, thems the rules. Pay up or else
Bruh, I'm so bored... Does anyone have any project?
Make a project that generates projects to do
speaking of projects to do, i'm making a fishing minigame for my discord bot. would it be better to have a single coins value or the common pocket and bank values instead? i'm leaning more towards coins, simply because it's not really an economy bot: it's moreso fishing at this point in time, but what do you think?
a simple coins is enough
the bank feature was made in the first place to implement a rob command too
alright thank you 👍
i'll make stealing fish instead
break into someone's showcase, steal their rare items
SLI, when you finally make that game, can others also play it?
21% ain't quite half
i don't see why they couldn't 
what does 'sli' mean?
Slowly Losing It
how's the progress on the fishing minigame going, axo
horrible
only today did i actually commit to it
mm, atleast you started
i have some good ideas tho
it's gonna be good 
(then flop)
(then get left in a drawer)
the cycle of life
I'd love to try it out once its done
motivation 🎉
Sounds interesting 🤔
i know, right? and seeing the "carelessness" with the UI on bots like virtual fisher made me realise the bar of entry is low enough you can walk over it
like what even is this??
honestly there might just be too much content cuz i got an asset pack (cozy fishing if you're wondering) and it had probably 300+ assets, all for £3.50
Good deal 
and my dumbass was still hesitant to buy it
it was originally just meant to be a hobby project (evident by its code-related commands like /docs and /source) but i finally decided to just get the asset pack and make something out of it so here we are
Your names abbreviation
Axo it is, deal.
Me too, small games arr better than those biggies who eat too much data and i am a cheapskate
time to monitor absolutely everything about people using my bot then 
usage times, used commands, profiles, names - everything
data farmer
would recommend prometheus and grafana for collecting metrics and visualizing them respectively
whats prometheus?
this seems like a lot of effort than just, well, writing it myself
whats the benefit of this?
probably not much for a small project
but its fun to make visualizations and a good thing to learn
maybe the visualisations would be good, but i'd rather just write my own
sure
could get enough of working code in an hour that would've been spent setting up and integrating what you sent me
and it's cool how I DON'T CARE !
i don't remember you being a part of this conversation
sometimes my internet just flips and dosen't let me send messages
okay? keep your negativity to yourself
bro prolly made the bot
should make the UI at least somewhat more appealing and usable then
NOBODY ASKED FOR YOUR OPINION
nobody asked for yours either. what do you make of that?
i will shut up
POV : you right now
but i'm just finaly in a server when i can roast pepole
You can't
such good roasts damn
these people crying right now for real
did they change rules ?
crying him a river right now
then when i'm done, i'll make another one
wow
sorry for making you cry
1. Follow the Python Discord Code of Conduct.
It was always there
are you new ?
Don't feed into the rage-bait
Nah idc about them








