#discord-bots
1 messages Β· Page 983 of 1
If I wanna get big with my bot, is it still a good option?
Yes definitely
I would say yes, an API would be best, using aiohttp you won't be blocking your bot with long running processes
I would say not, raspberry pi doesn't scale
If you want scalability go for one of the big providers, they handle scaling for you
But I cant pay for hosting so yea
Nothing is stopping you from combining them lol
Yeah you can set up a raspberry pi mega farm, but if you're going commercial getting yourself a web provider is the best way to go
and do you know any good clear tutorials for newbie on that topic?
Scalability?
Ah it's really not that hard, the hardest part would be setting up an account and purchasing the host
lmao
Hello, someone please help me with this.
is it hard because you loose money in the process xD
Pick a provider first, it's much easier to find guides once you have a concrete plan
okay
Probably. Good hosts don't come for free
If you're planning on going big you have to be wiling to put down an initial investment and earn it back in the future
and I agree lol that's why a lot of content about free host services annoy me when i try to find a solution
Same here, I don't like free hosts. Probably because I spend too much on hosting π
I think it you're trying to make a profit coding big Discord bots you're kinda in the wrong industry.
Well considering it's for artists on discord to share information about their ocs and that a lot of them are willing to try maybe I could set up a funding system to help hosting the bot
Yeah, there are already a bunch of established ones. But there's always room for innovation
Sure, but I'd say while your bot is still small to medium sized, keep it on a raspberry pi or similar
Ho okay
It shouldn't be very hard to migrate from there to a provider when you're at that point
Where would the limit?
I would say once you have to start sharding
Size wise
My prediction is with the rise of the message content intent we'll see less large bots making money and instead Bot-as-a-service things that host a bot for your server specifically with 1 click for a fee
Sharding
~500 guilds ish?
Hooo
might be pushing it
start sharding at about 1500 guilds
Yeah I still have time for that haha
More like 2000
What is sharding ;(
Yeah, not sure if sharding is where you should migrate
but a RPi won't really handle that
honestly my benchmark for getting off a rpi would be when you're big enough for being verified
so ~100 servers
That's 100 servers yeah
That sounds reasonable
It means a stable user base so support
Yup, for sure. Donations are an option from there
π
Inb4 big bots become data brokers
tfw you have a bot in 12k servers and zero donations 

Time to do a google π
google doesn't sell your data because that would be a strategic disadvantage
since they also do the advertising if they give your data to anyone they're making more competition for themselves
I need to see how much is a RP
I got my RPI 4 for ~120
Dollars?
Right
Well, they had an agreement or something with facebook to lockdown the Ad competiton π³
Not long. I wanted to use some of AWS's other services (S3, R53 domain, and a few others) so I was like, might as well keep everything in one spot with EC2
Can please someone help me? π
And I was trying to get a little bit of machine learning in the bot as well, and aws provides that so it was another reason for me to switch
Ho nice!
someone could mp me i need help for a discord bot that does tiktok shares pls ?
wym "does tiktok shares"
? i am french sorry i don't understand wyw lol
Well then I need to see what Raspberry I can get, how to set it up and then boom how to host my discord bot on it
Thanks for the time you dedicated me @sick birch
No problem. Feel free to ping me if you have any further questions or concerns

@sick birch help pls
I'm not quite understanding
in any case, I get a mutation. Even when if is triggered
why, when an IF EXCEPTION is triggered, the command continues to work anyway!?
Not sure if that's possible without wrapping the whole thing in a try/catch block
I understand everything thanks)
hey there it's me again π After a quick look some stuff came up as very weirdly or poorly explained. First of all, I assume that a raspberry pi on its own doesn't do anything, I would need SD cards for storage, but maybe cable to connect to my pc ? to access its terminal? What's scare me the most is my lack of knowledge on that, since I've never did anything like that before, and 3 years of theoretical physics don't help you at all. I just feel like any tutorials online assume you already know everything about RP and doesn't explain the fundamental to you. It's really a mystery lmao
Yeah, we're in the same boat on that one. I feel like it's not all that well explained. The one I got by cana kit came with everything I needed, a cable to hook up to my monitor (micro HDMI to HDMI), a charging cable (USB-C), an extra optional cooling fan for the RPI (in case you are mining crypto on it haha), which is all you really need
you only have to hook it up to your monitor and attach a kb/mouse to it during initial setup
After that you can disconnect it and leave it headless (without a monitor, keyboard, or mouse attached, only the power cable) and access it via your regular computer
#bot-commands please
Cana kit noted
Okay so mouse and keyboard but what if I don't have a keyboard lol. I only have a laptop...
I have that a lot
Check your type in your dictionary
Well
You might be either :
Looking for a key that doesn't exist
Access an element using an int when it's a str
To add a key in a dictionary you just have to do dic['key name']=value
Also
In open account in the first if statement
Maybe the type isn't the correct one
Not sure because I don't know the definition of your function
Also it seems your using json as a database
I'd suggest using sqlite3 for database, you will have less issues and more flexibility
Check also this message
I just changed my database system to sql from json. Much better. Faster. And looks way better.
I use sqlite 3 but I am sure there are other options
Also where is the error occurring. You should have the line where it appears
?
Read this for database
sqlite3, postgre, deta, redis, mongo
The if statement is kinda weird. Basically you're doing a if false return false thingy.
Maybe you should do a try / except instead
Well Robin it's way passed my bed time. I hope you don't mind if tomorrow I just dm you or ping you here about RP and Co. Thanks again for your help!
Yup. Feel free to ping me if you'd like tomorrow
I am experiencing this issue,
when I host my bot it has some downtimes
after those downtimes the data will restart
how do I fix this
help please
what host are you using
heroku
thats why
what is 'data'? a json file?
you mean SQL..
but will SQL still run into the same problem?
what is that
An online database is a database accessible from a local network or the Internet, as opposed to one that is stored locally on an individual computer or its attached storage. Online databases are hosted on websites.
It was my first python project and its fine
..
Cool
I bought my from CanaKit, and it comes with its own case and cooling fan. So, I recommend buying from there
Can u show me a pic :>
of my RP?
Ye
Yeah hold on
class Select(discord.ui.Select):
def __init__(self):
options=[
discord.SelectOption(label="Owner Commands",emoji="π",description="Display all owner commands!"),
discord.SelectOption(label="Miscellaneous Commands",emoji="π",description="Displays all miscellaneous commands!"),
discord.SelectOption(label="Verified Commands", emoji="β
", description="Displays commands available only to verified users!")
]
super().__init__(placeholder="Select an option",max_values=1,min_values=1,options=options)
async def callback(self, interaction: discord.Interaction):
try:
if self.values[0] == "Owner Commands":
conn = await aiosqlite.connect("./sql/ghostbot.db")
c = await conn.cursor()
await c.execute ('CREATE TABLE IF NOT EXISTS owner_ids(oid INT, oname TEXT')
await c.execute('SELECT oid FROM owner_ids WHERE (oid = ?)', (interaction.user.id,))
owner = await c.fetchone()
if owner:
embed = discord.Embed(title='Owner Commands!', color=0x000000)
embed.add_field(name='Modules', value=
"""`load` - Loads a module. \n
`reload` - Reloads a module.\n
`unload` - Unloads a module. \n
`verify` - Verify a user and add them to the db""")
await interaction.response.send_message(embed=embed)
return
if not owner:
embed = discord.Embed(title=' Error!', description='You are not an owner skid.', color=0xff0000)
await interaction.response.send_message(embed=embed, ephemeral=True)
return
await conn.commit()
await c.close()
await conn.cose()
this gives interaction failed
Ive tried a few things
Pasting large amounts of code
If your code is too long to fit in a codeblock in discord, you can paste your code here:
https://paste.pythondiscord.com/
After pasting your code, save it by clicking the floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.
error in console is incomplete input
if it was too long to fit in a codeblock otherwise I was going to but will do next time ig
Back
what do i need to type to send a file through the discord bot
its a ui based help menu but I only want certain users seeing for example owner commands, ittl check the db if an id is there
im using aiosqlite
Oh
on discord.py ive tried to find how to upload a file as the discord bot and send it but not sure what i need to put
class discord.File(fp, filename=None, *, spoiler=..., description=None)```
A parameter object used for [`abc.Messageable.send()`](https://discordpy.readthedocs.io/en/master/api.html#discord.abc.Messageable.send "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/master/api.html#discord.abc.Messageable.send "discord.abc.Messageable.send")s.
Goto stack if u dont understand for example
np
!e None.mention
@cloud dawn :x: Your eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "<string>", line 1, in <module>
003 | AttributeError: 'NoneType' object has no attribute 'mention'
Assuming role[1] is an id, you're using get
It is
get gets items from the cache and if the item isn't cached it returns None
I set it to an INTEGER in the database
Okay, well how can I fix it
I want it to mention in the command
from discord import Role, Guild
from discord.ext.commands import Context
async def getch_role(self, guild: Guild, role_id: int) -> Role | None:
if not isinstance(role_id, int) or len(str(role_id)) != 21:
print("role_id is invalid")
return None
if not isinstance(guild, Guild):
print("No guild object has been passed")
return None
return guild.get_role(role_id) or await guild.fetch_role(role_id)
Those aren't unnecessary imports
I do not understand what you coded
Just replace it with nextcord.
Bro if you dont understand this module stuff
This is an async function that if the role id that is passed is not in cache, fetch it from the api.
Ah
is the vcokltfre discord.py tutorial broken?
i was using it last night and now im getting error 404s now
So I cannot pull the role ID from the cache or the guild roles?
We don't need these kind of comments here 
Somehow your id isn't cached so you have to fetch it, I use the function above so I never have to deal with the cache ever again.
Inside the same command?
No, I created the role
Then set it to a level reward role
Manually?
Yea
Well this should fix your issue but you can also just always use fetch.
Could I convert that into my code now and be fine?
Yeah it's a standalone function
π
Alec stopped developing it.
async def getch_role(self, guild: Guild, role_id: int) -> None | Role:
``` you forgot `None`
is it off his website now too?
True
i take it that it's just the nextcord and disnake ones now?
He is using a different design now but it's not finished. I'd stop to seeing as now people are going back to discord.py
ah gotcha
Wouldn't it always return Role?
Because fetch_role raises an error if the ID is invalid
unfortunate lol, i was using it last night and it was a really solid tutorial
So therefor, logically it would always return a Role or raise an error
he returned None
Oh right
Raises another question on why you'd return None instead of raising an error there
I was thinking about that but then he'd also need to handle those errors.
Is getch_role right in this?
or fetch_role?
What do you mean?
is getch_role even right?
Yes since it's first trying to get it then if that fails fetch it hence getch
Most likely since you just made the role.
How long do I have to wait?
For it to be in the cache?
Depends on what you do it doesn't get cached after x amount of time.
Not certain on what functions it updates the cached but most likely on something like .roles etc
I also do not know how to add your code into mine

!d nextcord.Guild.fetch_roles
await fetch_roles()```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Retrieves all [`Role`](https://nextcord.readthedocs.io/en/latest/api.html#nextcord.Role "nextcord.Role") that the guild has.
Note
This method is an API call. For general usage, consider [`roles`](https://nextcord.readthedocs.io/en/latest/api.html#nextcord.Guild.roles "nextcord.Guild.roles") instead.
New in version 1.3.
Well
I used an old role to see if that changed anything but ig not
What's a command to recognize q particular ping to a name
member.mentioned_in(message) will return a bool indicating if a member was mentioned in a give message
Hi, I am trying to put a local image into an embed but it doesn't work, it keeps posting the image then post the embed below py embed = Embed(color=random_color) file = File(f"{path_to_ring_images}{lowerRingName}.png") embed.set_image(url=f"attachment://{lowerRingName}.png") await ctx.send(file=file, embed=embed)
I made my level system successfully!
You could do a thumbnail too, just a suggestion
oh yeah i made it in a thumbnail but it didn't work and i saw some examples where they were using it in set_image so i said might try and see where the issue is
anyway i fixed it
Nice
Thanks
Using a database was h*ll
Now I have to integrate this all into 1 of my bots
I always make the code in a test bot, then use it into other bots
Yeah. That's why you use an ORM to make that much nicer
I used aiosqlite
well done!
Was hard to do
After 2 months of doing python actually getting half-decent
I am trying to do school at the same time π
same, im failing
Csπ
ah nice
i take normal cuz i like doing easy stuff
I try to be a good person
I am great at math
And found my professional career 2 months ago
nice
i hate mathπ‘
algebra π³
lmaooo
LMAO
i took the sample code from the link ill attach: https://discordpy.readthedocs.io/en/latest/quickstart.html
but i get an error on line six saying that
Traceback (most recent call last):
File "E:\PycharmProjects\BigBotMan\main.py", line 6, in <module>
intents.message_content = True
AttributeError: 'Intents' object has no attribute 'message_content'
anyone know how to fix that? the message intent is enabled in my dev portal
if you're using dpy 1.7.3 you dont need to write .message_content since that intent didnt exist when 1.7 was released
im on 2.0
oh then you just need to update to the lastest version of 2.0
i believe im on it? is there a way to check
im new to python lol
im using windows and pycharm
2.0 is technically the master branch of the discord.py repository on github, which is still receiving continuous updates to it
ive got Rapptz's redo of discord.py
so you have to install the latest commit to get .message_content
e.g. pip install git+https://github.com/Rapptz/discord.py
yeah weird i was given that link and installed it that way
hm can you do pip show discord.py and send back the version that it outputs
Name: discord.py
Version: 2.0.0a4109+gb476757
Summary: A Python wrapper for the Discord API
Home-page: https://github.com/Rapptz/discord.py
Author: Rapptz
Author-email:
License: MIT
Location: e:\pycharmprojects\bigbotman\venv\lib\site-packages
Requires: aiohttp
Required-by:
PS E:\PycharmProjects\BigBotMan>
!paste if its a lot you can save it on this
Pasting large amounts of code
If your code is too long to fit in a codeblock in discord, you can paste your code here:
https://paste.pythondiscord.com/
After pasting your code, save it by clicking the floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.
also can you share the result of pip list? it might be that you have a library conflicting with dpy
Package Version
aiohttp 3.8.1
aiosignal 1.2.0
async-timeout 4.0.2
attrs 21.4.0
charset-normalizer 2.0.12
discord.py 2.0.0a4109+gb476757
frozenlist 1.3.0
idna 3.3
multidict 6.0.2
pip 21.3.1
python-dotenv 0.20.0
setuptools 60.2.0
wheel 0.37.1
yarl 1.7.2
did i do that right
yup that looks fine
how are you running the code, in your terminal or through pycharm?
you wouldnt happen to have multiple versions of python 3 installed do you?
py -0 to check
Installed Pythons found by C:\Windows\py.exe Launcher for Windows
(venv) *
-3.10-64
ah, you have a virtual environment in your project
should i remove it? idk waht im doing lol
ive got like one year of comp sci classes lol, so im pretty new to all this
the venv allows you to use packages for a specific project without actually installing them globally to your python interpreter, which is why you need to be careful about which one your terminal and pycharm is using
ohhhh
yeah i should trash that then right? im good with installing stuff to my interpreter i think
you could go without the virtual environment, but it would clutter your global site packages which is less convenient to work with, especially if you need a package that has conflicting dependencies with other packages
the terminal in pycharm automatically activates the virtual environment for you, so you can just run the same pip install command inside there and it will install to your venv
should i have clicked on the project folder or venv when i installed it?
uhh im not sure where you're referring to
so when i use the pip install commands, teh location is the folder of the project, not the VENV folder
oh do you mean the file explorer tab on the side of pycharm? you dont need to worry about the folder you have selected there
oh awesome
just know that when it says Python 3.10 (BigBotMan) in the bottom right corner of pycharm rather than just Python 3.10, its telling you that its using a virtual environment, and opening the Terminal in pycharm will activate the virtual environment for you
speaking of which, i believe your virtual environment has an old version of discord.py installed whereas your global interpreter is more recently updated
totally possible
i had installed an old one, given the new one to install, deleted the old hopefully the right way, and then installed the proper
I see a lot of the same ppl here
is there a way to clear the old installs ive done perhaps?
as in removing the packages from your global interpreter?
there's a helper package that can uninstall a package and its dependencies for you:
pip install python3-pip-autoremove https://github.com/enjoysoftware/pip3-autoremove
usage: pip3-autoremove <package>
if you want to do it manually you can look through pip list and run pip uninstall discord.py aiohttp aiosignal <and more...>
could my pip version be an issue, it says its outdated
it wont affect your dpy installation but you're free to update it
How to enable required permissions in slash command ? I use @commands.has_permissions but it doesn't work (nextcord)
so i created a new project, reran the install for discord.py, ran it with "py -3 main.py" and i got the same issue
and you did all your commands in the pycharm terminal?
yup, pycharm terminal
it looks like nextcord has a separate has_permissions() decorator for slash commands
https://docs.nextcord.dev/en/stable/ext/application_checks/index.html#nextcord.ext.application_checks.has_permissions
oh i just realized -3 overrides the virtual environment and uses your system interpreter instead
Thank you
yep
np, ill be off to sleep now
goodnight!
where i can get application_checks?
hi
Thnx will try using it
how to make a command without a prefix
Are you familiar with subclassing?
not really
I know how to make slash and prefix
but not subclassing
What's a command to recognize a particular ping to a name
@jagged brook It's a Python concept, you can watch this video if you want to learn about it https://www.youtube.com/watch?v=RSl87lqOXDE
Alternatively, you can just pick your own source for info.
from discord.ext import commands
class MyBot(commands.Bot):
async def get_prefix(self, message):
# You should return an empty string or a list with the empty string
return ''
bot = MyBot(...)
@bot.command(...)
async def foo(ctx, ...): ...
...
You can now call the foo command by just sending "foo" in text channel
In this Python Object-Oriented Tutorial, we will be learning about inheritance and how to create subclasses. Inheritance allows us to inherit attributes and methods from a parent class. This is useful because we can create subclasses and get all of the functionality of our parents class, and have the ability to overwrite or add completely new fu...
but I already have a prefix
bot = commands.Bot(command_prefix='>', help_command=None)```
from discord.ext import commands
async def get_prefix(bot, message):
# You should return an empty string or a list with the empty string
return ''
bot = commands.Bot(command_prefix=get_prefix)
@bot.command(...)
async def foo(ctx, ...): ...
...
You can return a list of strings
Each string will be a valid prefix
like an example?
This solution also works (I should have suggested this initially instead)
You can also pass a list of strings as command_prefix
@slate swan any suggestions? Using member , there's an error saying I didn't declare it . What do I declare it as?
Hold on I just bloated up my answer like crazy because I assumed things you didn't mention. Just do this:
bot = commands.Bot(command_prefix=['', '>'])
k
' ' has a blank?
Blank prefix
But it makes every command invokable without a prefix
oh thanks
I know a tweak, dw
Which is why the dynamic function approach may be better but go ahead
Any help with mine too pls
@bot.command()
async def >help
genius
What do you mean by that? Can you show an example of the code you're trying to produce?
Not a great solution. You also can't do that because syntax. You should pass '>help' into the command decorator and name the command function something else for it to work.
somehow it works
If lucky is mentioned
Send msg yo
Return
Something like dat
@bot.command(name='>help')
async def embed(ctx):
embed=discord.Embed(title="COMMANDS",description="**>dice:**\n`it is a virtual dice!`\n\n**>poll:**\n`create a poll to decide problems!`\n\n**>suggest**\n`suggest something that you want added to the server!`\n\n**>pat(user)**\n`show your love by patting a user!<3`\n\n**>rps (input)**\n`well play rock paper scissors cuz why not?`", color=0x384dd6)
embed.set_thumbnail(url=a)
embed.set_author(name="Lapis", icon_url=a)
await ctx.send(embed=embed)```
It shouldn't work.
Sorry for not going on details typing on a tab is frustrating
Oh yeah this will
it would work as prefix>help
yeah
@client.event
async def on_message(message):
user = ... # Get the user
if user.mentioned_in(message):
... # Do what you need to do here
!d discord.Client.get_user
get_user(id, /)```
Returns a user with the given ID.
Changed in version 2.0: `id` parameter is now positional-only.
sidenote: user.mentioned_in is true even for everyone and role mentions
So the name for member on python is user
you can just py if user in message.mentions: ...
no, discord.User and discord.Member are different things
!d discord.User
class discord.User```
Represents a Discord user.
x == y Checks if two users are equal.
x != y Checks if two users are not equal.
hash(x) Return the userβs hash.
str(x) Returns the userβs name with discriminator.
!d discord.Member
class discord.Member```
Represents a Discord member to a [`Guild`](https://discordpy.readthedocs.io/en/master/api.html#discord.Guild "discord.Guild").
This implements a lot of the functionality of [`User`](https://discordpy.readthedocs.io/en/master/api.html#discord.User "discord.User").
x == y Checks if two members are equal. Note that this works with [`User`](https://discordpy.readthedocs.io/en/master/api.html#discord.User "discord.User") instances too.
x != y Checks if two members are not equal. Note that this works with [`User`](https://discordpy.readthedocs.io/en/master/api.html#discord.User "discord.User") instances too.
hash(x) Returns the memberβs hash.
str(x) Returns the memberβs name with the discriminator.
a member is just a user that's bound to a guild (they have guild-specific properties like nickname and roles)
Member is a subclass of User, yes
Thnx will try rn
Not really a subclass
code for a simple command that is like >hello, replies with hello!, I want an example because I forgot
It's designed to behave like it is a subclass but that's not true.
!d discord.ext.commands.Context.send
await send(content=None, *, tts=False, embed=None, embeds=None, file=None, files=None, stickers=None, delete_after=None, nonce=None, allowed_mentions=None, reference=None, ...)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Sends a message to the destination with the content given.
This works similarly to [`send()`](https://discordpy.readthedocs.io/en/master/api.html#discord.abc.Messageable.send "discord.abc.Messageable.send") for non-interaction contexts.
For interaction based contexts this does one of the following...
thanks
Call send()
@bot.command(name="cya")
async def cya(ctx):
await.ctx.send("cya too! Have a nice day <3")``` this aint working
wait nevermind
found the mistake
What to do for a particular user
Enter ID instead of the word user?
user is not a word..
discord.user
You can just check whether either
f'<@{user_id}>'
``` or
```py
f'<@!{user_id}>'
Is in message.content
a user object, as timtoy already told
Try this approach and see if it works for you.
Ok
how to add gaps to command like how are you and it replies with I am good!
!d discord.Client.wait_for
wait_for(event, /, *, check=None, timeout=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Waits for a WebSocket event to be dispatched.
This could be used to wait for a user to reply to a message, or to react to a message, or to edit a message in a self-contained way.
The `timeout` parameter is passed onto [`asyncio.wait_for()`](https://docs.python.org/3/library/asyncio-task.html#asyncio.wait_for "(in Python v3.10)"). By default, it does not timeout. Note that this does propagate the [`asyncio.TimeoutError`](https://docs.python.org/3/library/asyncio-exceptions.html#asyncio.TimeoutError "(in Python v3.10)") for you in case of timeout and is provided for ease of use.
In case the event returns multiple arguments, a [`tuple`](https://docs.python.org/3/library/stdtypes.html#tuple "(in Python v3.10)") containing those arguments is returned instead. Please check the [documentation](https://discordpy.readthedocs.io/en/master/api.html#discord-api-events) for a list of events and their parameters.
This function returns the **first event that meets the requirements**...
oh yea my bad, discord.py doesnt subclass it
Oh wait, I interpreted that differently
i confused it with hikari's Member object
yes
It used to I think, but they optimized it for memory
apparently its a subclass of abc.Messageable and _UserTag ( which is basically just a class with an id attribute )
is it even possible to ?
.wait_for() is useful for maintaining a "conversation" with your bot. If you want to implement commands like "how are you", it would break due to how discord.py parses message content. You should use an event listener for the on_message event like so
@bot.listen()
async def on_message(message):
... # Do some sanity checking here if you want to (eg, make sure message.author is not a bot)
if message.content === 'how are you':
...
_UserTag is used in some isinstance() checks elsewhere I think
Did do it wrong?......
k thanks
Yes, remove the {} and the f string declaration
π
I tried it before
use "<@!id>"
It gave an error
Idk it said syntaxes error pointing at @
...
Syntax
It didn't give error this time lemme verify now
Fyi @pulsar thunder, the mention will sometimes be this if the member being mentioned is nicked.
No reply now
The difference is the exclamation point ||that Discord felt was a good design choice||
you can check both the ! and without ! strings using any statement
!d any
any(iterable)```
Return `True` if any element of the *iterable* is true. If the iterable is empty, return `False`. Equivalent to:
```py
def any(iterable):
for element in iterable:
if element:
return True
return False
What a pointless builtin
This is how it is rn
Sure will check
Are you receiving message content at all?
For other commands yes
if you are using 2.0, you would need message_content intents
It replies hello roasts people just doesn't reply for pings
you want it to reply when someone mentions the bot right?
On replit I think it uses 3.6 or something
Discord.py 3.6 lol
Mentions me
replit uses python 3.8 and im talking about your discord.py v
you can just ```py
user = bot/client.get_user(your_id)
if user in message.mentions:
your stuff```
User global or local as variable I wanna try local
all of the code goes inside your on_message function
The your ID part do I add the <@>?
If not it didn't work
This was the error I got previously as well
Just put the int without the <@>
What the error now?
Show code
The whole function
There a bunch of stuff in between
Um then just send the relavent part
it takes an integer
do you have member intents?
Don't think so idk what those are
!intentw
Using intents in discord.py
Intents are a feature of Discord that tells the gateway exactly which events to send your bot. By default, discord.py has all intents enabled, except for the Members and Presences intents, which are needed for events such as on_member and to get members' statuses.
To enable one of these intents, you need to first go to the Discord developer portal, then to the bot page of your bot's application. Scroll down to the Privileged Gateway Intents section, then enable the intents that you need.
Next, in your bot you need to set the intents you want to connect with in the bot's constructor using the intents keyword argument, like this:
from discord import Intents
from discord.ext import commands
intents = Intents.default()
intents.members = True
bot = commands.Bot(command_prefix="!", intents=intents)
For more info about using intents, see the discord.py docs on intents, and for general information about them, see the Discord developer documentation on intents.
Ohh
its an error few secs ago now it isnt anymore
alright
its an error again
what should i change it to
I dont use prefixes on my bot should I still enter the line and make a prefix and keep it blank?
the cooldown_retry_after
???
wdym
Irrelevant
how to make verification system by reaction role
make those channel needing some specific role such as member
and make a role in reaction role call member as well
when they get the role those selected channel will open i guess
do you have example?
so...
as i know your bot need to get info about user changes like avatar change or join/leave
Hello, How to detected when user join a specified voice channel send messages?
Where i put it?
idk
Im copying your code
ok
Can u tell me all your imports?
@bot.event
async def on_command_error(ctx, error):
if isinstance(error, commands.CommandOnCooldown):
seccd = round(error.cooldown_retry_after(ctx))
mincd = 0
hrcd = 0
rseccd = 0
rmincd = 0
if seccd > 59:
rseccd = int(seccd % 60)
mincd = int((seccd - rseccd) / 60)
if mincd > 59:
rmincd = int(mincd % 60)
hrcd = int((mincd - rmincd) / 60)
else:
rseccd = seccd
await ctx.send(f'''
Dont spam :/
Try again in another **{hrcd}h {rmincd}m {rseccd}s**
''')
else:
raise error
error.cooldown_retry_after(ctx) is not correct
@swift crane Can u tell me your imports??
yeh
import asyncio
import random
import discord
from discord.embeds import Embed
from discord.ext import commands
from discord.ext.commands import has_permissions
from discord.ext.commands import has_permissions, CheckFailure
from discord.ext.commands import has_permissions, MissingPermissions
import os
import time
import typing
from time import sleep
import datetime
from discord.ext import commands, tasks
from discord.errors import Forbidden
from discord.ext.commands.bot import Bot
from discord.ext import tasks
bruh
Uf
importing stuff from all over the world
LiterLiterally
I'm trying to make a new Help command on a Test bot and why does it trigger the except statement if i react to the message? It should normally only send it if the help command was used in a server and the authors DM's are closed.
I know i should not use the bade expect on it but idc how to tell it, if the dms are closed. If that makes sense?
Ho really? And how does that work?
@slate swan try catching explicitly discord.Forbidden and discord.HTTPException
Or do something like
except Exception as e:
raise e```
for debug purposes
And yeah could you show try block contents
If anyone would like to help me with testing a bot DM please, I really need testers
It just shows this "Command raised an exception: Forbidden: 403 Forbidden (error code: 50003): Cannot execute action on a DM channel"
But only if i react
Alright send me try block
its very long tho
About 173 Lines
Me
@supple thorn alright I will dm you the info
@bot.command(name ='start')
@commands.cooldown(1, 1, commands.BucketType.user)
async def start(ctx):
userid = str(ctx.author.id)
for items in Item:
if items != None:
pass
else:
db[f'{userid}{items}'] = 0
for stats in Stats:
if stats != None:
pass
else:
if stats == stats.xp:
db[f'{userid}{stats}'] = 0
elif stats == stats.hp:
db[f'{userid}{stats}'] = 100
else:
db[f'{userid}{stats}'] = 0
await ctx.channel.send('done :D')
What is Item?
from replit import db
class Item():
def __init__(self, ctx):
self.userid = str(ctx.author.id)
self.pogchop = db[self.userid + 'pogchop']
self.cooked_pogchop = db[self.userid + 'cooked_pogchop']
self.beef = db[self.userid + 'beef']
self.steak = db[self.userid + 'steak']
self.wool = db[self.userid + 'wool']
self.map_scrap = db[self.userid + 'map_scrap']
self.map = db[self.userid + 'map']
self.wither_skull = db[self.userid + 'wither_skull']
self.blaze_rod = db[self.userid + 'blaze_rod']
self.blaze_powder = db[self.userid + 'blaze_powder']
self.ender_pearl = db[self.userid + 'ender_pearl']
self.eye_of_ender = db[self.userid + 'eye_of_ender']
self.cobble = db[self.userid + 'cobble']
self.coal = db[self.userid + 'coal']
self.iron_ingot = db[self.userid + 'iron_ingot']
self.diamond = db[self.userid + 'diamond']
self.gold_ingot = db[self.userid + 'gold_ingot']
self.netherite_scrap = db[self.userid + 'netherite_scrap']
self.netherite_ingot = db[self.userid + 'netherite_ingot']
self.redstone = db[self.userid + 'redstone']
self.soul_sand = db[self.userid + 'soul_sand']
self.wood = db[self.userid + 'wood']
self.bed = db[self.userid + 'bed']
self.bedrock = db[self.userid + 'bedrock']
self.bedrock_trophy = db[self.userid + 'bedrock_trophy']
self.pog_champ = db[self.userid + 'pog_champ']
Oh replit db
Fixed it i just had to remove "await message.remove_reaction(reaction, user)" because my bot had no permissions for it
I thought it was an actual db
Item is a class
u cant iterate a class?
You can't iterate a class
ok
As the error tells you, no
Why doesn't my bot reply to the word "hi"?
Are you using discord.py?
Yes
What version?
Latest
2.0 or 1.7.3?
So 2.0?
Ok
I know
That's how i know there's a terminal option when you click those bars
Did you load the cog in?
Yes
Do you have intents on?
I'm dumb
Lmao
You're doing message.send which should be message.channel.send
Weird
Next time actually paste the code here
Sending images makes it harder for us
await ctx.send()
No
It needs a string in it
You're using message
Im talking about the other code
on_message doesn't have context it has message
πΏ
Reply to it
Wait ima copy and paste the code
async def on_message(self, message):
if "hi" in message.content:
await message.send("Woah!")```
message.channel.send
Oh
Also
I am so dumb
!code
Here's how to format Python code on Discord:
```py
print('Hello world!')
```
These are backticks, not quotes. Check this out if you can't find the backtick key.
Does the event even trigger?
??
Hello sparky
hey skev π
Let's go
12%
Looks similiar when smol
Mans either died or he fixed it on his own
alr ill create giveaway cmd today
Good luck and show me code just because i'm curious on how you would do it
The lack of documentation about Raspberry Pi and discord bot is insane
One of the reasons i didn't use Raspberry Pis to host my bot
lmao
The other reason is because i couldn't find any raspberry pis
wait how?
π
The shopping online things here don't sell alot of raspberry pis and if i find one they're immediately sold out
bruh
well
raspberry can be a great solution to start hosting a bot
you pay one time for the whole thing and it can support a lot of servers
That is if i can find anyone selling one
ok.
I don't understand why a single raspberry would cost 180β¬ and then there is a whole kit that costs less than that
this is for 154β¬
ho wait nevermind, it's 130β¬ alone lol
its Whiteflame362#6637
not mine
I just want a raspberry pi
it's the canakit!
π
yeah it doesn't work alone lol
convence ur parents
you need extra stuff otherwise you can't do anything
get full mark in a EXAM
lmao
online?
Online classes?
online exam?
Yeah we're still online here where i'm living
wow
armors = {
'helmet',
'chestplate',
'leggings',
'boots',
'sword'
}
why is it shuffling it
@bot.command(aliases = ['i', 'inv'])
@commands.cooldown(1, 1, commands.BucketType.user)
async def inventory(ctx):
my_emote = My_emote(ctx)
stats = Stats(ctx)
res4 = ''
for armor in armors:
value = db[stats.userid + armor]
if value == 0:
res4 += f'No {armor}\n'
if value == 1:
my_emote = discord.utils.get(bot.emojis, name = f'pog_{armor}')
res4 += f'{my_emote}pog_{armor}\n'
if value == 2:
my_emote = discord.utils.get(bot.emojis, name = f'iron_{armor}')
res4 += f'{my_emote}iron_{armor}\n'
if value == 3:
my_emote = discord.utils.get(bot.emojis, name = f'diamond_{armor}')
res4 += f'{my_emote}diamond_{armor}\n'
if value == 4:
my_emote = discord.utils.get(bot.emojis, name = f'meaty_wooly_diamond_{armor}')
res4 += f'{my_emote}meaty_wooly_diamond_{armor}\n'
if value == 5:
my_emote = discord.utils.get(bot.emojis, name = f'shiny_meaty_wooly_diamond_{armor}')
res4 += f'{my_emote}shiny_meaty_wooly_diamond_{armor}\n'
if value == 6:
my_emote = discord.utils.get(bot.emojis, name = f'shiny_meaty_wooly_netherite_{armor}')
res4 += f'{my_emote}shiny_meaty_wooly_netherite_{armor}\n'
if value == 7:
my_emote = discord.utils.get(bot.emojis, name = f'more_shiny_meaty_wooly_netherite_{armor}')
res4 += f'{my_emote}more_shiny_meaty_wooly_netherite_{armor}\n'
if value == 69:
res4 += ':beefy_sword: beefy_sword'
if res4 == '':
res4 = 'None'
embed = discord.Embed(
color = discord.Color.blue())
embed.add_field(name = 'Items',value = res1, inline=True)
embed.add_field(name = 'Misc',value = res2, inline=True)
embed.add_field(name = 'Illegal',value= res3, inline=True)
embed.add_field(name = 'Armors & Tools',value= res4, inline=True)
embed.set_author(name= f"{ctx.author.display_name}'s inventory", icon_url = ctx.author.avatar_url)
await ctx.send(embed=embed)
the armor & tools part
Why does it ignore the reaction β? Going forwards works fine but back doesnt
I tried putting it from elif to just if but didnt do anything
should be
remove that whitespaces inside the string with the emoji
!e print("βοΈ" == "βοΈ ")
@slate swan :white_check_mark: Your eval job has completed with return code 0.
False
cause this.
On going forwards its the same tho and it works
may i see that?
My god is so hard to do something like this:
params = [("name1", "value1", True), ("name2", "value2" False) ... ]
for name, value, inline in params:
embed.add_field(name=name, value=value, inline=inline)
whitespaces in strings always cause issue
Because i pasted them in using Win+. and then selected it
you can remove that space
ok
help
armors = {
'helmet',
'chestplate',
'leggings',
'boots',
'sword'
}
@bot.command(aliases = ['i', 'inv'])
@commands.cooldown(1, 1, commands.BucketType.user)
async def inventory(ctx):
my_emote = My_emote(ctx)
stats = Stats(ctx)
res4 = ''
for armor in armors:
value = db[stats.userid + armor]
if value == 0:
res4 += f'No {armor}\n'
if value == 1:
my_emote = discord.utils.get(bot.emojis, name = f'pog_{armor}')
res4 += f'{my_emote}pog_{armor}\n'
if value == 2:
my_emote = discord.utils.get(bot.emojis, name = f'iron_{armor}')
res4 += f'{my_emote}iron_{armor}\n'
if value == 3:
my_emote = discord.utils.get(bot.emojis, name = f'diamond_{armor}')
res4 += f'{my_emote}diamond_{armor}\n'
if value == 4:
my_emote = discord.utils.get(bot.emojis, name = f'meaty_wooly_diamond_{armor}')
res4 += f'{my_emote}meaty_wooly_diamond_{armor}\n'
if value == 5:
my_emote = discord.utils.get(bot.emojis, name = f'shiny_meaty_wooly_diamond_{armor}')
res4 += f'{my_emote}shiny_meaty_wooly_diamond_{armor}\n'
if value == 6:
my_emote = discord.utils.get(bot.emojis, name = f'shiny_meaty_wooly_netherite_{armor}')
res4 += f'{my_emote}shiny_meaty_wooly_netherite_{armor}\n'
if value == 7:
my_emote = discord.utils.get(bot.emojis, name = f'more_shiny_meaty_wooly_netherite_{armor}')
res4 += f'{my_emote}more_shiny_meaty_wooly_netherite_{armor}\n'
if value == 69:
res4 += ':beefy_sword: beefy_sword'
if res4 == '':
res4 = 'None'
embed = discord.Embed(
color = discord.Color.blue())
embed.add_field(name = 'Items',value = res1, inline=True)
embed.add_field(name = 'Misc',value = res2, inline=True)
embed.add_field(name = 'Illegal',value= res3, inline=True)
embed.add_field(name = 'Armors & Tools',value= res4, inline=True)
embed.set_author(name= f"{ctx.author.display_name}'s inventory", icon_url = ctx.author.avatar_url)
await ctx.send(embed=embed)
expected output:
the output i got:
ignore the number
@slate swan :white_check_mark: Your eval job has completed with return code 0.
001 | a
002 | b
replace py armors = { 'helmet', 'chestplate', 'leggings', 'boots', 'sword' } with py armors = [ 'helmet', 'chestplate', 'leggings', 'boots', 'sword' ]
and youre all good, its happening because when you iterate thru a set it gets sorted alphabetically
okok
oooo
thankss
its working
how to create slash command error handling decorator? (nextcord)
great
@client.event
async def on_message_edit(message):
await message.reply('https://c.tenor.com/4H1-3Vbq0rEAAAAM/edited-discord.gif', mention_author = False)
Doesn't work. Help pls.
!d nextcord.ext.application_checks | https://docs.nextcord.dev/en/stable/ext/application_checks/index.html#nextcord.ext.application_checks.on_application_command_error
or are you looking for the event?
on_message_edit takes 2 arguments, before and after
!d discord.on_message_edit
discord.on_message_edit(before, after)```
Called when a [`Message`](https://discordpy.readthedocs.io/en/master/api.html#discord.Message "discord.Message") receives an update event. If the message is not found in the internal message cache, then these events will not be called. Messages might not be in cache if the message is too old or the client is participating in high traffic guilds.
If this occurs increase the [`max_messages`](https://discordpy.readthedocs.io/en/master/api.html#discord.Client "discord.Client") parameter or use the [`on_raw_message_edit()`](https://discordpy.readthedocs.io/en/master/api.html#discord.on_raw_message_edit "discord.on_raw_message_edit") event instead.
The following non-exhaustive cases trigger this event...
before and after are both discord.Message objects
!d discord.on_raw_message_edit
discord.on_raw_message_edit(payload)```
Called when a message is edited. Unlike [`on_message_edit()`](https://discordpy.readthedocs.io/en/master/api.html#discord.on_message_edit "discord.on_message_edit"), this is called regardless of the state of the internal message cache.
If the message is found in the message cache, it can be accessed via [`RawMessageUpdateEvent.cached_message`](https://discordpy.readthedocs.io/en/master/api.html#discord.RawMessageUpdateEvent.cached_message "discord.RawMessageUpdateEvent.cached_message"). The cached message represents the message before it has been edited. For example, if the content of a message is modified and triggers the [`on_raw_message_edit()`](https://discordpy.readthedocs.io/en/master/api.html#discord.on_raw_message_edit "discord.on_raw_message_edit") coroutine, the [`RawMessageUpdateEvent.cached_message`](https://discordpy.readthedocs.io/en/master/api.html#discord.RawMessageUpdateEvent.cached_message "discord.RawMessageUpdateEvent.cached_message") will return a [`Message`](https://discordpy.readthedocs.io/en/master/api.html#discord.Message "discord.Message") object that represents the message before the content was modified.
Due to the inherently raw nature of this event, the data parameter coincides with the raw data given by the [gateway](https://discord.com/developers/docs/topics/gateway#message-update).
How do I reply then?
That worked, thx
how do i do the no such command error thing
u wanna try?
Don't use JSON
Heyy. Is there a way to track my last uptime?
Put it in a database
No bot uptime
oo
Hmm
its in the console
How?
Cause my command/on_start thing us automatic
anyone wanna try my bot?
Every time my bot restarts. It sends a message to a channel
Simple Error Handling for ext.commands - discord.py - error_handler.py
last?
Yes
It's a bot for quotes said by me or my friends. We use it only on this private server. So it's hosted on replit.
Use a basic error handler for commands.CommandNotFound
!d discord.ext.commands.CommandNotFound
exception discord.ext.commands.CommandNotFound(message=None, *args)```
Exception raised when a command is attempted to be invoked but no command under that name is found.
This is not raised for invalid subcommands, rather just the initial main command that is attempted to be invoked.
This inherits from [`CommandError`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.CommandError "discord.ext.commands.CommandError").
Make your bot use machine learning to spot out the toxic people in chat and ban them
bruh
yes
BAN THEM
ok so this
okok
yay
and im doing
how do i get channel
<Message id=96555163989 channel=<TextChannel id=951833542174 name='gangs' position=10 nsfw=False news=False category_id=9518560850512 default_auto_archive_duration=1440> type=<MessageType.default: 0> author=<Member id=779990652825537 name='Sparky' discriminator='3940' bot=False nick='Spark' guild=<Guild id=926128696580186 name='[N' shard_id=0 chunked=True member_count=33>> flags=<MessageFlags value=0>> ΛβΒ·-ΝΝΝΛβπ₯βΛmoderat
or_only
msg return this
thanks <3
btw news?
None
ok
@bot.command(name ='start')
@commands.cooldown(1, 1, commands.BucketType.user)
async def start(ctx):
userid = str(ctx.author.id)
for items in itemss['mobdrop']:
if items != None:
pass
else:
db[f'{userid}{items}'] = 0
for items in itemss['misc']:
if items != None:
pass
else:
db[f'{userid}{items}'] = 0
for items in itemss['illegal']:
if items != None:
pass
else:
db[f'{userid}{items}'] = 0
for armor in armors:
if armor != None:
pass
else:
db[f'{userid}{armor}'] = 0
for stats in statss:
if stats != None:
pass
else:
if stats == 'xp':
db[f'{userid}{stats}'] = 0
elif stats == 'hp':
db[f'{userid}{stats}'] = 100
else:
db[f'{userid}{stats}'] = 0
await ctx.send('done :D')
this is not working
can u help me ;-;
Hm
Kayya really liking anime avatars nowπ
I'm talking about your avatar
make sense tho
That's why i said anime avatars
Wait how did you get scp is anime from what i said
Why are there so many if statements
Odd innit
and why are the indents so bad
Define "not working"
Hey there, would there be a way when you run a command that asks you for a color, have a color picker button, like a slider or something like that, and then the bot knows to what that correspond in hex ?
Like ui slider?
any better way of doing this
for channel in ctx.guild.text_channels:
if channel.mention == msg.content:
await ctx.send("Exists")
break
Nah not possible i don't think
msg = await self.bot.wait_for('message',check=check,timeout=30)
me?
Fix the indents
ye
uh
No
No
Nah mate it's not possible

Discord hasn't implemented sliders yet
.
A dropdown?
?
if any((channel for channel in ctx.guild.text_channels if channel.name == message.content))```
Whats the use case
That would mean you have to implement every single colour
Maybe RGB values instead
That could work
channel.name is not comparing with message.content
yes
when i print msg.content it print #channel
just change it to channel.mention, everything else remains same
That's alot of colours
oh ye its a for loop
:D thanks
colours in?
They wanted the whole colour spectrum from what I read
You know that colour picker
Where you can pick any colour
No
Colour wheel
Damn
!color
and how do i send msg in that channel ??
no error but didnt create those variable also
??
do you have jishaku?
also, why're you using commands.command outside of a cog?
Hello, i want to automate a desktop application. i want it to open -> then open something -> type something -> and store what ever it will printout. I need to know what to use to get this result. Thanks.
Is this related to a discord bot?
no but it is close
kinda
can you do the same with discord bot tho?
@boreal ravine
Then ask somewhere else
Maybe
what is the "desktop application"?
At this point i want to open a bluestack (if you know) then there an application and insert there some text and store the output
This is definitely not a question for this channel
stackoverflow
You can try opening a help channel
okay
hey, i cant use slash commands
import:
from discord_slash import SlashCommand, SlashContext```
code:
```python
slash = SlashCommand(bot, sync_commands=True) # set slash command
@slash.slash(name="hello", description="Say hello to the bot")
async def hello(ctx: SlashContext):
await ctx.send("Hello!")```
any ideas what the problem is?
Use dpy or its fork for god's sake
help
@bot.command(name ='start')
@commands.cooldown(1, 1, commands.BucketType.user)
async def start(ctx):
userid = str(ctx.author.id)
for items in itemss['mobdrop']:
if items != None:
pass
else:
db[f'{userid}{items}'] = 0
for items in itemss['misc']:
if items != None:
pass
else:
db[f'{userid}{items}'] = 0
for items in itemss['illegal']:
if items != None:
pass
else:
db[f'{userid}{items}'] = 0
for armor in armors:
if armor != None:
pass
else:
db[f'{userid}{armor}'] = 0
for stats in statss:
if stats != None:
pass
else:
if stats == 'xp':
db[f'{userid}{stats}'] = 0
elif stats == 'hp':
db[f'{userid}{stats}'] = 100
else:
db[f'{userid}{stats}'] = 0
await ctx.send('done :D')
no error
but its not doing thing
Why does my bot think the left arrow does the same as the right one? The left one should reset that embed
do you have an on_command_error?
@bot.event
async def on_command_error(ctx, error):
if isinstance(error, commands.CommandOnCooldown):
seccd = round(error.cooldown.get_retry_after())
mincd = 0
hrcd = 0
rseccd = 0
rmincd = 0
if seccd > 59:
rseccd = int(seccd % 60)
mincd = int((seccd - rseccd) / 60)
if mincd > 59:
rmincd = int(mincd % 60)
hrcd = int((mincd - rmincd) / 60)
else:
rseccd = seccd
await ctx.send(f'''
Dont spam :/
Try again in another **{hrcd}h {rmincd}m {rseccd}s**
''')
elif isinstance(error, commands.CommandNotFound):
await ctx.send(f'**{ctx.author.name}**, this command doesnt exist, check your spellling maybe??')
else:
raise error
remove it momentarily and try doing the command again
okok
i asked one of my friend to do rpm start
then a random command
the key doesn't exist
and the variable that should have been created in rpm start is not created
rpm start is in deep shit trouble
u have any idea how to fix it?
Why are you using repl
stop asking this
u are like the 69k th pepo asking
Repl will time you out
its been half a year and i didnt even get time out once
You willl one day
LOL
itemss = {
'mobdrop':[
'pogchop',
'cooked_pogchop',
'beef',
'steak',
'wool',
'map_scrap',
'map',
'wither_skull',
'blaze_rod',
'blaze_powder',
'ender_pearl',
'eye_of_ender'
],
'misc':[
'cobble',
'coal',
'iron_ingot',
'diamond',
'gold_ingot',
'netherite_scrap',
'netherite_ingot',
'redstone',
'soul_sand',
'wood',
'bed'
],
'illegal':[
'bedrock',
'bedrock_trophy',
'pog_champ'
]
}
armors = [
'helmet',
'chestplate',
'leggings',
'boots',
'sword'
]
statss = [
'hp',
'level',
'highestArea',
'atk',
'defend',
'xp',
'area'
]
@bot.command(name ='start')
@commands.cooldown(1, 1, commands.BucketType.user)
async def start(ctx):
userid = str(ctx.author.id)
for items in itemss['mobdrop']:
if items != None:
pass
else:
db[f'{userid}{items}'] = 0
for items in itemss['misc']:
if items != None:
pass
else:
db[f'{userid}{items}'] = 0
for items in itemss['illegal']:
if items != None:
pass
else:
db[f'{userid}{items}'] = 0
for armor in armors:
if armor != None:
pass
else:
db[f'{userid}{armor}'] = 0
for stats in statss:
if stats != None:
pass
else:
if stats == 'xp':
db[f'{userid}{stats}'] = 0
elif stats == 'hp':
db[f'{userid}{stats}'] = 100
else:
db[f'{userid}{stats}'] = 0
await ctx.send('done :D')
```no error
but its not doing thing
I'd like help please 
how to find the msg with a specific reaction?
but i dont think there is
oh
then can u make it so that the bot deletes its own msg after a reaction is added to that msg?
sure
how?
yh
ask sarth
alr
sarth pro
is it possible for me to choose an option from a dropdown box on a website through python?
i won ur minesweeper
noice
im adding a feature to my discord bot that needs to choose an option on a dropdown box of a site
u all can help me?
itemss = {
'mobdrop':[
'pogchop',
'cooked_pogchop',
'beef',
'steak',
'wool',
'map_scrap',
'map',
'wither_skull',
'blaze_rod',
'blaze_powder',
'ender_pearl',
'eye_of_ender'
],
'misc':[
'cobble',
'coal',
'iron_ingot',
'diamond',
'gold_ingot',
'netherite_scrap',
'netherite_ingot',
'redstone',
'soul_sand',
'wood',
'bed'
],
'illegal':[
'bedrock',
'bedrock_trophy',
'pog_champ'
]
}
armors = [
'helmet',
'chestplate',
'leggings',
'boots',
'sword'
]
statss = [
'hp',
'level',
'highestArea',
'atk',
'defend',
'xp',
'area'
]
@bot.command(name ='start')
@commands.cooldown(1, 1, commands.BucketType.user)
async def start(ctx):
userid = str(ctx.author.id)
for items in itemss['mobdrop']:
if items != None:
pass
else:
db[f'{userid}{items}'] = 0
for items in itemss['misc']:
if items != None:
pass
else:
db[f'{userid}{items}'] = 0
for items in itemss['illegal']:
if items != None:
pass
else:
db[f'{userid}{items}'] = 0
for armor in armors:
if armor != None:
pass
else:
db[f'{userid}{armor}'] = 0
for stats in statss:
if stats != None:
pass
else:
if stats == 'xp':
db[f'{userid}{stats}'] = 0
elif stats == 'hp':
db[f'{userid}{stats}'] = 100
else:
db[f'{userid}{stats}'] = 0
await ctx.send('done :D')
```no error
but its not doing thing
!paste
Pasting large amounts of code
If your code is too long to fit in a codeblock in discord, you can paste your code here:
https://paste.pythondiscord.com/
After pasting your code, save it by clicking the floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.
got a bizarre bug that happened that deleted all player data
gg
in my logs it clearly shows that they pressed a button that was custom_id "cli" plus some other stuff
the literal only way to delete all your data like they did is to press a button with the custom_id "con"
like it deleted every single record they had
are you venting here or what
even if the cache mechanism had a huge failure it wouldn't do that
Shot in the dark, SQL injection?
i'm just thinking out loud because im stuck af rn
they're a play tester, i was watching them and they wouldn't know how to do that
like all i can think is somehow for several hours of play, not a single save was made AND the cache mechanism failed but that's impossible
call ur stepbro to help
especially since it seems to be saving fine after the reset
shows their cache was at 5 mins the whole time so nothing changed with that, not like they were removed and added again

what would i need to put for basically an else statement but with a bot command
so i want that if they dont put any of my created commands or spell it wrong
that a message is sent
idk about the best way but i always did something like this when i used message content commands @grave summit
async def on_message(message):
if message.content == "yourcommand":
elif message.content == "another command":
else:
await message.channel.send("did not understand")```
bru help
ok cool thank you
Can you show line 68 of functions.py?
Ah
oh wait
Can you paste the full traceback?
