#discord-bots
1 messages · Page 964 of 1
my apologizes.. my english teacher is dumb.. so is my english :")
Return loads(fp.red() ??
@formal basin
the error is coming from the lib's source code?
Ik
okay now im confused
it seemed to be fine before this sentence
i was proving that sentence in that sentence lol
its okay, i told them what was required
he used a method of the json lib and the error occured in that code, probably because of an argument passed in wrongly
dude @slate swan , your repos is a one time open. if you open the link and try to open it another tab, it will crash
then restart the browser
my cpu usage is 100%
the file the error comes from is literally there
python libs 3.8 blabla blabla init.py
can you host a database on repl
can repl host it for you
idts
are you tryna say idiots
precisely
rude
totally me
well cuz you could get something better than json
doesn't repl provide a free 50 mb db?
50 mb isn't a lot, but for a small bot in 2 servers, it's great
lets be real, none of us are popular enough to have those kinds of servers, and if we did we would pick a proper hosting and db service
I mean, sqlite and postgre still exist
does it on repl tho
idk
yes
i'll just go away now, switching channels is a lot of work
bro
get the channel from that
you pulled a channel_id, not a channel
replit's db is key-value, which i cant imagine would be very convenient for the kind of data you'd be storing from discord, e.g. per-server settings or economy systems
try to pull the channel from the guild
economy bots are overrated
I pull out the name?
Hey i try to make a giveaway command but if i try to run the command i get this error discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: '<=' not supported between instances of 'set' and 'int'
My Code:
@bot.command(name="giveaway")
@commands.has_permissions(administrator=True)
async def giveaway(ctx, mins : int, *, prize: str):
user=ctx.author
end = datetime.datetime.utcnow() + datetime.timedelta(seconds= mins*60)
embed = discord.Embed( title = "**Giveaway**", description = f"Host: {user}\nPrize: {prize}", color=discord.Color.gold())
embed.add_field(name= "Ends at:", value=f"{end} (in {mins}min)")
gwmsg = await ctx.send(embed = embed)
await gwmsg.add_reaction("🎉")
await asyncio.sleep(mins)
gwmsg1 = await ctx.channel.fetch_message(gwmsg.id)
users = await gwmsg1.reactions[0].users().flatten()
users.pop(users.index(bot.user))
winner = random.choice(users)
await ctx.send(f"{winner.mention} hat {prize} gewonnen!")
except dankmemer, don't you dare damn touch it
you dare tell me dank memer is an economy bot
you tried to compare a set and an integer
try this-
<= ain't even in your code
So guild_id?
no, channel = member.guild.get_channel(channel_id)
just channel
channel = member.guild.get_channel(channel)
can we see more of your error?
where is <=?
Traceback (most recent call last):
File "C:\Users\tim10\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\bot.py", line 939, in invoke
await ctx.command.invoke(ctx)
File "C:\Users\tim10\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\core.py", line 863, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "C:\Users\tim10\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\core.py", line 94, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: IndexError: list index out of range```
hu
okay but we don't know where this line is cuz you didn't send it
it's also a different error 🤔
if i do
await asyncio.sleep(1)```
how can i edit msg
i tried `await msg.edit("world!")`
got `discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: edit() takes 1 positional argument but 2 were given`
await msg.edit(content="world!")
But i only have this command in the python file
maybe it came from
users = await gwmsg1.reactions[0].users().flatten()
?
can't be, you fetched the message again
inviting us isn't gonna help
bro
I didn’t mean to do that
the only thing we can do is check your code and we probably are experienced enough to see the problem
And how can i fix it?
with enough information of course
ctrl + z
I said maybe, I don't know which line you got the error at
What will that do?
channel_id, is an id, so the int from the json file
you just have to fetch a channel from it
Yes.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\tim10\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\bot.py", line 939, in invoke
await ctx.command.invoke(ctx)
File "C:\Users\tim10\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\core.py", line 863, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "C:\Users\tim10\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\core.py", line 94, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: IndexError: list index out of range
```this is not a whole traceback
so why did you pass in a string?
and includes many stuff except the line in your code
So channel_name
no
I didn’t
get 😢
channel = data[str(member.guild.id)]["channel_id"]
channel = member.guild.get_channel(channel)```
api calls are the future
So both of them?
yes
Oh
But thats all
@formal basin channel = bot.get_channel(data[str(member.guild.id)]['channel_id'])
too much in one line
This is the full error
"The above exception"
means the exception above that line
because there is an exception
oh my bad ```Ignoring exception in command giveaway:
Traceback (most recent call last):
File "C:\Users\tim10\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\core.py", line 85, in wrapped
ret = await coro(*args, **kwargs)
File "c:\Users\tim10\OneDrive\Desktop\Testbebo\bot - Kopie.py", line 84, in giveaway
await asyncio.sleep({mins})
File "C:\Users\tim10\AppData\Local\Programs\Python\Python39\lib\asyncio\tasks.py", line 638, in sleep
if delay <= 0:
TypeError: '<=' not supported between instances of 'set' and 'int'The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\tim10\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\bot.py", line 939, in invoke
await ctx.command.invoke(ctx)
File "C:\Users\tim10\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\core.py", line 863, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "C:\Users\tim10\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\core.py", line 94, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: '<=' not supported between instances of 'set' and 'int'
Ignoring exception in command giveaway:
Traceback (most recent call last):
File "C:\Users\tim10\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\core.py", line 85, in wrapped
ret = await coro(*args, **kwargs)
await asyncio.sleep({mins})```
thanks, that's help
File "C:\Users\tim10\AppData\Local\Programs\Python\Python39\lib\asyncio\tasks.py", line 638, in sleep if delay <= 0: TypeError: '<=' not supported between instances of 'set' and 'int' The above exception was the direct cause of the following exception: Traceback (most recent call last): File "C:\Users\tim10\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\bot.py", line 939, in invoke await ctx.command.invoke(ctx) File "C:\Users\tim10\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\core.py", line 863, in invoke await injected(*ctx.args, **ctx.kwargs) File "C:\Users\tim10\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\core.py", line 94, in wrapped raise CommandInvokeError(exc) from exc discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: '<=' not supported between instances of 'set' and 'int'```
now wait that's a problem in the asyncio lib
not sure why there's {} around mins
oh it's actually in discord's source code
they did mess up bro
lemme look on github
https://github.com/Rapptz/discord.py/blob/master/discord/ext/commands/core.py#L85
I don't think I found it
discord/ext/commands/core.py line 85
'dm_only',```
oh got it
File "c:\Users\tim10\OneDrive\Desktop\Testbebo\bot - Kopie.py", line 84, in giveaway
await asyncio.sleep({mins})
remove {} around mins
this isn't here in this message
those {}
Hi guys, I'm using this code for a while. However last week for some reason it stopped working and only giving me one message instead of the 20 limit I gave the bot. Any idea on this, is there a new update?
channel = bot.get_channel(962066339386777690) # get channel ID
async for message in channel.history(limit=20): # read last 20 messages from channel
print(message.attachments[0].url) # print out 20 messages
Yes it does read 1 message instead the 20 i gave him :S
Nope, haven't changed anything for like 1 year
are there more stuff in that for loop
Here the whole function for a better understanding
@bot.command()
async def updb(ctx):
collection.drop()
time.sleep(1)
channel = bot.get_channel(962066339386777690)
async for message in channel.history(limit=20):
print(message.attachments[0].url)
urlArray.append(url)
for url in urlArray:
print(url)
collection.insert_one({"url": url}
they changed it in 2.0
you have to use list comps now
messages = [messages async for messages in channel.history(limit=None)]looks something like this
Oof, okay will check this out
also you should use asyncio.sleep
time.sleep is blocking
print(message.attachments[0].url) isn't working anymore (changed it to messages) and it seems like it's still printing out 1 message from the channel
what would be the best method for checking for dates connected to an image and deleting older ones? I'm thinking a very slow loop to spread out the cpu usage that checks each image because it's not time sensitive.
you dont have to use list comps, and as for their use of async for message in channel.history() this is still backwards compatible so that is likely not the issue
do you have an on_command_error event? your urlArray seems to be undefined at least in that command, so it seems plausible that your command has abruptly stopped due to an error but was eaten by an error handler
as for the print not working, if you didnt tweak the limit=None in their example your bot would fetch every message in the channel, possibly hitting ratelimits
I do not have an on_command_error event and that's why i'm using limit=20
Hey, so if i have a message.content and im using .startswith("OE")
I want to find if it starts with OE or oe, regardless of uppercare or lowercase.
It's weird because i haven't changed the code for like a year or even longer
hm did you update discord.py recently or is it still on a stable version
Didn't update anything
oh and is it guaranteed that every message in your channel will have at least one attachment?
@commands.Cog.listener()
async def on_message(self, message):
channel = self.client.get_channel(962081173545287691)
embed = Embed(
description=f"Message sent in {message.channel.mention}", color=0x4040EC
).set_author(name=message.author, url=Embed.Empty, icon_url=message.author.avatar_url)
embed.add_field(name="Message", value=message.content)
embed.add_field(name="User ID:", value=message.author.id, inline=False)
embed.timestamp = message.created_at
await channel.send(embed=embed)
``` This is just for testing but how do I add that images also show in here as it gives me this error
use .lower() on the content to lowercase it before making your comparison
Running on version 1.7.3 btw. That channel is an images only channel
Anyone please
!d discord.Embed.set_image
set_image(*, url)```
Sets the image for the embed content.
This function returns the class instance to allow for fluent-style chaining.
it works tho
embed.add_field(..., value=(message.content or "No message content"))
oh
What's the ...?
Anything
The important part is the or
Other stuff can be whatever, isn't that important
Do you get me just wondering
The problem arises that just because a message doesn't have message.content doesn't mean it's an image
For example it could be a message like so:
Oh
wait so instead of my
deleted.add_field(name="Message", value=message.content)
Yes it needs to be message.content or "No message content"
!e
x = None
print(x or "x was none")
@sick birch :white_check_mark: Your eval job has completed with return code 0.
x was none
Can I also make it so images show up there
You would need an additional check
How?
To see if the message had any attachments
if message.attachments:
# message has attachments
else:
# message was just an empty message
Like if message.attachments then embed.add field?
not really sure on how to do that
@commands.Cog.listener()
async def on_message_delete(self, message):
channel = self.client.get_channel(954837357239091260)
deleted = Embed(
description=f"Message deleted in {message.channel.mention}", color=0x4040EC
).set_author(name=message.author, url=Embed.Empty, icon_url=message.author.avatar_url)
if message.attachments:
deleted.add_field()
else:
deleted.add_field(name="Message:", value=(message.content or "No message content"))
deleted.timestamp = message.created_at
await channel.send(embed=deleted)
``` something like that
Then add something if its a image
first you need to consider where could you show the image in your embed https://cdn.discordapp.com/attachments/343944376055103488/802792106778427412/image0.png
Don't really mind at all
Just want the image to show thats it
you cant show an image in your embed if you dont know where images can be shown in your embed
Oh yeah I get where they are shown
but you wrote add_field() which is related to these things
I know
what you're looking for is what akg referenced earlier
Just don't know what to put in it yet
@commands.Cog.listener()
async def on_message_delete(self, message):
channel = self.client.get_channel(954837357239091260)
deleted = Embed(
description=f"Message deleted in {message.channel.mention}", color=0x4040EC
).set_author(name=message.author, url=Embed.Empty, icon_url=message.author.avatar_url)
if message.attachments:
deleted.set_image(*, url)
else:
deleted.add_field(name="Message:", value=(message.content or "No message content"))
deleted.timestamp = message.created_at
await channel.send(embed=deleted)
``` how do I do that with the (*, url)
in documentation and when defining your own functions, writing a * means any parameters after it are keyword-only
So what should I set the parameters to?
def download(*, url):
... # the magic of the internet
>>> download(url='https://link.to.my.favourite.image.png')```
in your case the url you want is the attachment's url
Sorry I got no clue on how to do this in my case
!d discord.Attachment.url
The attachment URL. If the message this attachment was attached to is deleted, then this will 404.
Ah okay
and you can get a list of attachments from message.attachments
no, your message object already has the attachments within it
!d discord.Message.attachments
A list of attachments given to a message.
@commands.Cog.listener()
async def on_message_delete(self, message):
channel = self.client.get_channel(954837357239091260)
deleted = Embed(
description=f"Message deleted in {message.channel.mention}", color=0x4040EC
).set_author(name=message.author, url=Embed.Empty, icon_url=message.author.avatar_url)
if message.attachments:
deleted.set_image(message.attachment.url)
else:
deleted.add_field(name="Message:", value=(message.content or "No message content"))
deleted.timestamp = message.created_at
await channel.send(embed=deleted)
``` how would that be?
the attribute is attachments, plural, and you need to index the first attachment from it like you would with a regular list
!e py fruits = ['apple', 'orange', 'banana'] print('The second fruit is', fruits[1])
@hushed galleon :white_check_mark: Your eval job has completed with return code 0.
The second fruit is orange
@bot.slash_command(guild_ids=[TESTING_GUILD_ID], description="Repeats your message")
async def echo(interaction: Interaction, arg: nextcord.Message = SlashOption(description="Message")):
await interaction.response.send_message(arg)```
But how do I do that with my attachments? hm?
How do I make arg and actual argument
@hushed galleon
what you need to ask yourself is how do you get the first item from a list in general, and knowing the answer to that question will naturally let you figure out how to index the first item from a message's list of attachments
I just don't get it
Just if someone delets a message, IF it has a image then show the image as well thats just it
well there's a caveat to that which means a different solution is needed, but its worth knowing that the solution i suggested you is based on the most essential knowledge, so its really important you learn instance attributes and lists
I know them.... I just don't get what you are trying to tell
anyway after a message is deleted, any of its attachments are eventually deleted from discord, so you need to download it and reupload it as an attachment in your log
oh okay
after you get the first attachment from the message you can download it using the to_file() method with the use_cached=True argument (which works better for recently deleted messages), then embed it using set_image() following this <#discord-bots message>
as for the filename you can get it with the .filename attribute of your File object
!d discord.File.filename
property filename```
The filename to display when uploading to Discord. If this is not given then it defaults to `fp.name` or if `fp` is a string then the `filename` will default to the string given.
I don't need it like that, but thanks
@commands.command(name="lock", description="Locks a channel so users can't speak it in")
@commands.has_permissions(manage_channels=True)
async def lock(self, ctx, channel: discord.TextChannel=None):
channel = channel or ctx.channel
if ctx.guild.default_role not in channel.overwrites:
overwrites = {
ctx.guild.default_role: discord.PermissionOverwrite(send_messages=False)
}
await channel.edit(overwrites=overwrites)
await ctx.send(f"I have put `{channel.name}` on lockdown")
elif channel.overwrites[ctx.guild.default_role].send_messages == True or channel.overwrites[ctx.guild.default_role].send_messages == None:
overwrites = channel.overwrites[ctx.guild.default_role]
overwrites.send_messages = False
await channel.set_permissions(ctx.guild.default_role, overwrite=overwrites)
await ctx.send(f"I have put `{channel.name}` on lockdown")
``` Why does this say command not found? It used to work.
Check if ur cog is loaded?
It is
what should i add to my bot im bored and i want to add someting fun to my bot
Unlock works though
U sure
Just lock doesn't seem to work it's really weird
Yes... all my moderation commands are in the same cog and work
Do u have any other methods in the cog named lock?
unlock
The exact same name?
Mmm try to change the name = to something
Nope just unlock
Idk tbh💀😭
Here look
It should be working doe
Yeah it used to work like 20m ago lmao
@commands.command(name="lock", description="Locks a channel so users can't speak it in")
@commands.has_permissions(manage_channels=True)
async def lock(self, ctx, channel: discord.TextChannel=None):
channel = channel or ctx.channel
if ctx.guild.default_role not in channel.overwrites:
overwrites = {
ctx.guild.default_role: discord.PermissionOverwrite(send_messages=False)
}
await channel.edit(overwrites=overwrites)
await ctx.send(f"I have put `{channel.name}` on lockdown")
elif channel.overwrites[ctx.guild.default_role].send_messages == True or channel.overwrites[ctx.guild.default_role].send_messages == None:
overwrites = channel.overwrites[ctx.guild.default_role]
overwrites.send_messages = False
await channel.set_permissions(ctx.guild.default_role, overwrite=overwrites)
await ctx.send(f"I have put `{channel.name}` on lockdown")
@commands.command(name="unlock", description="Unlocks a channel so users can speak in it")
@commands.has_permissions(manage_channels=True)
async def lock(self, ctx, channel: discord.TextChannel=None):
channel = channel or ctx.channel
if ctx.guild.default_role not in channel.overwrites:
overwrites = {
ctx.guild.default_role: discord.PermissionOverwrite(send_messages=True)
}
await channel.edit(overwrites=overwrites)
await ctx.send(f"I have unlocked `{channel.name}` for you")
elif channel.overwrites[ctx.guild.default_role].send_messages == True or channel.overwrites[ctx.guild.default_role].send_messages == None:
overwrites = channel.overwrites[ctx.guild.default_role]
overwrites.send_messages = False
await channel.set_permissions(ctx.guild.default_role, overwrite=overwrites)
await ctx.send(f"I have unlocked `{channel.name}` for you")
Well ur code looks fine
Just make sure that ur cog is loaded
Ur unlock function is named lock
All good
Its all good
Happened to me before
💀stop reading ma mind sir
Same ngl
My lock and unlock do nothing now, not even a error
😭😭😭😭
Can we see the whole code?
Prints xD
from lock and unlock?
Yes
@commands.command(name="lock", description="Locks a channel so users can't speak it in")
@commands.has_permissions(manage_channels=True)
async def lock(self, ctx, channel: discord.TextChannel=None):
channel = channel or ctx.channel
if ctx.guild.default_role not in channel.overwrites:
overwrites = {
ctx.guild.default_role: discord.PermissionOverwrite(send_messages=False)
}
await channel.edit(overwrites=overwrites)
await ctx.send(f"I have put `{channel.name}` on lockdown")
elif channel.overwrites[ctx.guild.default_role].send_messages == True or channel.overwrites[ctx.guild.default_role].send_messages == None:
overwrites = channel.overwrites[ctx.guild.default_role]
overwrites.send_messages = False
await channel.set_permissions(ctx.guild.default_role, overwrite=overwrites)
await ctx.send(f"I have put `{channel.name}` on lockdown")
@commands.command(name="unlock", description="Unlocks a channel so users can speak in it")
@commands.has_permissions(manage_channels=True)
async def unlock(self, ctx, channel: discord.TextChannel=None):
channel = channel or ctx.channel
if ctx.guild.default_role not in channel.overwrites:
overwrites = {
ctx.guild.default_role: discord.PermissionOverwrite(send_messages=True)
}
await channel.edit(overwrites=overwrites)
await ctx.send(f"I have unlocked `{channel.name}` for you")
elif channel.overwrites[ctx.guild.default_role].send_messages == True or channel.overwrites[ctx.guild.default_role].send_messages == None:
overwrites = channel.overwrites[ctx.guild.default_role]
overwrites.send_messages = True
await channel.set_permissions(ctx.guild.default_role, overwrite=overwrites)
await ctx.send(f"I have unlocked `{channel.name}` for you")
But i think the issue is in the name and the async def since name and async def have the same name
Idk try to change the names?
That's no issue lol
I have that for like all my commands
Then idk tbh
Well just check if the cog is loaded since it says that the command not found

Cog is loaded.
It doesn't say that its not found
What it says?
Nothing lol
Can u !paste cuz im on phone i cant see ur code clearly
kk
Alr
Oh well its bc u put the code inside if and elif statnts
Statements***
Also the default role always in the channel overwrites so no need to add that
what about it?
@commands.command(name="unlock", description="Unlocks a channel so users can speak in it")
@commands.has_permissions(manage_channels=True)
async def unlock(self, ctx, channel: discord.TextChannel=None):
channel = channel or ctx.channel
overwrites = {ctx.guild.default_role: discord.PermissionOverwrite(send_messages=True)}
await channel.edit(overwrites=overwrites)
await ctx.send(f"I have unlocked `{channel.name}` for you")
``` so just like this
Ye and u can add if statement to check if send_messages is enabled or disabled
class Dropdown(discord.ui.Select):
def __init__(self):
# Set the options that will be presented inside the dropdown
options = [
discord.SelectOption(label='Menu', description='Help Menu', emoji='📖'),
discord.SelectOption(label='NSFW', description='NSFW commands', emoji='🔞'),
discord.SelectOption(label='Fun', description='Fun commands', emoji='😊'),
discord.SelectOption(label='Mod', description='Moderation commands', emoji='🔧'),
]
# The placeholder is what will be shown when no option is chosen
# The min and max values indicate we can only pick one of the three options
# The options parameter defines the dropdown options. We defined this above
super().__init__(placeholder='Pick your Category...', min_values=1, max_values=1, options=options)
async def callback(self, interaction: discord.Interaction):
# Use the interaction object to send a response message containing
# the user's favourite colour or choice. The self object refers to the
# Select object, and the values attribute gets a list of the user's
# selected options. We only want the first one.
if self.values[0] == 'NSFW':
buttonforward = Button(emoji="➡️", style=discord.ButtonStyle.gray)
async def button_callback(interaction):
await interaction.response.edit_message(embed=embednsfw2)
buttonforward.callback = button_callback
buttonback = Button(emoji="⬅️", style=discord.ButtonStyle.gray)
async def button_callback(interaction):
await interaction.response.edit_message(embed=embednsfw)
buttonback.callback = button_callback
for item in self.view.children:
self.view.add_item(buttonback)
self.view.add_item(buttonforward)
await interaction.response.edit_message(embed=embednsfw, view=self.view)
elif self.values[0] == 'Mod':
await interaction.response.edit_message(embed=embedmod)
elif self.values[0] == 'Fun':
await interaction.response.edit_message(embed=embedfun)
elif self.values[0] == 'Menu':
await interaction.response.edit_message(embed=embedhelp)
can someone help me iterating through my views children because else idk how ima get the items in my views
Average discord users have died
??? why would you have buttons on dropdowns and use them like this
just use a regular embed if you gonna use buttons
No
I want to use like dropdowns for categories
And buttons to like direct pages
i mean, when a user pics a category you can just display him an embed with the commands in that category, i don't see why would you need buttons, tbh it's a pretty twisted thing
The nsfw list is like realllllyyyy long
Thats why i wanted to add pages
And navigate with the buttons
really long like? it does have more than 20-30 commands?
well, a solution would be to add another option for Part 2 of nsfw, i don't know how well works buttons with dropdowns together
Yeahh but what if some users oversee the option for part 2 of nsfw
Let's adhere to the channel topic and not shitpost, please
Are u made out of sugar
It does not appear so, no
Plus how do i make so the dropdown is only interactable for 1 user
Who initiated the cmd
What's your problem?
Because it's important to adhere to the rules to provide a better user experience for all
No problem whats ur problem
I just send a gif pls calm down
Chill out
Let's just refrain from doing that in the future, thanks 🙂
Now, back to the problem at hand
damn i left for a bit and people already arguing
why don't you make it ephemeral, like the embeds sent, this way won't really matter if more people could interact with the same dropdown
what the heck happened here
Timestamps?
!e print("hello\nworld!")
@slate swan :white_check_mark: Your eval job has completed with return code 0.
001 | hello
002 | world!
Me neither
Hello okimii 🗿
nah, one is darker than the other
Oh you mean this?
yes
Because the first one is a timestamp, the 2nd line is a single line code block
interesting
Quite
how does that work though? how do i create such a timestamp
<t:1649455760:F>
Like so?
you could use a datetime obj
hi hi
<t>
and how can I convert it into the timestamp discord thing
you could just enclose them in the datetime tags discord uses
alright, thanks a lot @slate swan @sick birch !
!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...
Does anyone know how can I host a bot for free?
No.
Not really any good options. Maybe an old laptop?
You don't need anything powerful
Oracle free tier is also an option
Literally the only choice im guessing they dont have a cc so they cant try free trials from big companies like google or they dont have an laptop sitting around i dont see other options
Dont u need a cc for that too
It's a terrible option.
Yes.
Any other options besides the one u need a cc for?
Not really
Mhmm
Replit is a terrible option though
If you have a bit of cash you could probably buy a prepaid cc from a gas station
Then buy a cheap host
Hm? Dont u need ur name and billing address for that tho
Also the phone number is probably linked to that person
Not sure.
Asking friends for an old laptop is an option. You don't need anything really powerful for hosting
Idk at what age u can get a debit card but i think its from 15 and up
I do have a debit card... But tbh I don't feel like paying 15 usd a month for a host for a single bot
There are cheaper options in the pins
so im having a problem with this reactrole code is
@commands.Cog.listener()
async def on_raw_reaction_add(self, payload):
messageID=961835417320161310
if messageID== payload.message_id:
member=payload.member
guild=member.guild
emoji= payload.emoji.name
if emoji==":black_drip:":
role=discord.utils.get(guild.roles, name="evnt")
if emoji==":BlackFire:":
role=discord.utils.get(guild.roles, name="gw")
await member.add_roles(role)```
i get an error of: UnboundLocalError: local variable 'role' referenced before assignment
i think it has to do with something around the "await member.add_roles(role) part idk
but does anyone know how to fix this issue? thx
!e
def a():
print(b)
b = 1
a()
@slate swan :x: Your eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "<string>", line 4, in <module>
003 | File "<string>", line 2, in a
004 | UnboundLocalError: local variable 'b' referenced before assignment
role doesn't exist if neither if statement fires
hmm yea so do u know how i could make them "fire"?
thats not his point
hes saying role would be undefined if both of those conditions are False
if emoji==":black_drip:":
role=discord.utils.get(guild.roles, name="evnt")
elif emoji==":BlackFire:":
role=discord.utils.get(guild.roles, name="gw")
else:
return
await member.add_roles(role)
That's one way to do it
Minimal alteration to existing code
i actually tried this with no postitive result then i changed it back to what i have
that exact same thing
then you must had something wrong.
Is there a different error message with the code I sent?
You should verify that emoji.name is either :black_drip: or :BlackFire: EXACTLY since those seem to be custom emojis?
You should print payload.emoji.name for each reaction and see what exactly you should be doing
:black_drip: etc to me seem wrong

line 93, in button_callback2
await interaction.response.defer.send_message(f"Your ticket has been created, go to {channel.mention}", ephemeral=True)
AttributeError: 'function' object has no attribute 'send_message'```
When i pressed the button it showed an error saying timedout, the button did not respond after 3 seconds that I should try interaction.response.defer
Send all of your code
its like 300 lines uhm ill see
its a class
await interaction.response.defer.send_message(f"Your ticket has been created, go to {channel.mention}", ephemeral=True)```
what of this? because that is where the problem is
Well you can send a message or defer
what do you mean
!d discord.InteractionResponse.defer
await defer(*, ephemeral=False, thinking=False)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Defers the interaction response.
This is typically used when the interaction is acknowledged and a secondary action will be done later.
This is only supported with the following interaction types...
is there a way for me to manually spawn more shards for a AutoShardedBot
!d discord.InteractionResponse.send_message
await send_message(content=None, *, embed=..., embeds=..., file=..., files=..., view=..., tts=False, ephemeral=False, allowed_mentions=..., suppress_embeds=False)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Responds to this interaction by sending a message.
You are doing interaction.defer.send_message
how to get emoji from name
No defer sends the “thinking”
Sends a message
so ineraction.response.defer(..., ephemeral=True)
sends the message
it works
its just that it times out if it doesnt respond in 3secs
what do you mean?
So to indicate that u may take over 3 seconds u use interaction.response.defer(…)
thanks, that's what i as looking for
Then interaction.followup.send(…) to respond with messages
!d discord.InteractionResponse.defer
await defer(*, ephemeral=False, thinking=False)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Defers the interaction response.
This is typically used when the interaction is acknowledged and a secondary action will be done later.
This is only supported with the following interaction types...
okay yeah that works
await interaction.response.defer()
await interaction.followup.send(f"Your ticket has been created, go to {channel.mention}", ephemeral=True)```
https://libs.advaith.io/ which library is good
Compares Discord libraries and their support of new API features
like this?
hi invisible name
really?
yes?
go for it
it's not, it sucks honestly
I don’t think interaction.py supports message based commands. I’ve heard hikari gives more control to the user and is more advanced
Idk much about it, but I just heard hikari is better from some ppl
it honestly depends on skill and preference
it does
what kind of preference
personal preference
Oh ok
preference of what
to me i like disnake because of its impl
ok
hear me out: amogus
jk, but just a question
difference between discord.Client and discord.ext.commands.Bot
and could i use discord.Client to make new discord client(i know against tos, but im not)
idk how to do it anyway
Bot = a subclass of Client, has support for text commands
Client = has support for discord stuff only
Is that even possible?
so technically, it would be possible to make a client with .Bot?
if you can make a client with .Client
yeah, it's a subclass of Client
wait what client?
The Client class is the super class of the Bot class yes
is there a way to get all the messages in a chabnnel?
Technically that's self botting.
yeah i know
yes, use the TextChannel.history method (count could be inaccurate)
!d discord.TextChannel.history
async for ... in history(*, limit=100, before=None, after=None, around=None, oldest_first=None)```
Returns an [asynchronous iterator](https://docs.python.org/3/glossary.html#term-asynchronous-iterator "(in Python v3.10)") that enables receiving the destination’s message history.
You must have [`read_message_history`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.read_message_history "discord.Permissions.read_message_history") permissions to use this.
Examples
Usage...
channel.history i believe
just limit=None to loop through all messages
ty 🙂
I have a question again I used
If they in message.content:
do some stuff
Thing is it's also detecting hey in the word they sooo.... how to fix it?
The other way around
Oh never mind misread that
is there a waqy to gather all the channels in a server (as names)with all the messages?
Name to appear with message in output log?@hybrid ravine
prety much what im tryna do is smth like xenon which creates backups.
Not familiar with xenon sorry
thats ok 🙂
In my code I got it to recognize every message in the server and print the message along with the guy who sent it and channel name
The code on first pic with some closing statements later like return and such@hybrid ravine
that is so helpful ty
lemme take a look
Sad thing it was not even the purpose of the bot
Also any commands with the word list just ignore them
Oh yeah i remember xenon
can someone help?
<discord.iterators.HistoryIterator object at 0x000001E03DBD0790>
im tryna get it to come up with the history of the channel i message in and this is the return i get
are you flattening it and are you on 2.0
super class as the parent class and not subclass as the child class!
youre trying to print the actual obj
superclass and subclass sound familliar. just misread, my bad
dont print iterator
oh yeah... how would i get the content from it?
its an iterator so just iterate through it
hey mind helping me w sum?
i need to know how to remove all members from a certain role
!d discord.Role.members | it returns a list so just iterate through it
property members```
Returns all the members with this role.
loop thru the members who have the role and post a request to remove them from that role
If it's not a bot work I have an idea
Delete the role and create role again
really depends on the situation guys! greate suggestions tho
yea i tried this but it wont work
role_names = ("Co Host")
roles = tuple(get(ctx.guild.roles, name=n) for n in role_names)
for member in ctx.guild.members:
try:
await member.remove_roles(*roles)
except:
print(f"Couldn't remove roles from {member}")
error: Command raised an exception: NameError: name 'get' is not defined
@slate swan
@hybrid ravine
well thats pretty unnecessary
just use the members property in a role obj?
^
<Message id=962162124321353868 channel=<TextChannel id=962147206276718652 name='old-yagami-over' position=0
nsfw=False news=False category_id=None> type=<MessageType.default: 0> author=<User id=920051517514453022 name='xylo' discriminator='1111' bot=False> flags=<MessageFlags value=0>>
im getting this as a return now
well youre trying to print a message obj
how would i fix that tho idk much py
^
Print message.content
Any help with this too?
Can we see your actual code as opposed to psuedo-code?
it really shouldn't. you probably tried to iterate through each char?
is there a way to define "message" Outside of a function/params?
Below this is just the token and other stuff
not sure whats the problem but theirs allot of unnecessary converting of types here
Sounds XY problem-ish. Why would you wanna do that?
I'm planning on adding more stuff
You aren't meant to instantiate discord.Member class yourself anyway
- the member class has a name attr which returns only the name of the member without discriminator
- the content attr in the message class already returns a string so does the name attr in the textchannel class
Ye I know I will remove it later
Did u mean user_message?
pardon?
im tryna just set mesage to a constant definition instead of constantly passing it thru
just make a global variable?
tbh not a big problem so idrm if theres no better way
Passing it through where?
I meant were u referring to the conversion happening for user_message?
You're not supposed to instantiate a message class by yourself
xylo are you trying to have a global base message by saving a string or?
actually yk what dw about it ima keep using it in the same way, its not that big of a deal
😅
like async def random_function_name(message)
ah just use a listener
I don't actually have idea on classes so if u could simplify it would be great
!d discord.ext.commands.Bot.listen
@listen(name=None)```
A decorator that registers another function as an external event listener. Basically this allows you to listen to multiple events from different places e.g. such as [`on_ready()`](https://discordpy.readthedocs.io/en/master/api.html#discord.on_ready "discord.on_ready")
The functions being listened to must be a [coroutine](https://docs.python.org/3/library/asyncio-task.html#coroutine "(in Python v3.10)").
Example...
This looks very similar to that one tutorial
just use the name kwarg and set it to on_message
ohh ok ty 🙂
I hope you're not following a youtube tutorial?
Yep
I can sniff out youtube tutorials from miles away
Ah, crud
Saw it coz I didn't know how to add discord stuff in python without lagging
Well, uh, ditch that code and start over before you get any more terrible code in
i cant really explain oop all together maybe check out Corey Schafer !
Ok
just use the name kwarg and set the event name their and then you can name the function anything
@sick birch
What do you mean by "without lagging"?
Async function
got it
coroutines arent "laggy"
How is an async function lagging?
i am so confused
Not lag slow
You and me both
coroutines arent slow?
Oh. Then yes, regular functions block
I'm guessing they tried to make a discord bot without using coroutines
Yes
Which I don't even know is possible
thats still not slow.
Also while you're at it, get off replit too
Ok
Then you can properly make discord bots
its just one gets executed from top to bottom while one can get executed asynchronous hence the name async functions or coroutines
its just the manor of its execution!
Not to mention regular functions block the event loop
yep
So you shouldn't mix and match if you can avoid it
So it make async faster right?
This is my first attempt
no.
Not necessarily
search for the term asynchronous
Async is used in I/O environments which isn't very demanding in the first place
So it can't be "faster"
Since you wait around 90% of the time
^
It's like one of those choose your own adventure books
Vs reading the book from cover to cover
Hmm
You go to page 5 and it says, if you want to do X, go to page 10, if you want to Y, go to page 25
its like you have a collection of 5 episodes but one watched them by order and the other watches them unordered
That's basically asynchronous
Oh
and it can be executed many times unlike sync which you would have to wait for the function to stop its execution first
depends
not really
^^^
The reason discord.py is written asynchronously is that behind the scenenes, there are a few while True loops going on, and you can't keep something running with a while True loop in the same thread
Oh
hi how can i fix the error Attribute Error: "Bot" object has no attribute "has_permissions"
It's @commands.has_permissions()
ok let me check
i thought it was done because of gateway events etc😔
That too
lmao
But primarily heartbeating and polling for events
yeah
both are while true if you do a lil source diving
it does make sense allot of things come in to play
OHH it worked TYYYY
Indeed. When you aren't using an event driven language (js for instance) you have to do things like that
make me a promise😔
And also because all commands would need to wait for the one before it to finish
yeah it would be annoying
imagine your bot not responding because the command is being used in another guild
async def get_channel(message):
guildID = message.get_guild.id()
ob = client.get_guild(guildID)
guild_name = guildID.name()
channels = []
with open(f'info/{guildID}/channels.txt', 'a') as txt:
channelcount = 0
for channel in ob.channels:
txt.write(str(channel.name) + '\n')
channelcount += 1
channels.append(channel)
would smth like this work? to get all the channel names in a guild and storer them?
uhh so the bot goes online but with the ban command it is not responding.
ban and kick*
show thw command
ok sure
!d discord.Guild.channels just iterate through all the channels and use the name attr
property channels```
A list of channels that belongs to this guild.
here
here ^
The channel name.
!d discord.ext.commands.Bot.command
@command(*args, **kwargs)```
A shortcut decorator that invokes [`command()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.command "discord.ext.commands.command") and adds it to the internal command list via [`add_command()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.GroupMixin.add_command "discord.ext.commands.GroupMixin.add_command").
im not sure if it takes positional arguments
and im not sure what the perm deco returns but you should put it above the function signature
with open("file", "a")as w:
async for channels in discord.TetxChannel.name:
w.write(channels)?
it said:name "args" is not defined
smth like that? @slate swan
not quite
where did u call *args
its not defined?
before the ban and kick codes
in the params of the functions?
what would i need to change?
should be iterating through all channels in a guild and just save the channel name with the given attr
idk waht that means
yes its not defined
for channels in guildID?
yk how u do
async def ban then have ()?
the things that go inside
of those ()
are params/ paramaters
or passintg thru arguments i think
in the list of the channels which is given with the channels property that returns a list from the Guild class
oh ok ty
❤️
yes it did have this
so is it possible to fix the args not defined error
wait send a ss opf ur code now
ok
so you want to see my entire code or
just the ban and kick
🤔
no
uhh
dnt do that..
I didn't knew you are here too
u need to put *args and **kwargs in the function, not the decorators
oh ok
so I have to remove the brackets?
why are you passing an unknwon amount arguments to a deco? it should be done in the parameters in the decorator and no need for it
should read again on what i said.
and i recommend you do learn a bit of python
so where should I put it
import discord #Imports the discord module. from discord.ext import commands #Imports discord extensions. #The below code verifies the "client". client = commands.Bot(command_prefix='pb?') #The below code stores the token. token = "Your token" ''' The below code displays if you have any errors publicly. This is useful if you don't want to display them in your output shell. ''' @client.event async def on_command_error(ctx, error): if isinstance(error, commands.MissingRequiredArgument): await ctx.send('Please pass in all requirements 🙄.') if isinstance(error, commands.MissingPermissions): await ctx.send("You dont have all the requirements 😠") #The below code bans player. @client.command() @commands.has_permissions(ban_members = True) async def ban(ctx, member : discord.Member, *, reason = None): await member.ban(reason = reason) #The below code unbans player. @client.command() @commands.has_permissions(administrator = True) async def unban(ctx, *, member): banned_users = await ctx.guild.bans() member_name, member_discriminator = member.split("#") for ban_entry in banned_users: user = ban_entry.user if (user.name, user.discriminator) == (member_name, member_discriminator): await ctx.guild.unban(user) await ctx.send(f'Unbanned {user.mention}') return #The below code runs the bot. client.run(token)
what is this
it seems weird In chat
looks like javascript when minified
...
it looks like a nightmare to me
it broke every single pep to exist
it follows 9001 bro
true
;))
so where can I put it
all of them?
Uh
no only the ban and kick
theres probably something wrong with it
show code
ok then
here is the code
show how you invoked the command
wdym
how you triggered the command
run button
bro
oh wait I dont have the trigger
I am dumb 😭
So I found a code on the internet I just need to know how to make the code work. Here is the code:
That sentence breaks my soul
Member has a mention attribute
!d discord.Member.mention
property mention```
Returns a string that allows you to mention the member.
I don't know what the fuck is mention.mention though
its the remove all members from a role i been trying for hours
im using role ids with something else
so i cant delete it
its for event purposes to remove all co hosts everytime the endevent cmd is used
!d discord.Role.members
property members```
Returns all the members with this role.
You can loop through the list of members that have the role
And then remove the role with
!d discord.Member.remove_roles
await remove_roles(*roles, reason=None, atomic=True)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Removes [`Role`](https://discordpy.readthedocs.io/en/master/api.html#discord.Role "discord.Role")s from this member.
You must have the [`manage_roles`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.manage_roles "discord.Permissions.manage_roles") permission to use this, and the removed [`Role`](https://discordpy.readthedocs.io/en/master/api.html#discord.Role "discord.Role")s must appear lower in the list of roles than the highest role of the member.
It can make a lot of API calls though
Depending on how many members have the role it can get you rate limited
You'll have to wait for someone else to come. I'm not really in the mood to help someone who doesn't know python
Sorry
You could just clone the role, then delete the role
This would get rid of all the multiple API calls
Already gave him the suggestion
Oh I didn't scroll up high enough
Make?
RuntimeError: Event loop is closed
For cloning a role completely, that is all permissions (channels), is there an easier way than iterating through each channel and setting it?
Just a warning
is it possible for the bot to send a message in all the guilds it is in
if yes can i have an example
to all the guilds at once
yes ```py
for guild in bot.guilds:
... # get a channel and .send a message
not possible because of how d.py handles rate limits
hmm
then await message.send("...")?
used ctx.send but only sends the message in the channel/guild i sent the message
that doesn't make much sense
await guild.text_channels[0].send("yo")```
k ty
async def on_message(message):
if message.content.startswith('!ip'):
embedVar = discord.Embed(title='`IP`', description= '**connect 51.210.223.221**', color=0xe8c02a)
await message.channel.send(embed=embedVar)```
why doesn't this work?
Which part of it doesn't work?
when i type !ip it doesnt send a message
Does your bot have message intents?
used the wrong command 😆 sorry

is there a possible eh for ratelimits?
what's eh?
error handler*
how do i send custom emojis?
whats the best discord.py alternative now ?
I mean i like disnake
<:EMOJI_NAME:EMOJI_ID>
get it by putting a \ in front of the emoji when sending it
I suggest just a command for this
Rather than using a on_message event
Yes discord.py is being maintained again
By danny
should i stay with discord.py...have not had any issue till now.
what zo you mean put a \ , in the code?
Why is “message” a invalid synax
... discord.Textchannel, *, message
discord.TextChannel, *, message):
it's not
you're missing a comma next to discord.TextChannel
Oh
@formal basin take .... as whatever was there
💀
Show the commands parameters
Is anyone else's discord dying wtf
💀i doubt if you've correct intent
owo?
No
wdym? ;'/ dying?
Put a \ infront of the emoji and send it here in discord
Example 😳
\😳
Turns to that
\😳
You can also get custom emojis
show intent @formal basin
I keep reconnecting but it isn't my wifi
or like code ig if you're comfortable iwth it
ooohhh okk
💀 that sounds like a problem tbh
It's been like this since earlier
My intents are crazy
Started today
vsc, right?
N
Nvm fixed my error
gg
Also why are you using a a f-string
hmm try to re-install ig?
Just send the message variable
Cause you can if you want
You don't need a f-string
Yeah but it isn't needed and it's useless
Yes I do what if someone did {member.name}
ok ok cool
What?
first, i hope rest of ur intentation si correct
On the command
and this thing is inside ur welcome_setup function
Even if you pinged someone using the command
It'd ping them back
It will send there message
💀
Also why would they say {member.mention}?
Because I’m doing a welcome setup
And I’m just adding custom messages
but u aren't adding that 'message' in your json.. if u do that.. then ok
but here u are simply sending it in the channel :'/
Ok
Yes
Also why is everything inside your with open?
What do I replace here
eh? message.contex?
Idk I thought that would work lol
there is message.content
!d discord.message.content
No documentation found for the requested symbol.
The actual contents of the message.
idk how to use this bot lol
Well content doesn’t work
i don't even know what u tryna do lol
i just told that there is nothing like message.context
there is message.content
I just need to display my message into my json file
Or dump
💀 bro just show me the whole code of welcome setup.. everytime u show bits of the code.. & some or the other shit happens
this function welcome_setup, use pastebin if u want
!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.
Which line
all
All
How?
intentation is gap of 4 space
Time to implement PEP 9001 👀
not 2
OwO is it better than PEP 8?
You want me to indent from line 496 to 504
idr number exactly nvm
🙂 bro, tell me one thing.. why r u not using vsc? this repl.. i never used.. idk how u gonna correct ur intentation... and since it's here.. i believe that whole file gonna be like that
Rip @lament depot
but ig ur code is working right? so .. ahahah idk me nub
:'/
😐 oh i see
Fixed my issue
But not this
what
What do I put there
Ok
because it should be taken from the parameter that you've passed in the welcome_setup funciton
Oh
Ok
I have a problem
It’s not sending the message
And I got no error
Anything wrong here
its not a thing
Ok how could I get the message
!d discord.TextChannel.fetch_message
await fetch_message(id, /)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Retrieves a single [`Message`](https://discordpy.readthedocs.io/en/master/api.html#discord.Message "discord.Message") from the destination.
you fetch message from a text channel not guild
and you need to send the message's content not the whole object
plus, what if the welcome message gets deleted
That’s fetching the id
what
Here
you want to fetch username and discriminator?
...
No…
hm catch me up
I want to fetch my message from the json file
what's currently in the welcome.json now?
you are over-writing the message, delete the second line
Like a couple of channel ids and names also 1 message
Ok
Done
Deleted it
it should work now
Ok
@slate swan with open('jsonfile') will load the json too?
Yes
so it's the same as doing
json.load(file)
well it will
interesting
It will load the file, but won't parse the json
ah that's what I thought it did
@formal basin did it work?
No
what's it doing
Not sending the message
maybe because you have 2 message = ?
Yes I deleted the bottom one
Is that what I put await channel.send(f”{message}”)
Anyone know why I keep getting this error even though ive only done the login output?
TypeError: Client.event() missing 1 required positional argument: 'coro'
import discord
from discord.ext import commands
import requests
import json
token = 'token'
intents = discord.Intents(messages=True, guilds=True)
bot = commands.Bot(command_prefix='.', intents=intents)
@bot.event()
async def on_ready():
print('The {0.user} bot has logged in!'.format(bot))
bot.run(token)
don't call event
don't use requests in an asynchronous context, use aiohttp instead.
I wouldn't recommend using on_ready for that tbh
ive seen that template sooo many times, which yter recommends that
its in the docs
I don't know
@blissful sparrow reasoning why I don't recommend it is because you can only have one on_message.
is this all of the code.?
im yet to add more functions but im trying to get the bot up first
your error is @bot.event(), in discord.py for events you don't need the (), so it would be @bot.event
@blissful sparrow
^^^
if you take another glance at the docs you can see that there are no parentheses either
sometimes you just gotta look it over again
this one has it cuz they are using discord.Client not commands.Bot
this is false information actually
you dont "call" the events, they get triggered automatically
you don't need the () either way 🤣
i saw paren on on_ready and though it was the deco lmao
just use listen
it's not for me
subclass and enjoy
nice
Listen is better then on_message
um?
is it now
listen/event is a decorator, while on_message is an event function
Listen is the same thing tho
And on_message stops your commands from working
It’s not?
only if you use it incorrectly
where do you use listen? xd
bot
