#discord-bots
1 messages · Page 902 of 1
God
so what bothers me is
no im not a god
mhm, the maximum is 5x5
Jesus Christ

personally i use a select menu for the user to input coordinates
godbless my mind
Or you make an embed with black and white squares and buttons to move something
But that's gonna take hours to select ur pion, and move it
what buttons
↙️
wth is in that select menu
@slate swan is ur issue fixed?
maybe modal with text input would help in this?
a1 all the way to o10
when there's >25 cells its broken up to two inputs, X then Y
Doesn't discord have a chess activity you can play in VCs
they do
uncool
you should make 5D chess
so what can you make in a bot
definitely bro
Huh??
moving time, sound, gravity and dunno shit in chess cuz fun
How do I tie a guild object to a Group?py Failed to Load Extension cogs.users ExtensionFailed: Extension 'cogs.users' raised an error: AttributeError: 'Group' object has no attribute 'guilds'in this code```py
class user(commands.Cog):
def init(self, bot):
self.bot = bot
User = app_commands.Group(name="users", description="Check User stuff.")
@User.command()
@User.guilds(guild=discord.Object(id=default_guild))
@User.describe(user="The discord user to get information for.")
def setup(bot):
bot.add_cog(user(bot))```
i believe those two decorators should come from app_commands. i.e. @app_commands.guilds(123, 456)
okay thanks, might take another look at dannys gist
No I’ll fix tomorrow
im more currious if this would work as a hypothetical, but would it be possible to make a discord bot that controls over discord bots?
i was thinking of a music bot that will control several other music bots for multi use
ik it would be easier to just have multiple music bots work separately, but i think the idea sounds intresting
Wouldn’t work
Most bots don’t respond to other bots
i was thinking of a backend thing tho, like if i use a command on a bot the bought would use the token of another bot to do smth
bro what
That sounds overly complex but probably doable
me wonder if idea possible cuz brain randomly think of
you mean a botnet?
which the admin is a bot?
it is possible most likely, but requires a large server. seems like a botnet
bro what? 💀
you dont know whats a botnet?
until you get ratelimited LMAO
a botnet is a server controlling several infected computers
this is a discord bot that would control other discord bots via the code
generally a botnet is a malicious concept used in DDoS attacks
those are nothing alike 💀
how bro
^
yea, a network of infected computers used to control them via a backdoor
im saying a discord bot that uses more then 1 token to control other bots
the only way those are simular is the use of "bots"
its not a botnet, if it doesnt use other computers 💀
where do you run bots in?
bro im losing braincells rn 💀
one computer that runs a script using multiple tokens is what im talking about
a botnet is a computer that uses several different computers to preform a task
not the same
that essentially means you are asking bot devs to give you their token? that will never happen..
one account can make more then one token 💀
no shit
i mean you can but you shouldnt
but if you intend for this to reach across discord, taht would be the case
unless its just for your own bots.
then where tf do you get the idea of asking other devs for their tokens from?
i make 1 bot that is the main one, and like 3 other bots that would be used by the main ones
Per Python Discord's Rule 5, we are unable to assist with questions related to youtube-dl, pytube, or other YouTube video downloaders, as their usage violates YouTube's Terms of Service.
For reference, this usage is covered by the following clauses in YouTube's TOS, as of 2021-03-17:
The following restrictions apply to your use of the Service. You are not allowed to:
1. access, reproduce, download, distribute, transmit, broadcast, display, sell, license, alter, modify or otherwise use any part of the Service or any Content except: (a) as specifically permitted by the Service; (b) with prior written permission from YouTube and, if applicable, the respective rights holders; or (c) as permitted by applicable law;
3. access the Service using any automated means (such as robots, botnets or scrapers) except: (a) in the case of public search engines, in accordance with YouTube’s robots.txt file; (b) with YouTube’s prior written permission; or (c) as permitted by applicable law;
9. use the Service to view or listen to Content other than for personal, non-commercial use (for example, you may not publicly screen videos or stream music from the Service)
@slender perch
thats what i thought, i was just wondering if the idea was possible at all
we said it was earlier
yeah just make a subclass of the bot class and make a run method and just run all the bots in a main file but you shoudlnt
yea, and also said that it was like a botnet (it wasnt) and said something about using other devs bot tokens (had nothing to do with it)
yea, just more as a hypothetical ig
was just tryna understand what you wanted. and I wasn't the first to bring botnet up
i said this before all of that
and i was replying to the other guy in that topic
its like, it seems like a intresting idea of a way to use a music discord bot for several instances at the same time, but prolly just having different bots would work better
!ytdl - be carefult with music bots
Per Python Discord's Rule 5, we are unable to assist with questions related to youtube-dl, pytube, or other YouTube video downloaders, as their usage violates YouTube's Terms of Service.
For reference, this usage is covered by the following clauses in YouTube's TOS, as of 2021-03-17:
The following restrictions apply to your use of the Service. You are not allowed to:
1. access, reproduce, download, distribute, transmit, broadcast, display, sell, license, alter, modify or otherwise use any part of the Service or any Content except: (a) as specifically permitted by the Service; (b) with prior written permission from YouTube and, if applicable, the respective rights holders; or (c) as permitted by applicable law;
3. access the Service using any automated means (such as robots, botnets or scrapers) except: (a) in the case of public search engines, in accordance with YouTube’s robots.txt file; (b) with YouTube’s prior written permission; or (c) as permitted by applicable law;
9. use the Service to view or listen to Content other than for personal, non-commercial use (for example, you may not publicly screen videos or stream music from the Service)
Of course it's possible, just have a pool of tokens and you could easily orchestrate bots
And then create a front end with your main bot, or something 🤷♂️
name the main bot Orchestrator
It's a bit complex if you haven't any devops experience, but it's interesting
And make its pfp a blue heptagon 
yea my idea for it is, it would check if each token is in a call or not, if not then it would use that bot for the command, the way to control the bot is dependent on who is in what vc with what bot and so on so on
its hard to explain in text, i would be better off making some sort of diagram explaining the proccess
Yeah, I'd like to see that
^
also another thing, ive been thinking about making a discord bot that changes the nickname of anyone who'se name starts with a "!" into
"poop eater"
idk how im gonna do that but i think it would be funny
epic
thats like a simple command tbh
check if name starts with !
i believe there is an attribute for member name
if there is a function to change it, boom everyone is now poop eater
im trying to make it where it says "2 weeks" i want it to be a custom message just like the reason, but if i were to do {message} twice it would put the same message
i want 2 different messages in 1 embed
idk how to explain it well
oo i figures out how
i am trying to send a list but this is what it sends
nvm yall
just use on message commands you would have a bot that invokes a command and make all bots check only authors that are the bots and you do the rest
it looks like you sent the actual object
can I see the code please?
i am using readlines() to send from a text file
it shows up normally in the txt file
but when i send it does that
and use a try except to check if the tokens are right since if the token is wrong it would raise an error just handle it but theirs still a down side to it
async def polls(ctx, *, question : str = None):
if question == None:
return await ctx.send("What would you like to ask the people")
else:
with open("checkmars.txt", "r") as f:
a = f.readlines()
with open("xsss.txt", "r") as r:
b = r.readlines()
a.clear()
quest = discord.Embed(title=None)
quest.add_field(name=question, value=f'Asked by {ctx.author.mention}')
a = await ctx.send(embed=quest)
await a.add_reaction("✅")
await a.add_reaction("❌")
await ctx.send(a)
await ctx.send(b)```
it looks like you have overwritten the a variable with the value of await ctx.send(embed=quest)
oh
have i used the same variable too much
it works
i used the same variable too much
How do I unload and reload all extensions with Disnake?
I can load all of them but not reload all of them
Just loop through the list and DM them
async def your_command(..., *members: tuple[discord.Member]):
#loop through the list
Not sure if it will work
Water do you know if I can unload and reload all my commands with Disnake without a huge overcomplicated loop?
I can load all them with load_extensions but idk how to with a loop
What is said loop?
Just a simple for loop
I haven't had to use the loops to load commands tho
Like, idk what to loop
@final iron what is the loop? I don't know what to actually put into the loop
Also how do I make it so the only person who can see and call the command is me / the bot owner
d.py 2.0 giving me this errorpy Failed to Load Extension cogs.users ExtensionFailed: Extension 'cogs.users' raised an error: TypeError: CommandTree.add_command() missing 1 required positional argument: 'command'on this code```py
@app_commands.context_menu(name="User Info")
async def userinfo(interaction: Interaction, member: Member):
await self.userinfo(interaction, member)
def setup(bot):
bot.add_cog(user(bot))
app_commands.CommandTree.add_command(userinfo)```
why my database not setup ConnectionRefusedError: [WinError 1225] The remote computer refused the network connection showing this error
no
guys how do I trigger the CommandNotFound Error, I did sum Error handling, then the error just never happens again
print('hm')
bot.db = await asyncpg.create_pool(database="prefix",user='postgres',password="")
print('huh')
print('Connection succesfull')
bot.loop.run_until_complete(create_db_pool())```
youll just pass one kwarg with a list which needs to be a list type it must be *members
so it will be an unknown amount of positional arguments
await ctx.send("**Invalid command. Try using** `help` **to figure out commands!**")```
Ik that’s what I did but the error never triggers again
*members will convert to a tuple. Not list.
i dunno get it 😅😅
Have you got raise error in your code?
pls help
Wdym by that
Have you got, in your code, raise error anywhere?
no
Put that in
raise just raises an error
Yeah, and it's possible that there's another error
it then stops the execution of the program
ye I did sum other error handling
The error itself stops the command...
he said program
An error doesn't crash a program
it would stop the control flow
if u use on_command_error it dunno stop consol
Are you trying to say it’s blocking?
on_command_error handles errors in the command and stops the execution of said command when an error is met. It itself wont stop the bot instance
You said program Bruh
An error in general stops the execution of the command
Cuz I only know how to raise Exception
ik that
😅
you can raise any error and call its initializer
!e
raise TypeError('wrong type')
@slim ibex :x: Your eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "<string>", line 1, in <module>
003 | TypeError: wrong type
didn't see context before, but should have been common sense it was a bot 🗿
*, my_arg will pack all of the arguments in to my_arg though
the token is correct and even i changed it though it is saying improper token has been passed
why my database dunno connect with my codes
How do I make commands not exist to anyone other than me?
you need to store the CommandTree instance as a bot var in order to access it inside extensions
owner only
How do I do that?
!d discord.ext.commands.is_owner
@discord.ext.commands.is_owner()```
A [`check()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.check "discord.ext.commands.check") that checks if the person invoking this command is the owner of the bot.
This is powered by [`Bot.is_owner()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.Bot.is_owner "discord.ext.commands.Bot.is_owner").
This check raises a special exception, [`NotOwner`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.NotOwner "discord.ext.commands.NotOwner") that is derived from [`CheckFailure`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.CheckFailure "discord.ext.commands.CheckFailure").
Ah ok, th
So the converter wouldn't work?
Ty
Does that make the command just not exist to anyone else?
The CommandNotFound still doesn’t get triggered
you can raise the NotOwner exception if someone that isn't the bot owner tries to invoke the command
@slate swan is this correct?
!d discord.ext.commands.NotOwner
exception discord.ext.commands.NotOwner(message=None, *args)```
Exception raised when the message author is not the owner of the bot.
This inherits from [`CheckFailure`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.CheckFailure "discord.ext.commands.CheckFailure")
no the converter does work. The consume rest behavior isn’t normal for the asterisk operator. It converts everything after the argument before it into a single string that will be fed into the argument after it.
Ah
HEY
okimii
no
How can I host my bot 24/7 for free
FREE?
youre waiting for multiple arguments which you expect all of them being tuples?
uhhh
its extremely cheap though
So how can i?
you wont get reliable free hosting
Self host it
explain
*args returns a tuple yes of all given arguments but no you call them all separately
that works but you gotta take into account internet bandwidth, etc'
If you have an old phone lying around, you can host a bot from that
How much would that be tho?
I don't have one
Ok, use a pc
Wait what
and you need memory and storage to host it
Run the file in the background
Explain
No it doesn’t
So I need to keep the pc 24/7 online
Yeah, like moai said, there's no real free reliable hosts
It hints *members as a tuple of discord.Member
tuple[tuple[discord.Member]] is what you were thinking of
yeah oops
I have heard that there are a few discord servers where they host
so yeah @final iron you were correct that was my fault
They're not all too reliable
@final iron either way there’s no point to having the type hint there unless you just want it. Dpy has no conversions for built-in iterables in its signature parsing.
Unless commands.Greedy does that
yeah
I just have it for intellisense
If you want arguments to be consumed into an iterable. Using *args is what you need. It will give you a tuple of whatever.
doing this might get your bot caught in discord's anti-spam filter, from what ive heard
if you can, you should prefer pinging them over mass dming
or **kwargs if you want a dict/named args
for role_id in teamss:
for member in ctx.guild.members:
if ctx.guild.get_role(role_id) in member.roles and FO in member.roles:
people.append(f"{member.mention} - {ctx.guild.get_role(role_id).mention}")
lst.append(role_id)
for roles in ctx.guild.roles:
if roles in team:
if roles.id not in lst:
checked.append(roles.mention)
embed2=discord.Embed(title="Unclaimed Franchises", description="\n".join(checked) or "None", color=0x2f3136)
``` why does this always input None on the embed
how would that pan out tho
When checking if something is equal to one thing or another, you might think that this is possible:
if favorite_fruit == 'grapefruit' or 'lemon':
print("That's a weird favorite fruit to have.")
While this makes sense in English, it may not behave the way you would expect. In Python, you should have complete instructions on both sides of the logical operator.
So, if you want to check if something is equal to one thing or another, there are two common ways:
# Like this...
if favorite_fruit == 'grapefruit' or favorite_fruit == 'lemon':
print("That's a weird favorite fruit to have.")
# ...or like this.
if favorite_fruit in ('grapefruit', 'lemon'):
print("That's a weird favorite fruit to have.")
ok
yeah that returns a dict what keys im not sure
I don’t think that’s meant to be used for command arguments
probably not
well generally people do things like reason as a kwarg
still same thing (my bad for the ping)
that probably has a default key of text or something
i sent that because you are using or incorrectly
But but but
buts!
then there’s no actual purpose then for **kwargs in any command arguments
but i always see like:
async def ban(member: discord.Member, *, reason=None):
await member.ban(reason=reason)
i worded what I said above really bad sorry. it isn't really **kwargs
that triggers dpys consume rest behavior for the asterisk
mhmm
I’m honestly so confused.
same
probably when calling the function dpy gets all the text after it and then sets it to the kwarg idk
ye
like a positional argument
For the MissingRequiredArguments error, how do I make it trigger when a command has two required arguments?
Example:
If you have a command called train with two arguments: amount and what. The MissingRequiredArgument error will be triggered if only the amount argument is not specified, but won’t if the what argument is not specified
it depends on how you invoke the function
So is there a way or no?
im honestly confused on how you explained it
it stll triggers when you have more than 1 argument missing
Mb my explanation was rlly bad, I meant how do I make it trigger if the first argument is not specified, but the second one is
it already triggers though
I tested it, it doesn’t for me at least
I would like to make a bot in which I can speak through my microphone and a Discord bot plays it in vc. I'm not too sure how to get started, any help?
are you intermediate at python ?
not sure what i am, but im not a beginner
ic, then maybe something like speachrecognition to lavalink to bot would help
¯_(ツ)_/¯
i can say its not going to be easy
yep, worth a shot though
true afterall that's how we learn 👍
thanks for the help
@slate swan if you want it to play the same audio then maybe you can ditch speech recognition part
its live time, so i would speak through my microphone then it sends it somewhere for the discord bot to play the audio
yes if you don't want it to play in a computer like sound you can skip speechrecognition part
instead of that you should look for how to record and create opus source for audio
that's not how it works ig
a second
Just put the ids in a list and loop through them
Put the id in a list
And loop through them
@client.command()
async def test(user: discord.User):
for id in ("id","id","id"):
user = client.get_user(id)
msg = "GOSHA STAFF, the server releasing 3/18/2022, be on alert for nukes"
await user.send(msg)
The msg can just be a string it doesn't need parenthesis
oh yeah i forgot to remove em i just copied rest of the code from 07a
is there a way to read embeds from bots?
a missing colon in the for loop, and you can always use list comprehension to make things faster
ic
I think so iirc you could do that with jishaku
!d discord.Message.embeds
A list of embeds the message has.
is it a library?
Returns a list of discord.Embed objects
async def on_raw_reaction_add(payload):
if str(payload.emoji) == "\U00002705":
with open("checkmars.txt", "w") as b:
b.write(str(payload.member) + "\n")
if str(payload.emoji) == "\U0000274c":
with open("xsss.txt", "w") as f:
f.write(str(payload.member) + "\n")
@bot.command(name="poll")
async def polls(ctx, *, question : str = None):
if question == None:
return await ctx.send("What would you like to ask the people")
else:
with open("checkmars.txt", "r") as f:
p = f.readlines()
with open("xsss.txt", "r") as r:
b = r.readlines()
quest = discord.Embed(title=None)
quest.add_field(name=question, value=f'Asked by {ctx.author.mention}')
a = await ctx.send(embed=quest)
await a.add_reaction("✅")
await a.add_reaction("❌")
await asyncio.sleep(10)
await ctx.send(p)
await ctx.send(b)```how can i make it so that it adds the user on a new line
Or just use what the officer gave you
user is None
!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.
thats what i did
One of the ids is maybe wrong
You obviously didn't
bro what
i try to just activate it after a user call the command, but seems like it stucks somewhere. it looks like this..
@bot.event
async def on_message(message):
# Main Trigger
if message.content == f'{prefix}gib':
# Get User's nick -> styc#9662 (styc)
caster = message.author.name
await message.channel.send('Please give your inv list')
# Get embed
embeds = message.embeds
# Double check for user reply
def check(m):
return message.author == m.author
user_reply = await bot.wait_for('message', timeout=15.0, check=check)
if '.inv' not in user_reply.content or '.inventory' in user_reply.content:
embeds = message.embeds
for embed in embeds:
print(embed.to_dict())```
Do you have member intents on
!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.
Yes
👀
@bot.event
async def on_raw_reaction_add(payload):
if str(payload.emoji) == "\U00002705":
with open("checkmars.txt", "w") as b:
b.write(str(payload.member) + "\n")
if str(payload.emoji) == "\U0000274c":
with open("xsss.txt", "w") as f:
f.write(str(payload.member) + "\n")
@bot.command(name="poll")
async def polls(ctx, *, question : str = None):
if question == None:
return await ctx.send("What would you like to ask the people")
else:
with open("checkmars.txt", "r") as f:
p = f.readlines()
with open("xsss.txt", "r") as r:
b = r.readlines()
quest = discord.Embed(title=None)
quest.add_field(name=question, value=f'Asked by {ctx.author.mention}')
a = await ctx.send(embed=quest)
await a.add_reaction("✅")
await a.add_reaction("❌")
await asyncio.sleep(10)
await ctx.send(p)
await ctx.send(b)```now can someone help?
message = "very uwu message"
c = [client.get_user(id).send(message) for id in [id1, id2, id3]]```
should work ig
Won't work
nvm
get_user not member
oh wait my bad
Also would that work? The return True part?
exactly what i was looking for
great thanks
Can you give me the ids
uh it should work, idk, am too dizzy to open laptop and try
yeah
huh
Uhhh, I'mma just go away
The send
uhh stop hunter
both get_user and send need await ?
only send
then wouldn't that be a problem
since any get method doesnt make any api call
no please wait you don't have to put it in that they are both different
noo, its alright user what you have rn
Just use a simple for loop at this point of confusion 
alright doesn't await client.get_user(id).send() will makes sense something like
await client.get_user(id)
await user.send()
awaiting that in the list conp shouldnt be a problem though
....
Me do be sleepy 
sleep?
Tbh the thing I hate about dpy is that, discord returns the IDs in the form of strings, so why they don't allow strings 
Woke up like, idk, 2 hours ago. Gonna go down
they are ibthryer
i intgers*
integers*
rip, everybody's in their own world nowadays
help pls
whats with that thusky emoji 
{
"id": "80351110224678912",
"username": "Nelly",
"discriminator": "1337",
"avatar": "8342729096ea3675442027381ff50dfe",
"verified": true,
"email": "nelly@discord.com",
"flags": 64,
"banner": "06c16474723fe537c283b8efa61a30c8",
"accent_color": 16711680,
"premium_type": 1,
"public_flags": 64
}
Discord API Payload. The ID is a str
Idk, was just bored with the eval command
Reacts with a different emoji when eval fails
what is your question
i want it to print the user on a new line
i put \n
Add the new line character before, not after
how would I make an eval command?
no comments
Better
!d exec is what I have used
exec(object[, globals[, locals]])```
This function supports dynamic execution of Python code. *object* must be either a string or a code object. If it is a string, the string is parsed as a suite of Python statements which is then executed (unless a syntax error occurs). [1](https://docs.python.org/3/library/functions.html#id2) If it is a code object, it is simply executed. In all cases, the code that’s executed is expected to be valid as file input (see the section [File input](https://docs.python.org/3/reference/toplevel_components.html#file-input) in the Reference Manual). Be aware that the [`nonlocal`](https://docs.python.org/3/reference/simple_stmts.html#nonlocal), [`yield`](https://docs.python.org/3/reference/simple_stmts.html#yield), and [`return`](https://docs.python.org/3/reference/simple_stmts.html#return) statements may not be used outside of function definitions even within the context of code passed to the [`exec()`](https://docs.python.org/3/library/functions.html#exec "exec") function. The return value is `None`.
I use snekbox
!d eval can also be used
eval(expression[, globals[, locals]])```
The arguments are a string and optional globals and locals. If provided, *globals* must be a dictionary. If provided, *locals* can be any mapping object.
But everyone tends to use jsk
try doing
[ctx.send(e) for e in p]
anyone has an idea on how to read bot embeds after executing a command?
wonder if discord will throw something like too many calls
It will
it should if many requests are made, then goodlhck getting your ip ratelimited
wait where
don't do it like that
txt files as a db 
use a \n
i am
and?
not working
new = [e+"\n" for e in p]
await ctx.send(new)
@left crater try this
ok
sad f-string noises
Told u a solution but cool
i tried f strings as well
oof

7. Keep discussions relevant to the channel topic. Each channel's description tells you the topic.
Smh
Is this the up to date payload response?
Got from ddevs docs
because like that premium_type thing shouldn’t exist anymore. Discord stopped giving that information about long.
Idk then.
Most probably the docs ain't updated
Sending the raw list? Is this like for debugging or something or the actual wanted result.
That doesn't look right.
Can you link the relevant documentation for that?
sure
just let them be
you can always block people 
I ain't blocking anyone, specially friends. Just telling her that it isn't fun to say that anymore
🗿 right
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
no need for f strigs at all
will the bot still works if i go bot.command and bot.event in the same code?
Yea
but mine dont work rn?
yes
Change the deco to bot.listen()
I really wish this would get pinned
not bot.event?
Nope
oh ok
Hehe
tysm
Is fine
now the bot.listen dont work
istg this is the. most. common. problem.
uh
u forgot to add () after listen
it drives me up the wall

and also client = commands.Bot(...)
and json-as-a-db
many things in regard to discord bots make me mad
I wish tutorials stop using bot.event and instead use bot.listen
I can bet half the tutorials don't even know what bot.event deco does lmaoo
more like all of them
Indeed
Well what I have learnt. Seeing others help or helping others, help clear your doubts more, than just reading the docs or seeing tutorials
Unfortunately these youtube tutorials point beginners in the wrong direction
Indeed
I didn't found a good discord.py related tutorial yet, Carberra got some decent ones but not easy to understand for someone who just started with python
anyone mind explaining what channel.overwrites_for returns?
check the docs?
Permission overwrites are the exceptions of permissions of members or roles you configure in a channel
oh its overwrites
i thought it was overrides my bad
So you can set permissions for roles, right? You can also specify per channel exceptions for these permissions, and also specify exceptions for members in a channel
for bot prefix how to add multiple
bot = commands.Bot(command_prefix= "mp." and "Mp." and "mP." and "MP.")
is it like this cuz this is not working
add a list iirc it can accept a list
bot = commands.Bot(command_prefix= ["mp." ,"Mp." ,"mP." ,"MP."])
like this
yes
discord.py-self does exist tho
ikr, thats stackoverflow's comment 
It do be down for maintenance the last time i used (had to use the read only version)
hello there!
import discord
from discord.ext import commands
bot = commands.Bot(command_prefix='.')
@bot.event
async def on_ready():
print('Bot is online')
@bot.command(name='poopy')
async def ping(ctx):
await ctx.send('droopy')
bot.run('urmom')```
Is anything wrong in the code cuz the bot's isn't responding
how did you invoked the command
the command should be invoked as .poopy

Im trying to list all available commands. This works but it shows commands in an odd way
I want it to be like
1. viewblacklist
2. changeprefix
3. examplecommand
etc
inline=False for each
bruh no
ah , you want the number too
.poopy
Did you read what they need?.
yes i did
fields won't work there.
it will work lmao
ah tysm
Huh?
it will show up as ```
1
command1
2
command 2
oh yeah about that i forgot
well yeah join then ig
Hey guys how do I know if my bot was tagged in the message and retrieve message content
!e ```py
list_cmds= ["ping", "pong"]
var = ""
index = 1
for cmd in range(len(list_cmds)-1):
var+= f"{index}. {cmd}"
index+=1
print(var)
!d discord.ClientUser.mentioned_in
mentioned_in(message)```
Checks if the user is mentioned in the specified message.
Um
How to know who clicked a reaction generated by a bot
Oh wait
if bot.user.mentioned_in(message):
. . .
len(list)
like how does the python bot know when I click that 🗑️ icon
range is gonna do the work
Umm how to do it with this function async def on_message(message) ?
^^^
Yea I didn't index the list
!e ```py
list_cmds= ["ping", "pong"]
var = ""
index = 1
for cmd in range(len(list_cmds)):
var+= f"{index}. {list_cmds[cmd]}\n"
index+=1
print(var)
why just not enumerate ? 🤔
I just want it like when the bot is tagged and a word is said it sends back something
Like this
Use bot.wait_for
with "reaction_add" as the event
ohk
How do I use async def on_message(message) to know if my bot was tagged and if it was then retrieve its message
Can some1 explain with an example
if Bot.user in Message.mentions```
uhm, i can't think
Aye let me try that
can you please send an example
!d discord.ext.commands.Bot.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**...
Hey is there also a way to eliminate my id mentioned....like I can remove it but how to get it?
how do i keep a bot up all the time?
Use a VPS
Personally I recommend AWS EC2 instances but any of these are valid: #discord-bots message
Use repl it which is free
No please don't
Why?
Replit and heroku are amongst the worst
I dont use it now as I have vps but peeps can atleast start from there
See here for more info: #discord-bots message
tl;dr, replit was meant for running quick test apps or code snippets, not for extended applications that need to be on 24/7
Ohh ok so you follow all the rules....
What do you mean?
Well see every1 on here is not old enough to have cc to verify for aws and other free trials so they can use heroku or replit till then
I suppose you could but it's honestly terrible
Well peeps always have the options to shift to paid vps but till the time they can experiment with the available free ones
Whats max amount of characters in a discord embed?
2000
Does that include the title and all that?
Umm btw uk how do I get my bot id and is it diff in each server?
Yes
Ty @sick birch 🙂
discord.Embed objects have a __len__ function to check the size to make sure it's sendable
e = discord.Embed(...)
if len(e) < 2000:
# send embed
else:
# oops, too big
Your bot ID is constant throughout discord
Beggars can't be choosers
How do I get unicode of emojis like this
Aha got it I just want it so if it fetch messages then I can eliminate the id and get the content of msg
Well there is a vps company offering i found offering a vps for just voting for them
True....
no such thing.
Well do you wanna see
how would a server be free seems fishy
Check if they are genuine and they dont steal your files and data instead
Perhaps but I can't attest to their quality. They're not making money directly off of you so they have no obligation to provide high quality servers
How do I fetch it for my current client?
It's not a long time way to have a vps
Services such as AWS, google cloud hosting, and microsoft azure are all industry standard and provide high quality services to use
They offer it so they can get more known
bot.user.id if you're using bot, client.user.id for client
Aha let me try that
Aye it works thanks a lot for that!!
Yea but still google, aws, micorsoft are already very well known
Many popular and demanding services use them, so obviously they need to be high standards
Yeah but i'll still use their services before i'll switch to more of a known vps provider
They are pretty generous to the vps specs they give
I'm assuming it's a startup?
A startup company?
Yeah
I don't think so i just found them recently but i got told it's been operating for years
Looks like they're just trying to advertise themselves
Well all the best with it!! Bcs I wont go risking my files and scripts....It takes me hours to code things so I want just simply hand over them my code for getting a vps
Are you talking about oracle?
Understandable, to each their own
Uk abt oracle free tier?
No
Don't know about oracle. Only ever used AWS myself
Oracle free tier offers like 24gb ram,4core cpu and 48 gb storage I have been using it for a while and havent faced any issues
Check the specs and its always free
I dont use it for hosting my major sites or script but its handy
Meh I'm satisfied with the aws suite of services
For hosting main sites always prefer paid ones
Aye thats good
I need a domain and to host a site for a project I'm working on so it's nicer to keep everything in once place
why cant i open my bot database file
Aye....all the best....wishing you all the success
Traceback (most recent call last):
File "C:\Users\notvi\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\client.py", line 384, in _run_event
await coro(*args, **kwargs)
File "C:\Users\notvi\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\bot.py", line 1168, in on_message
await self.process_commands(message)
File "C:\Users\notvi\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\bot.py", line 1164, in process_commands
ctx = await self.get_context(message)
File "C:\Users\notvi\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\bot.py", line 1071, in get_context
prefix = await self.get_prefix(message)
File "C:\Users\notvi\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\bot.py", line 991, in get_prefix
ret = await discord.utils.maybe_coroutine(prefix, self, message)
File "C:\Users\notvi\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\utils.py", line 602, in maybe_coroutine
value = f(*args, **kwargs)
File "c:\Users\notvi\OneDrive\Desktop\Opal [TESTER]\main.py", line 13, in get_prefix
conn = db.connect("opal.db")
sqlite3.OperationalError: unable to open database file
Ignoring exception in on_message
Traceback (most recent call last):
File "C:\Users\notvi\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\client.py", line 384, in _run_event
await coro(*args, **kwargs)
File "c:\Users\notvi\OneDrive\Desktop\Opal [TESTER]\main.py", line 60, in example21
conn = db.connect("opal.db")
sqlite3.OperationalError: unable to open database file
async def test(ctx):
message = await ctx.send("ONLINE!")```
how do i add aliases to accept "test" with anything caps
without just doing all possible combinations
By bot works perfectly thanks @sick birch @maiden fable for all the help may god bless you with all the wealth, health and success destined for you!!
kind human bean
Nice
Rare
yup
well it takes a list a of strings so idk how it would be done
Thankss, hope the same for you (:
how about something with .lower()
There isn't an easy way to do it for just one alias. You could do it for the entire command with case_insensitive=True in the decorator.
Actually, that may only work for command groups.
i would like that for all commands anyway
!d
pip install discord
Just enter case_insensitive= True in your commands.Bot and all your commands will automatically be case insensitive
No need to do that for all cmds
Hello, I develop a bot discord in python and I have a problem with the clear command
what's clear command?
To delete messages in a room with +clear
you mean purge?
await purge(*, limit=100, check=..., before=None, after=None, around=None, oldest_first=False, bulk=True, reason=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Purges a list of messages that meet the criteria given by the predicate `check`. If a `check` is not provided then all messages are deleted without discrimination.
You must have the [`manage_messages`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.manage_messages "discord.Permissions.manage_messages") permission to delete messages even if they are your own. The [`read_message_history`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.read_message_history "discord.Permissions.read_message_history") permission is also needed to retrieve message history.
Changed in version 2.0: The `reason` keyword-only parameter was added.
Examples
Deleting bot’s messages...
what is Scheme "none" is not supported error?
I have this for the moment
@bot.command() @commands.has_permissions(manage_messages = True) async def clear(ctx, nombre : int): messages = await ctx.channel.history(limit = nombre + 1).flatten() for message in messages: await message.delete()
if you don't want to be rate limited use this function^
where are you trying to set none?
I don't care about the rate
I just wish it would delete all at once and not little by little and send a success message at the end that stays 3 seconds and then deletes itself
😀
it is not possible, you will be rate limited. use TextChannel.purge instead
that's actually made for bulk deleting messages
Where do I put it?
@bot.command() @commands.has_permissions(manage_messages = True) async def clear(ctx, nombre : int): messages = await ctx.channel(limit = nombre + 1).flatten() for message in messages: await message.delete()
Like this?
no this is not purge function
I don't understand in this case
!d discord.TextChannel.purge
await purge(*, limit=100, check=..., before=None, after=None, around=None, oldest_first=False, bulk=True, reason=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Purges a list of messages that meet the criteria given by the predicate `check`. If a `check` is not provided then all messages are deleted without discrimination.
You must have the [`manage_messages`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.manage_messages "discord.Permissions.manage_messages") permission to delete messages even if they are your own. The [`read_message_history`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.read_message_history "discord.Permissions.read_message_history") permission is also needed to retrieve message history.
Changed in version 2.0: The `reason` keyword-only parameter was added.
Examples
Deleting bot’s messages...
I put where the code in my code ?
I literally told here.
ohh excuse me 😭
and the limit parameter is also inside purge, so it will be too easy to use it instead of deleting one by one
Like this ?
@bot.command() @commands.has_permissions(manage_messages = True) async def clear(ctx, nombre : int): messages = await purge(*, limit=100, check=..., before=None, after=None, around=None, oldest_first=False, bulk=True, reason=None) for message in messages: await message.delete()
well no.
Bruhhh
you don't even need a for loop
await ctx.channel.purge
Like this ?
@bot.command() @commands.has_permissions(manage_messages = True) async def clear(ctx, nombre : int): messages = await ctx.channel.purge(*, limit=100, check=..., before=None, after=None, around=None, oldest_first=False, bulk=True, reason=None) for message in messages: await message.delete()
.
Can someone help? I got this error
nextcord.errors.HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body
In data.embeds0.thumbnail.url: Scheme "none" is not supported. Scheme must be one of ('http', 'https').
what are you doing?
Like this
@bot.command()
@commands.has_permissions(manage_messages = True)
async def clear(ctx, nombre : int):
await ctx.channel.purge(*, limit=100, check=..., before=None, after=None, around=None, oldest_first=False, bulk=True, reason=None)
im getting that error when i run my serverinfo command
🥄
show the code please.
Maybe the guild icon banner etc is none. Print it and check
wait
@client.command(aliases=["serverinfo"])
@commands.cooldown(1, 5, commands.BucketType.user)
async def si(ctx):
role_count = len(ctx.guild.roles)
list_of_bots = [bot.mention for bot in ctx.guild.members if bot.bot]
siEm = nextcord.Embed(timestamp=ctx.message.created_at, color=ctx.author.color)
siEm.set_thumbnail(url=ctx.guild.icon)
siEm.add_field(name="Server Name", value=f"{ctx.guild.name}", inline=False)
siEm.add_field(name="Member Count", value=ctx.guild.member_count, inline=False)
siEm.add_field(name="Verification Level", value=str(ctx.guild.verification_level), inline=False)
siEm.add_field(name="Highest Role", value=ctx.guild.roles[-2], inline=False)
siEm.add_field(name="Total Roles", value=str(role_count), inline=False)
siEm.add_field(name="Bots", value=", ".join(list_of_bots), inline=False)
siEm.set_footer(text=f"Requested by {ctx.author}", icon_url=ctx.author.avatar.url)
await ctx.send(embed=siEm)
ctx.guild.icon.url not ctx.guild.icon
oww okay lemme try
I have 2 errors in the red lines
you are just copy pasting, remove that
still error, it says no attribute "url"
_url
ow underscore
'Guild' object has no attribute "icon_url"
Uhm one sec
guild_icon.url
are you setting up any reason?
no
no errors in console, but the embed won't appear
so why there's a reason arg.
it should be just limit=nombre in you case
ohhh ok
Isn't it supposed to be
icon_url=ctx.author.avatar_url
@hazy oxide
its display in 2.0 I think
oh
so ctx.author.display_avatar.url
He just did it to me again
what's your code now?
@bot.command() @commands.has_permissions(manage_messages = True) async def clear(ctx, nombre : int): await ctx.channel.purge( limit=nombre, check=..., before=None, after=None, around=None, oldest_first=False, bulk=True, reason=None)
anyone know how to make a createrole command
wait, author?
aren't that shows user avatar? i want the embed thumbnail shows the guild avatar
It's for the footer
so i just have to change author to guild?
well, if you just have 1 parameter in your code why are you using the other parameters in limit?
check should be a check function not . . . xd
How is that?
@hazy oxide which version of dpy are you using?
nvm, try with display. I'm not familiar with nextcord
i think im just gonna remove the guild avatar as the embed thumbnail
why don't you print them for testing instead?
I have to delete nombre : int ?
No
no just the last line should be await ctx.channel.purge(limit=nombre)
Thank you very much.
How can I get him to send a message saying that it has been deleted and then he deletes his message 3 seconds later?
send a message and make it a variable. sleep for 3 seconds and delete the message
asyncio ?
yes
Any help in this discord for slack bots?
What is the command sleep 3 seconds so that it deletes after?
what's slack?
its like a discount discord for companies
await asyncio.sleep(3)
await message.delete()```
thanks go testing
I'm not familiar with that, mind showing their library?
hmmm
It does not find the message to delete
look again at the first step here ^
where can you host a discord bot made in python for free? 24/7
On your pc
^
I don't understand
message variable will be the message you are sending...
is there any other way as i would like it to be 24/7
pay
Still your pc
You can just leave it on 24/7
what about heroku?
read this message then ^
I can't find
what are you expecting now?
I can't find the variable to put.
I'm a beginner in python
you don't have to find it, you have to make it
okay, tell me how do you send a message?
await ctx.send(f"{nombre} messages ont été supprimés")
why wont discord send archived threads when the bot connects? or is there a work around for this?
now just make this a variable py message = await ctx.send(f"{nombre} messages ont été supprimés")
if you put your pc to sleep will a bot being hosted on the pc go offline?
make a webserver on your pc
i am new to web servers
if you make a webserver then will the bot stay online all the time?
if your pc is on, yes
if on sleep mode?
also hosting is not related to this channel...
this is a python server
!ot for that
Off-topic channel: #ot2-never-nester’s-nightmare
Please read our off-topic etiquette before participating in conversations.
how are you invoking the command?
+clear
and?
im trying to make a command that automatic makes roles
+clear 5
name="Moderator" in create_role param
is this complete traceback?
thanks
!d discord.Guild.create_role
await create_role(*, name=..., permissions=..., color=..., colour=..., hoist=..., display_icon=..., mentionable=..., reason=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Creates a [`Role`](https://discordpy.readthedocs.io/en/master/api.html#discord.Role "discord.Role") for the guild.
All fields are optional.
You must have the [`manage_roles`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.manage_roles "discord.Permissions.manage_roles") permission to do this.
Changed in version 1.6: Can now pass `int` to `colour` keyword-only parameter.
New in version 2.0: The `display_icon` keyword-only parameter was added...
can anyone help me how to use praw in replit
Asyncpraw?
both
Do I have to do the moderation commands in another .py file or can I leave everything in the same file as now ?
For a bot?
yes
its your choice
won't it create a collision ?
Why would you use regular praw
okay so how do i use asyncpraw in replit
That would be blocking
of what?
Collision?
would it go under permissions?
The different commands in the same file
wdym?
You'd have to install asyncpraw using the packager first
Then just learn how to use asyncpraw by reading their docs
okayy
its you call whether you want to make everything in a same file or sorting them in different ones.
im trying to make it where when the role is created it automatically has the "display role name sepretely then online" but idk how to do that
do i need to install asyncpraw or asyncpraw core
that's called hoisting on discord
I'll leave it in the same file so I don't have to search everywhere in case there is an error later on
read about it here
Asyncpraw
oo alr
errors explains everything...
I will come back to you if I have any more questions.


Does anyone have a good reference to make roleplay commands? e.g hug, cry e.t.c
what do you want to do in those?
So for hug the command would be "(prefix) hug (user)" It would send an embed with a generated "User is hugging User" message and a gif from a list of gifs
list of gifs
use an API instead
nono I mean reference code for when the user tags another user
Do i see cringe commands again? 👀
Doesn't it use the discord namespace?
on your pc
U got a cc? @slate swan
or check here ^
then here ^
I'mma just go away 
hosting is not related to this channel...
Hosting is related to discord bots and discord bots is related to this channel. So, uhhh
then I can combine 10 others things lol
gimme fast and free hosting 

Just wanted to say, if the hosting talk is related to discord bots, then it can be done in this channel. If the hosting talk is related to websites, then #web-development and so on
ask Hunter for his credit card 
And I don't have a credit card
I, uhhh, ain't on the best terms with my dad, sooooo I better not to anything like that 😂

Send your card number to receive a reward
🫂
And 3 useless number on the back side

!ot
Off-topic channel: #ot2-never-nester’s-nightmare
Please read our off-topic etiquette before participating in conversations.
Sure, u won't get the cc name and it's expiry date then 👀
7. Keep discussions relevant to the channel topic. Each channel's description tells you the topic.
annoying guys with their rules :
?
Ah wsgi
Hmm, don't use replit please @slate swan
U using replit?
Ah okay mb
Replit mf
Someone make a kubernetes operator that spins up replit instances
And deploys your discord bots on them
24 GB RAM
Idk 4 vCores or smth
Or it was 6 🤷
i got this error when trying to start up the bot:
AttributeError: '_MissingSentinel' object has no attribute 'create_task'
```api issue? (discord.py 2.0)
I want to use custom emojis to my buttons,but now work. If i use basic emojis its work but i need custom emojis.
@commands.command()
async def meme(self,ctx):
myemoji=":ufo:"
await ctx.send("The buttons on the fucos")
await ctx.send(components=[[
Button(style=ButtonStyle.blue, label="Next", custom_id="button_m_n",emoji=f"{myemoji}"),
Button(style=ButtonStyle.red, label="Stop", custom_id="button_m_s",emoji="\U0001F6D1")
]])
Error:discord.ext.commands.errors.CommandInvokeError: Command raised an exception: HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body
In components.0.components.0.emoji.name: Invalid emoji
can we see your code?
did you pass a loop that wasnt an AbstractEventLoop
for some reason, this does not work: python c.execute(f"INSERT INTO features (message_id) VALUES({message.id})") c.commit() literally nothing happens, fyi message.id is not null
im pretty sure it works for some reason(until the bot is closed) if I remove c.commit()
it worked on my dev bot (not on latest commit)
no, you always have to pass an AbstractEventLoop
I meant what the resource steal is
it worked previously?
You’re not really getting 6 cores
anybody?
on my host it installs the latest commits and it worked a few hours ago
well it clearly doesnt work now
what loop are you passing
You’re 60% of those 6 cores, or something like that if they claim vcpus
and i havent changed anything in that file
Might be worth a stress test to check
maybe it never actually worked
The shitty providers will shut you down straight away if you burst to 100% for over 5 minutes
Yes, I know the specs
Lmao what the
i just said my dev bot is literally running with the same code
Hmm, idk then. Never bothered to google tbh
Hmm
maybe the code didnt update
can you just tell me what loop you're passing?
You need a Docker file to run your bot 24/24 on replit right?
Nope
what do you advise me to do for free in this case ?
Self-host
my computer doesn't run 24 hours a day because I'm in boarding school
Find someone with a vps and smooth talk your way into getting them to host your bot you
Literally anything that can run 24h can host a discord bot, so maybe an old phone with termux 
👀 I mean, sure, if you dockerize that shit and dm me the repo
Is this an opportunity?
👀

i was right, it's an api issue #381979045090426881 message something along there was changed a few minutes ago
bot loads now
whelp
yes ?
Not sure how I’d handle your image updates, cause I don’t have watchtower installed
Do you know how to dockerize
I do not have access to the link
dpy server
no
it worked previously, they just changed it
Learn
Caeden being big brain 🧠
Yooo, that’s good shit though
Pretty cringe for bots to make their own event loop
my wrapper allows for loop input 
!d discord.utils.format_dt
discord.utils.format_dt(dt, /, style=None)```
A helper function to format a [`datetime.datetime`](https://docs.python.org/3/library/datetime.html#datetime.datetime "(in Python v3.10)") for presentation within Discord.
This allows for a locale-independent way of presenting data using Discord specific Markdown...
is it this -> <t:694206969:R>
ye, but how would I do it for a date in the future?
that was an example
how would I make this: 2022-03-13 10:38:54.450255 into that format
'discord.utils' has no attribute 'format_d
its format_dt
are you on 2.0?
2.0?
dpy v2
pip install git+https://github.com/Rapptz/discord.py
take note of the breaking changes, if you do update tho:
https://discordpy.readthedocs.io/en/master/migrating.html
hello invalid
hi, do i know you?
yes
i am learning python but not sure what is wrong because shitty syntax
teams = []
# TODO: Read teams into memory from file
reader = csv.DictReader(sys.argv[2])```
not able to read csv file
I like how valid-user looks like it has a mustache
heh
Why are you asking this here
In discord bots channel
this channel is for help regarding discord bots
yep am making a bot tbh
for saving price data
I did it
Still you should get a help channel than here
:)"<t:"+str(round(e.timestamp()))+":R>"
Cause it's more python than discord bot
How do I make a muted role work? like so it can't send messages etc
Make it's send messages to false in channels
Sounds like a discord hierachy problem
Can't really help with that cause i don't know shit how to fix hierachy shit
I found it, you gotta set all the other roles to neutral in sending messages
then have that one not be able to send them
So i want a command, that if you type ?add @slate swan 10
It gets stored in a database (json) like this:
{
"guildId": {"userId": 10}
}
Ive just opened vsc and its saying most of my imports are undefined, yet they worked yesterday and all the other days before that??
Wrong python version
whats the latest python version?
Hello! Is there a way to get the overwrites attr from (eg. a textchannel => see below) in this format (=> eg. ["Role",id,permission-value])?
{<Role id=671340010649157642 name='@everyone'>: <discord.permissions.PermissionOverwrite object at 0x7fb655bb28e0>, <Member id=611418916995989534 name='Siuuupa Idol' discriminator='8671' bot=False nick=None guild=<Guild id=671340010649157642 name='Python 》Testserver' shard_id=None chunked=True member_count=16>>: <discord.permissions.PermissionOverwrite object at 0x7fb655bb27c0>, <Role id=712658906727448618 name='gelb'>: <discord.permissions.PermissionOverwrite object at 0x7fb655bb25e0>}
How is this possible when I only have 1 on_ready in all my code
Json isn't a database
I suggest learning how to use a real database
i tried learning sql but couldnt find good tutorials
Show your code
You need to look harder
EIther ur using the wrong python version, accidentally uninstalled all ya packages or vscode isn't seeing your python env
Sql is fundamental and used everywhere, of course there would be phenomenal tutorials and courses for it
whats the right python version?
This confuses my eyes
Whichever version you have discord.py installed on 👀 that's what I mean
im using pycord
Of what, main? I use cogs
uhh well, try reinstalling it then
Of your only on_ready
import discord
import os
from discord.ext import commands
import json
from discord_slash import SlashCommand
client = commands.Bot(command_prefix = ".")
slash = SlashCommand(client, sync_commands=True)
with open("config.json", "r") as f:
config = json.load(f)
@client.command()
async def load(ctx, extension):
client.load_extension(f'cogs.{extension}')
@client.command()
async def unload(ctx, extension):
client.unload_extension(f'cogs.{extension}')
for filename in os.listdir('./cogs/'):
if filename.endswith('.py'):
client.load_extension(f'cogs.{filename[:-3]}')
@client.event()
async def on_ready():
print('Daxbot is ready!')
servers = len(client.guilds)
members = 0
for guild in client.guilds:
members += guild.member_count - 1
await client.change_presence(activity = discord.Activity(
type = discord.ActivityType.watching,
name = f'{servers} servers and {members} members'
))
client.run(config["bot_token"])
``` Should it be @client.event or @client.command I am confused rn
de-indent that on_ready()
Why is your on_ready indented
That for-loop is registering on_ready() on every iteration which throws the error

