#discord-bots
1 messages ยท Page 1114 of 1
yeah?
@cog_ext.cog_slash(name="uwu", guild_ids=[933980948268208130],options=[
create_option(name="Partner Ad",
description="Type the AD here",
option_type=1,
required=True)
])
async def uwu(self, ctx, message):
await ctx.send(message)
``` so like this ?
ok uwu
alright thanks!
gets ashley's habit of uwu, uwu
no, that's mine, you don't have any right to use it in this channel
im so funny
uwu sry
@slate swan using discord-py-slash-command for that attachment stuff
@cog_ext.cog_slash(name="uwu2", guild_ids=[933980948268208130],options=[
create_option(name="attach ur meme here",
description="memeee",
option_type=11,
required=True)
])
async def uwu2(self, ctx, attachment):
await ctx.send(attachment)
``` right way ??
uwu no
i'm suing you
UwU bet
typehint attachment with discord.Attachment
dunno if that works
typehint ? how ?
...?
attachment: discord.Attachment
guys help how i can set 2 prefixes
Bot(command_prefix=(prefix1, prefix2))
thanks
you can pass any iterable
Alr
command_prefix = (prefix, uwuprefix) # or [prefix, uwuprefix], {prefix, uwuprefix}, {prefix: 0, uwuprefix: 0} :pensive:
what?? i didnt know that you can use 2 prefixes? but if the two prefixes would be like ! and ? would they work for every command? like ?help and !help?
the dict looks cursed though
Yea
yeah they work for every command
oh okay thanks
command_prefix=map(lambda x: globals().__setitem__(f'prefix{x}', x),range(10))
๐ do you want me to leave this server or what
You can't
I don't have enough patience to handle those who don't know python and want to develop a bot
we need you
I barely help anyways ๐
Better than nothing
maybe
@client.command()
async def get(ctx):
embed = DiscordEmbed(title="test1", description="", color=0x00ff00)
embed.add_embed_field(name="test2", value="", inline=False)
await ctx.send(embed=embed)
``` any idea why it is not sending the embed, sorry i've been out of dpy for about half a year
DiscordEmbed? what lib is that bro
i think u need a description on ur embed, and what is DiscordEmbed?
oooooo i forgot to add a . after discord my bad
and it's add_field not add_embed_field
description shouldn't be left empty, rather just dont define it, and the value always need to be something
well it is lowercase too 
Uhm duh?
!d discord.Embed.add_field
add_field(*, name, value, inline=True)```
Adds a field to the embed object.
This function returns the class instance to allow for fluent-style chaining. Can only be up to 25 fields.
yeah they typed add_embed_field in their example
i know but github copilot suggested me that so i thought it may be
i heard dpy got a new update that's why
imagine using copilot
damn copilot ๐คฆ
Oh sorry
what's wrong with it?
Lol copilot suggests add_field lmao
all my homies hate github copilot
Task exception was never retrieved
future: <Task finished name='Task-1' coro=<SlashCommand.sync_all_commands() done, defined at /opt/virtualenvs/python3/lib/python3.8/site-packages/discord_slash/client.py:364> exception=HTTPException("400 Bad Request (error code: 50035): Invalid Form Body\n'uwu'.options.0.name: String value did not match validation regex. Command name is invalid")>
Traceback (most recent call last):
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord_slash/client.py", line 440, in sync_all_commands
raise ex
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord_slash/client.py", line 420, in sync_all_commands
existing_cmds = await self.req.put_slash_commands(
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/http.py", line 254, in request
raise HTTPException(r, data)
discord.errors.HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body
'uwu'.options.0.name: String value did not match validation regex. Command name is invalid
``` wtf is this ๐
basically your cmd name is invalid
why....
do you not see that i forgot to add a . after discord in embed var, that's why it suggested me that add_embed_field
whats wrong in uwu
i'm suing you again
UwU bet
what args does ur command have
embed = discord.Embed(title=..., description=..., colour=...) #all the arguments in the Embed __init__ are optional
embed.add_field(name=..., value=..., inline=...) #every argument except inline is required
#to set the value to be invisible
embed.add_field(name="uwu", value="** **") #alternatively use "_ _" instead of "** **"
that's how you create an embed
only 1...for message user input
color > colour ๐
what's the name of the arg
same thing, I have a habit of writing colour
i know man and i've already created it i JUST FORGOT TO ADD A DOT AFTER DISCORD that's what ive been saying the issue has been resolved
what the-
in the codebase color is aliased to colour
i dont think i made it an arg
@cog_ext.cog_slash(name="partners", guild_ids=[933980948268208130],options=[
create_option(name="Partner Ad",
description="Type the AD here",
option_type=1,
required=True)
])
async def partners(self, ctx, message):
await ctx.send(message)
nice
!d discord.Embed
class discord.Embed(*, colour=None, color=None, title=None, type='rich', url=None, description=None, timestamp=None)```
Represents a Discord embed.
len(x) Returns the total size of the embed. Useful for checking if itโs within the 6000 character limit.
bool(b) Returns whether the embed has any data set.
New in version 2.0.
For ease of use, all parameters that expect a [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)") are implicitly casted to [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)") for you.
Changed in version 2.0: `Embed.Empty` has been removed in favour of `None`.
i know
see that's the problem, name has a space and an uppercase letter
change Partner Ad to partner-ad or something
i guess i'll just step out than to argue with you guys
i kinda forgot that it was named options instead of args, mb lol
Task exception was never retrieved
future: <Task finished name='Task-1' coro=<SlashCommand.sync_all_commands() done, defined at /opt/virtualenvs/python3/lib/python3.8/site-packages/discord_slash/client.py:364> exception=HTTPException("400 Bad Request (error code: 50035): Invalid Form Body\n'partnerrr'.options.0.required: Required cannot be configured for this type of option")>
Traceback (most recent call last):
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord_slash/client.py", line 440, in sync_all_commands
raise ex
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord_slash/client.py", line 420, in sync_all_commands
existing_cmds = await self.req.put_slash_commands(
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/http.py", line 254, in request
raise HTTPException(r, data)
discord.errors.HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body
'partnerrr'.options.0.required: Required cannot be configured for this type of option
you can't set required for this type of option
no one is arguing with you
okay bye
you rude
whatever
its for message input
try removing required=True
show the partnerrr command head to the tail
error
they're not understanding the fact my issue has been resolved ๐
@cog_ext.cog_slash(name="partnerrr", guild_ids=[933980948268208130],options=[
create_option(name="partnerrr",
description="Type the AD here",
option_type=1,
required=False)
])
async def partnerrr(self, ctx, message):
await ctx.send(message)
i said remove not make it false ๐
I was just typing something and I sent it ๐ญ what'd I argue about
when i removed it...it caused an error
they're gone now ash stop
so i made it false..
o ic, dunno what to do then
@slate swan head to tail UwU
it's alright man, my fault
what lib is that?
discord-py-slash-command
no, not gonna do that
not gonna do what
dwa
tf is dwa
cog_ext ain't a thing in that lib..
its working ๐ all commands work
wha...
@cog_ext.cog_slash(name="ping", guild_ids=[933980948268208130])
async def ping(self, ctx):
embed = discord.Embed(title="Bot's latency",description=f'Loading :loading: ',
color=0xE6E6FA)
embed1 = discord.Embed(title="Bot's latency",description=f'**Pong!** Latency: {round(self.bot.latency * 1000)}ms',
color=0xE6E6FA)
message = await ctx.send(embed=embed)
await asyncio.sleep(1)
await message.edit(embed=embed1)
see lmaoo
dont worry about it
can I see where you are importing cog_ext from
from discord_slash import cog_ext, SlashContext
``` ok my bad
its discord_slash
๐ญ
nvm
what does option_type do?
it is like it defines if the user input will be a channel or a role and all if its not the same it would say invalid
mhm?
ew, I see
same
ok ๐ถ
I'll just go to sleep instead, good night
and goodluck
@client.event
async def on_ready():
print("Game time!")
why this no work
ok im done with this shit now i aint using slashhssss
in discord.py-self
define no work
we cant help you with that....
!rule 5
5. Do not provide or request help on projects that may break laws, breach terms of services, or are malicious or inappropriate.
maybe your bot isn't starting up
that does not break laws..
it does
nobody asked, we can't help
just printing hi when a bot is ready?
self-botting is against discord's tos
@bot.command()
async def play(ctx, *, search):
query_string = parse.urlencode({"search_querty": search})
html_content = request.urlopen("http://www.youtube.com/results?" + query_string)
search_results = re.findall('href=\"\\/watch\\?v=(.{11})', html_content.read().decode())
await ctx.send("http://www.yotube.com/watch?v=" + search_results[0])
like it prints after long time
nice
i have a problem with that
shouldnt the search_querty key be search_query, I mean by common sense
read the error
search_results is None
@paper sluice @slate swan thx for helping very useful
๐
nice sarcasm
yea but idk how to fix it
print html_content and see if its the string u want to search or not, i told that b4 as well
its the same
@shell wing why arent you using the latest version for discord-py-slash-command?
I'm tripping with words smh
i tried shifting to it yesterday but wasnt able to...so im not trying it again rn lmao
ill do it on a test bot once i got plenty time
the same index error
how does printing html_content give index error

then maybe it's your internet if you are hosting locally
LAG
i also tried it on heroku
still takes long
where i should print it?
Sad
comment ctx.send and print
html_content = "hi"
print(html_content[10])
no one said to subscript
..
@bot.command()
async def play(ctx, *, search):
query_string = parse.urlencode({"search_querty": search})
html_content = request.urlopen("http://www.youtube.com/results?" + query_string)
search_results = re.findall('href=\"\\/watch\\?v=(.{11})', html_content.read().decode())
await ctx.send("http://www.yotube.com/watch?v=" + search_results[0])
can you do it please? ๐๐
add some lovey-touchy emojis, maybe he'll do it then
lmaooooo
async def on_server_join():
print=("joined one server!")```
guys i did this but its not working
helppppppppp
it's on_guild_join
Yeah indeed.
in the 1.0 version server has been replaced with guild throughout the codebase
they also have an equals after the print
which is valid syntax but it will not do what you think it'd do
.
hmm and how i can set a role id for a cmd i forget
@commands.has_role()
role id as in?
just got to know we can't use Ephemeral messages in discord.py
can we use it in nextcord?
and am i going to regret shifting to nextcord
personally i like disnake
music bot moment
that's not the case, I dont know who told you such crap but discord.py is so much better than nextcord
am actually trying to make an anonymous message kinda thing, so if the user uses slash command, the bot confirms it but uses ephemeral instead of just telling it everyone
then use an embed from the bot
but i have no idea how i am supposed to add it, can't find it in the docs either
huh?
about how i can enable ephemeral
just set ephemeral=True in the send_message method
is that it?
damn.
How to add a user's avatar to the background and when the account was created, etc.?
client.set_thumbnail?
How to use slash commands in discord.py?
!d discord.User.created_at
property created_at```
Returns the userโs creation time in UTC.
This is when the userโs Discord account was created.
and what background
oh they're probably generating an image using PIL
no
A complete slash command bot - https://github.com/Rapptz/discord.py/blob/master/examples/app_commands/basic.py
Slash Commands - https://gist.github.com/AbstractUmbra/a9c188797ae194e592efe05fa129c57f
what
weird ๐
@slate swan Where is the example/QuickStart and API reference for slash commands?
Thx, is there an example usage of slash commands using this up to date API reference?
https://github.com/Rapptz/discord.py/blob/master/examples/app_commands/basic.py
I can always give uwu examples if you require ๐
i dont know if they're still working on a guide to app commands
i still sometimes reference their gist, even tho its pretty out of date
fr
it's not that hard to make those slash commands once you got an example
but explaining it to someone who still is confused is pain in the ass
someone explained it to me, sorry for them
when i came back like a few days ago to add a new cog + group, i found out about their GroupCog and that the group parameters were passed to the class itself, but then i had to look in the source code to figure out that i need to assign __discord_app_commands_default_guilds__ = [int, ...] to specify the guild ids
I think I'll just create a temporary gist instead ๐
why temporary
@heady sluice can you help me with this?
this is the problem
not youtube
๐ฆ
search results is empty
and how to fix it?
get something in search results
like what?
search_querty?
ok i alredy saw that
and pretty sure you cant search for your stuff with spaces, you need to join them
eh just explaining the usage of app commands and some examples for slash commands with v2
ur requests should be ansyc
idk how to fix it
PS D:\vsc\Spiral> & C:/Python310/python.exe d:/vsc/Spiral/spi2.py
Traceback (most recent call last):
File "d:\vsc\Spiral\spi2.py", line 7, in <module>
slash=SlashCommand(bot,sync_commands=True)
NameError: name 'SlashCommand' is not defined
PS D:\vsc\Spiral> pip install discord-py-slash-command
Requirement already satisfied: discord-py-slash-command in c:\python310\lib\site-packages (4.2.1)
Requirement already satisfied: aiohttp>=3.8.1 in c:\python310\lib\site-packages (from discord-py-slash-command) (3.8.1)
Requirement already satisfied: multidict<7.0,>=4.5 in c:\python310\lib\site-packages (from aiohttp>=3.8.1->discord-py-slash-command) (6.0.2)
Requirement already satisfied: attrs>=17.3.0 in c:\python310\lib\site-packages (from aiohttp>=3.8.1->discord-py-slash-command) (21.4.0)
Requirement already satisfied: yarl<2.0,>=1.0 in c:\python310\lib\site-packages (from aiohttp>=3.8.1->discord-py-slash-command) (1.7.2)
Requirement already satisfied: aiosignal>=1.1.2 in c:\python310\lib\site-packages (from aiohttp>=3.8.1->discord-py-slash-command) (1.2.0)
Requirement already satisfied: frozenlist>=1.1.1 in c:\python310\lib\site-packages (from aiohttp>=3.8.1->discord-py-slash-command) (1.3.0)
Requirement already satisfied: async-timeout<5.0,>=4.0.0a3 in c:\python310\lib\site-packages (from aiohttp>=3.8.1->discord-py-slash-command) (4.0.2)
Requirement already satisfied: charset-normalizer<3.0,>=2.0 in c:\python310\lib\site-packages (from aiohttp>=3.8.1->discord-py-slash-command) (2.0.12)
Requirement already satisfied: idna>=2.0 in c:\python310\lib\site-packages (from yarl<2.0,>=1.0->aiohttp>=3.8.1->discord-py-slash-command) (3.3)
WARNING: There was an error checking the latest version of pip.
PS D:\vsc\Spiral>
``` mmm
reintall the pip versions
run python3 -m pip install -U pip
and do, python3 -m pip install discord-py-slash-command
wait, why are you using a third party lib
something happened to my pip eh?
prolly
nothing happened to pip you just didn't import SlashCommand from the library
nvm my bad
didnt see that was a warning
whitelisted = fields.ManyToManyField("Bot.UserModel", on_delete=fields.SET_NULL, null=True)
issue coming from this model...
Hi
I am trying to host my discord bot on a vps, installed everything that is required to run the bot, and 99% of the features doesn't work.
When I start on my pc, they do work.
probably an issue with the vps you're using
Is it throwing any exceptions? Any logs?
imma try to show
how can I screenshoot on the vps to save it on my pc?
Can anyone help?
this is the second vps..
It's just messages
?[30;1m2022-06-22 12:29:51?[0m ?[34;1mINFO ?[0m ?[35mdiscord.client?[0m logging in using static token
?[30;1m2022-06-22 12:29:52?[0m ?[34;1mINFO ?[0m ?[35mdiscord.gateway?[0m Shard ID None has sent the IDENTIFY payload.
?[30;1m2022-06-22 12:29:52?[0m ?[34;1mINFO ?[0m ?[35mdiscord.gateway?[0m Shard ID None has connected to Gateway (Session ID: some random things).
yo?
yeah
these are the only thing
that shows in terminal...
well, when I start the bot on my pc, everything works
when I start on the vps, only some featrues work
I think no
but everything is installed
I think so?
on_raw_reaction add only
other events or commands doesn't work
ofc ๐
yes
not slash commands.
I am not idiot man. When I start the bot on my pc, everything works, when I start on the VPS, not much things
still not working rn
man u think I am an idiot
hey guys, im trying to make my bot send embeds using a paginator, but the image files are local so i cant update them with message.edit, is there another way?
pip install -U git+https://github.com/Rapptz/discord.py
I can pay money if this error gets fixed
thinking that I am an idiot and thinking that I know nothing, doesn't help
Gathering information is the first step to figuring out what's wrong..
anyone fix ๐
Nobody knows what you did to host your bot, hence why they ask. To make sure every step is correct and build a understanding of how your setup is.
have you tried going to the developer portal and toggling the priviledged intents button?
not sure if that solves it but you can try
!rule 9
so anyone?
I will offer you 0 cents on the dollar, like I said it's just messages not message content.
ok
Whether guild and direct message related events are enabled.
This is a shortcut to set or get both guild_messages and dm_messages.
This corresponds to the following events...
Whether message content, attachments, embeds and components will be available in messages which do not meet the following criteria:
โข The message was sent by the client
โข The message was sent in direct messages
โข The message mentions the client
This applies to the following events...
@pseudo zealot Yerl provided a possible solution, I didn't take into consideration if you had 2.0 or 1.7.3
can any1 help?
still not working ๐
What did you type and what version do you have?
2.1.2 version

Ratelimit go 
when I typed intents.messages = True
how to fix
I am trying to host my discord bot on a vps, installed everything that is required to run the bot, and 99% of the features doesn't work.
You aren't providing any info as to why.
But there is no errors
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.
ok
on_message
on_message events not working for example
it is enabled ofc, when I start on my pc, they are working
when I start on my pc, they are working
Dunno I personally use as paid vps so I don't have a lot of issues 
mine is paiod from azure
Ah azure is a pain.
Hey @austere gust!
You either uploaded a .txt file or entered a message that was too long. Please use our paste bin instead.
I am hosting my fivem server on it too
I just don't want to pay for bot hosting too
Just look at a VPS like a wireless VM that you can access remotely.
the code is kinda weird, but yeah
everything works
I can't understand aswell
ok sure
2.0.0a3575+g45d498c1
I downloaded the same version
they are enabled on the website
this isn't on my code but still works on my pc, but ok I put it. Lemme try
yeye done alr
oy bros
thank you soo much
hey how i can set a cmd that locks a channel for @evreyone
now everything is working proplery โค๏ธ
big thanks @slate swan @slate swan
and sorry if I was rude ๐
oh wait not everything
@slate swan the ticket system doesn't wanna work
canyou pls???
async def lock(self, ctx: commands.Context)
channel = bot.get_channel(whatever_id)
guild = bot.get_guild(whatever_id)
channel.set_permissions(guild.default_role, read_messages=True, send_messages=False)``` itsnot working...
doesn't create channel
no shit
he obviously just put it there for an example
please use your brain before you try to help people
oh
Imma copy the error @slate swan
async def lock(self, ctx: commands.Context)
channel = bot.get_channel(989043208438841345)
guild = bot.get_guild(whatever_id)
channel.set_permissions(@everyone, read_messages=True, send_messages=False)``` not working
you need to fetch the channel id of wherever you execute that command
then using that id, store it in a variable
code block
?
!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.
it is an error only
same shit, works on my pc, doesn't work when I start on the vps
idk
nvm
can someone teach me how to create a welcome cmd
i mean not a cmd
just a welcome
welcome message?
@bot.event
async def on_member_join(member):
channel = bot.get_channel(channel_id)
await channel.send(f'Welcome{member.mention}!')
await member.send(f'Something that the bot will send as a private message to the member{member.mention}!')
Yo can someon dm me i need help I want my command to be run by members every 24 hours and if they try to run it before 24hrs they get an error message thst they need to wait 24hrs
@slate swan cool, the ticket is opened now, but when I press the claim button, same shit (interaction failed)
replace all buttons with self, interaction: discord.Interaction, button: discord.ui.Button?
oo
ok ty
why it have a eror
async def on_member_join(member):
channel = bot.get_channel(989043208438841345)
embed.set_thumbnail(url=member.avatar.url)
await channel.send(f'Welcome To Wibuos Army{member.mention}!')
await member.send(f'Welcome To Wibuos Army{member.mention}!')```
!traceback you didn't define embed
Please provide the full traceback for your exception in order to help us identify your issue.
While the last line of the error message tells us what kind of error you got,
the full traceback will tell us which line, and other critical information to solve your problem.
Please avoid screenshots so we can copy and paste parts of the message.
A full traceback could look like:
Traceback (most recent call last):
File "my_file.py", line 5, in <module>
add_three("6")
File "my_file.py", line 2, in add_three
a = num + 3
TypeError: can only concatenate str (not "int") to str
If the traceback is long, use our pastebin.
class discord.Embed(*, colour=None, color=None, title=None, type='rich', url=None, description=None, timestamp=None)```
Represents a Discord embed.
len(x) Returns the total size of the embed. Useful for checking if itโs within the 6000 character limit.
bool(b) Returns whether the embed has any data set.
New in version 2.0.
For ease of use, all parameters that expect a [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)") are implicitly casted to [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)") for you.
Changed in version 2.0: `Embed.Empty` has been removed in favour of `None`.
oy big thanks @slate swan
@austere gust chek your dm plsss
you have to create an embed first
nvm'
simply calling the set_thumbnail method wont work
what ticket-
wym
you mean ticketing system or what?
bot creates a channel for mods and that person created ticket
oh lmao
soo..
do u know how?
offffffffffff
bruh u was typing and i was thinking you are sending me the code.......๐
!d discord.Guild.create_text_channel
await create_text_channel(name, *, reason=None, category=None, news=False, position=..., topic=..., slowmode_delay=..., nsfw=..., overwrites=..., default_auto_archive_duration=...)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Creates a [`TextChannel`](https://discordpy.readthedocs.io/en/latest/api.html#discord.TextChannel "discord.TextChannel") for the guild.
Note that you need the [`manage_channels`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Permissions.manage_channels "discord.Permissions.manage_channels") permission to create the channel.
The `overwrites` parameter can be used to create a โsecretโ channel upon creation. This parameter expects a [`dict`](https://docs.python.org/3/library/stdtypes.html#dict "(in Python v3.10)") of overwrites with the target (either a [`Member`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Member "discord.Member") or a [`Role`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Role "discord.Role")) as the key and a [`PermissionOverwrite`](https://discordpy.readthedocs.io/en/latest/api.html#discord.PermissionOverwrite "discord.PermissionOverwrite") as the value.
Note
Creating a channel of a specified position will not update the position of other channels to follow suit. A follow-up call to [`edit()`](https://discordpy.readthedocs.io/en/latest/api.html#discord.TextChannel.edit "discord.TextChannel.edit") will be required to update the position of the channel in the channel list...
how would u go about tracking ur api calls
API calls in python of API calls to an external website?
to discord my boy
Can anyone give me that tutorial site link pls
A tutorial to help you make better Discord bots.
Ye thanks
I needed it for my friend
I would modify the discord.py package and find a function which executes all outgoing traffic and add logging to that
slash commands work on webhooks right?


wdym? give example
Yea, interaction object is a webhook
thanks, Hunter
wrong channel
Hey there, is there a way to create a color picker in discord py?
wdym by a colour picker exactly?
Some kind of slider to pick a color, or like a rectangle with all the colors to pick from
well uh i dont think its possible to make a slider inside discord lol
i think the easiest way would simply be to let the user input a hex value
well theres no way to have an exact colour picker inside discord
u could make a drop down menu with like 10 colours
but if u want to have an exact colour u would need a hex or rgb input or something
that's why I wanted to make a color slider or something
unfortunately thats not possible in discord atm lol
๐ nice command idea brb
.color hex #8BE6D8 sad noises
๐
making a slider on discord is not possible as you might be aware, read the chats below that.
im aware,
they need some way to allow a user to get color hex? and thats basically it
why cant they just redirect to a color picking hesx
or even better like ask for the basic color in autocomplete then send a dropdown with color emojis
how many emojis?
discord has a limit on reactions?
yes in dropdown its 25
the autocomplete i made can process 740+ colors.
the gif says otherwise
boi
im saying you could also just have basic colors and then use a dropdown with variations of those colors
and since dropdown options have an emoji space you could technically have like colored blobs
also whats the reaosning behind using hikari?
is it better?
best lib for python discord imo.
discord.py ??
and yeah, i can provide explanations.
pls do, im curious
I'll backup
- discord.py is very badly typed. there are many #type: ignore
- hikari is not cache dependent, i.e. the 200-300mbs of ram discord.py uses for an average bot is not a case in hikari, you have full control on the cache
- documented and persistent restclient and cache ( people using discord.py arent even aware of the HTTPClient???)
- multiple command handlers
- hikari is faster
- more object oriented
what would the use be for http cleint?
thats basically everything your bot is dependent on, sir.
discord.py has an httpclient...
discord.py uses that without exposing the users.
wdym exposing the users
*exposing to the

whats the issue with that?
its not like httpclient is some malicious thing
I'm not going to navigate to the discord folder
thats not an issue, never said discord.py is bad, i just said how "hikari is better."
basically cpp of discord api wrappers
yes
i'm bad with anything typing ๐ญ
i dont understand it after basic stuff. like generics make me want to die
thats not the point, the point is: in hikari you can use the RestClient without a gateway.
fr we're so dumb ๐ญ
heh
isn't that what you said
May i know the official library for Buttons, Select Menus, User commands etc
is there none yet
Where can read to get started
yea almost all if not all at this point support interactions
no, definitely, i think y'all should look into https://discord.dev and have a look on how the discord api actually works.
making a gateway connection is not necessary at all, its just a medium to exchange the events, you can do stuff like sending messages, kicking members, updating objects and other POST, GET and PATCH requests without a gateway. discord.py abstractions will never allow you do that. as it totally relies on the gateway
libraries like hikari and discord.js allows you to make a rest only client... which basically is just used to get and send requests. basically what an interaction server or a dashboard would need.
Integrate your service with Discord โ whether it's a bot or a game or whatever your wildest imagination can come up with.
^
so the http bot thing
pure http
connect internet but not that much and use
guys how to make mute cmd and set a role for muted
You can do Timeout now
Then make a role with send messages disabled perm
HTTPClient is the class which makes requests in discord.py
RestBot is the class which makes requests in hikari
thats basically it.
isnt that just timeing out??
so how to make a cmd with bot to give that role to another persons
he wants to make mute role
and discord does the unmuting for u
role = xyz role
await member.add_roles(role)
u need a member and role object
there's a lot, http is a protocol, REST is a type of api
but the libraries chose their own class name, even tho having same functionality
can u send all of the code im beginner
you can read documentation, i already gave u a basic idea and the code. you just need the member and role oibjects
::|||
*gateway,
it just helps you receive the events from discord, nothing else.
says ur a develloper in ur discord bio :))
for the person who asked why should the http be revealed.
it saves you from 2-3 extra operations/requests
how would you normally send a message to a channel if you have its id
use the bot's cache to get the channel and then send api request to send message through the function
you rarely ever fetch stuff
you can bot.http.send_message(id, "this is the message")
how to timeout members full cmd pls
Are you looking to create a Discord API framework?
write it urself
howwwwwwwwwww
!d discord.Member.timeout
await timeout(until, /, *, reason=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Applies a time out to a member until the specified date time or for the given [`datetime.timedelta`](https://docs.python.org/3/library/datetime.html#datetime.timedelta "(in Python v3.10)").
You must have the [`moderate_members`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Permissions.moderate_members "discord.Permissions.moderate_members") permission to use this.
This raises the same exceptions as [`edit()`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Member.edit "discord.Member.edit").
there u go
YEEEeeS, I have a lot of code where I need to fetch an object even though I already have the ID to make the request
that's exactly one of the cases where a RestClient gets handy
you can always access the bot's http tho
still, discord.py's http is really messed up
the send_message method will give you a PartialMessage which misses many attributes of a Message class
eh wrong enter press, wait
HTTPClient & RESTClients' will be a library abstraction, you don't really need to know them persay
If I want to edit a channel, with discord.py I still need to fetch the channel just to edit it. If the API methods are exposed, I can just directly edit the channel by the ID that I have.
tbh i really love using the REST classes instead of making requests thru the discord Model methods
If only restcord wasn't in PHP
yuo can just
bot.get_channel
```??
It's undocumented still. Not surprised if it will be changed to _http in 2.0
use the cache, dpy cache is quite decent
a cache call, which is not even needed.
Yup
Decent kek? It's literally just a mapping
And python's mapping is very bad compared to other languages
It would be nice if discord.py had a cache driver system
no its really hilarious, you have no control over it, and as andy said its a mapping, lemme make it worse for you, its just a dictionary
Yeah that's the RESTClient-thing we've been talking about.
Don't even get me started on discord.py's message cache
@bot.command(name='add')
@commands.has_any_role(role)
@cooldown(1, 1000, commands.BucketType.user)
async def cmd_add(ctx):
await cmd.add_report(ctx, bot)
cmd_add.reset_cooldown(ctx)
@cmd_add.error
async def cmd_add_error(ctx, error):
if isinstance(error, commands.MissingRole):
await ctx.send("You don't have access to this role")
This doesn't show error when used without role :o
It just doesn't allow people that don't have role
i mean it was horrendous when i used a fork idk why lol
somethow
andy with his 0(n) complaints
Please, be my guest.
It's a deque for the popleft, but they made getting message O(n)
They could've used a dictionary
They are ORDERED NOW kek
Just encapsulate a dict inside of a class that handles popping left, then you have a deque with constant time getitem
Popping left will be probably, unless you store the key before hand
@commands.has_any_role(989043172007104552,989044819101896735,)
async def timeout(self, ctx: commands.Context, target: discord.member, *, reason):
await timeout(until, /, *, reason=None)
await ctx.send("member timeouted :white_check_mark:")```
its not working
big zero notation
Circular buffer ftw
Let's eat popcorn ๐ฟ
There's dict.popitem() but that's popping at the end
helpp
oh yeah its an O
You could store the keys as well in the encapsulating class
That'll prob get rid of needing to call list()
But it'll be a total upgrade from the current deque
Which after all, the only reason it seemed to be used for is popping left
WeakValueDictionary will be best so that you don't need to bother with keeping it up to date with the deque ๐
read the documentation
Wait, is the current message cache an iterable? As opposed to a hashmap?
timeout is a method of cls: discord.Member
well, the forks use dpy cache so it wont matter ๐คก .
It's a deque
Hashmaps are iterable too
Well yeah, I mean in the sense of a list/array
Yes, it's a linked list. Removing a message from the cache literally iterates it to find it.
discord/state.py lines 462 to 463
def _get_message(self, msg_id: Optional[int]) -> Optional[Message]:
return utils.find(lambda m: m.id == msg_id, reversed(self._messages)) if self._messages else None```
discord/state.py line 273
self._messages: Optional[Deque[Message]] = deque(maxlen=self.max_messages)```
Let's just make it a dict of message id and message object
๐
Yikes, a dict or something similar would be better wouldn't it?
what is a Deque again ๐ญ
I would love to see Danny denying the request tho
!d collections.Deque
No documentation found for the requested symbol.
Rip, anyways it belongs to the collections module
Someone must've put in a PR or an issue at least for this?
@bot.command(name='add')
@commands.has_any_role(roles)
@cooldown(1, 1000, commands.BucketType.user)
async def cmd_add(ctx):
await cmd.add_report(ctx, bot)
cmd_add.reset_cooldown(ctx)
@cmd_add.error
async def cmd_add_error(ctx, error):
if isinstance(error, commands.MissingRole):
await ctx.send("You don't have access to this role")
Someone knows why this doesn't return the last message when someone uses it without role?
lowercase d
https://github.com/an-dyy/Rin/blob/70066f04157a20a08cfe65ce9235ce65d35f8be3/rin/models/cacheable.py#L14-L15 if you take a look at the class I made for my message cache, you can see it isn't even hard to make
rin/models/cacheable.py lines 14 to 15
@attr.s(slots=True)
class Cache(Generic[T]):```
hikari/impl/cache.py lines 1530 to 1538
def get_message(
self, message: snowflakes.SnowflakeishOr[messages.PartialMessage], /
) -> typing.Optional[messages.Message]:
if not self._is_cache_enabled_for(config_api.CacheComponents.MESSAGES):
return None
message_id = snowflakes.Snowflake(message)
message_data = self._message_entries.get(message_id) or self._referenced_messages.get(message_id)
return self._build_message(message_data) if message_data else None```
!d collections.deque
class collections.deque([iterable[, maxlen]])```
Returns a new deque object initialized left-to-right (using [`append()`](https://docs.python.org/3/library/collections.html#collections.deque.append "collections.deque.append")) with data from *iterable*. If *iterable* is not specified, the new deque is empty.
Deques are a generalization of stacks and queues (the name is pronounced โdeckโ and is short for โdouble-ended queueโ). Deques support thread-safe, memory efficient appends and pops from either side of the deque with approximately the same O(1) performance in either direction.
Though [`list`](https://docs.python.org/3/library/stdtypes.html#list "list") objects support similar operations, they are optimized for fast fixed-length operations and incur O(n) memory movement costs for `pop(0)` and `insert(0, v)` operations which change both the size and position of the underlying data representation.
ty
complete the wrapper when
Uppercase belongs to typing.
Never
oh generic version
do it
Maybe in CPP
"approximately the same O(1) performance in either direction."?
why not rust
I suck at rust ๐ฉ
That's not the whole story for the sake of performance though. Removing items from a dictionary may cause it to keep resizing and that would be terrible for performance
Write it with IronPython
The deque is great because you can set a max_len and re-use memory from my understanding
You can set a max length with what I showed as well
So it doesn't go past a certain amount of messages
Let's just sit in the back and eat popcorn
current message cache system in discord.py slow, other methods faster
I also can't understand anything
Google the terms you don't understand
ยฏ_(ใ)_/ยฏ
Because its Danny ๐
O(1)
First one
less cpu operations.
i aspire to be O(1)
u output the stuff in constant time no matter how big the input is
other libraries? no
we were talking about hikari lol
...
i feel its better than libs like hata.
hello
hey asher
There's still a performance benefit to be had with deques. I guess my recommendation of a weakref dictionsry takes the downside of both though.
The fact that you pop the item after adding the new is making it worse though. You should pop first to free up that hash slot in the index.
WeakRef would be good, but wouldn't that cause issues later on, or in some cases?
better cache,
Is faster
more pythonic
strictly typed
multiple command handlers
you are not restricted to use gateway ( the thing we discussed earlier )
are a few of them
dpy typing is fine tho? it lies well
faster by how much?
Actually, I don't think it'll cause much issue nevermind
ctx.bot returns a BotT with no attributes of Bot heh?
ctrl + f for #type: ignores
Gateway is a Websocket connection between you and discord
API calls are what is called when using discord.com/api/vX
seems to return bot obj
Using the gateway when you DON'T need it will end up costing you bandwith and other stuff
print the type of it
Yeah the issues it may cause depend on the implementation of it. ie. how it decides to handle expiring keys. We want to minimize resizing as much as possible.
BotT is a TypeVar. Discord.py is going crazy with generics atm
try using ctx.bot in your ide.... and see if it will ever show an autocomplete 
if you wanna use something like mypy, discord.py would be a hell
ok well no one likes mypy
If you don't use the gateway, you shouldn't be forced to use it.
Discord.py relies a lot on its cache and that would not stay relevant if you just use the REST API with no events incoming.
Websockets are bi-directional, with the way it works, you need to send heartbeats every so often. You'll also receive data from the websocket, imagine having presences intents in a 5k+ Member guild, you'll get an event with DATA everytime they update their presence (very often), with rest only you don't receive any events, you only post, fetch, etc
The overheard that comes with the websocket will probably be adding onto that
With rest you really, realistically speaking need an aiohttp.ClientSession and your done
version?
Really, this just depends on whether or not you need a gateway connection
i just rewrote a complete bot with mypy compatibility ๐ with hikari ofc
most people prefer mypy for strong type checking
You should determine first of all, whether or not you need to be receiving events
Neovim
don't think that should matter, if the typing is correct for one, it should be good with the other too
am i right andy?
You are, yes, but Mypy is a bit behind in the typing world
A lot of bugs and a lot less people fixing them
yepp
Mypy ๐ฟ Pyright ๐
I'll still keep it
I'll get errors from mypy that pyright doesn't even flag
is that bad?
I have pyright on strict typing, so yes
For good reason
depends on ur command handler
lightbulb and crescent wont, optional in tanjun
lightbulb
why not use the setup_hook?
it has been working like Discord.py hybrid commamds for a long time, basically slash and prefix both under one function
well, that's a different story
its indeed a good thing
also, not something really impressive, but built-in paginators support 
and the default help command generated is even more uwuer
you can do it the way you want, prefix only, slash only or both.
thats just a text paginator no
yep, better than dpy
What kind of paginators were you talking about
they are called plugins
Embed paginators ofc, who tf uses text based paginators
Oh
if you want client, use hikari.GatewayBot
if you want Bot, use some command handler and its Botclass
why not
it does but its hard
it does too
yea~
prefix commands is a command handler thing, so no
lemme tell in the most basic words
hikari = discord
a command handler = discord.ext.commands
i feel writing hikari = discord is illegal
fellas
I'm assuming the bot class in the command handler latches onto GatewayBot
how would one run a async command without await
Which is the same reason why you use discord.ext.commands instead of just discord for prefix commands\
U cant
Unless like asyncio.run
perfectt
Not to disturb but do someone know a code that deletes a voice channel after all people leave the channel?
RuntimeError: asyncio.run() cannot be called from a running event loop
you could just use on_voice_state_update, everytime a user leaves a channel, you join and check how many users there are, if there are only 1 (you) then you delete
async def getImg(self, userURL):
async with aiohttp.ClientSession() as session:
async with session.get(str(userURL)) as resp:
return Image.open(BytesIO(await resp.read()))
img = asyncio.run(self.getImg(userAvatarUrl))
hikari docs https://www.hikari-py.dev/hikari/
in case you don't understand the above one; https://hikari-py--1185.org.readthedocs.build/en/1185/
lightbulb https://hikari-lightbulb.readthedocs.io/en/latest/
there is already a running event loop (dpy) and you're running asyncio.run again in it, so it won't work
instead maybe try await getImg()
i cant want to use await
why
im using jit
?
to compile everything in this function
image processing moment
not messing with numba and async
lmao
we do a little bit of numba and async
class Transfermoneybuttons(discord.ui.View):
def __init__(self, amount, author, timeout=180):
super().__init__(timeout=timeout)
self.amount = amount
self.author = author
async def interaction_check(self, interaction: discord.Interaction):
if interaction.user != self.author:
await interaction.response.send_message("You can't use that", ephemeral=True)
return False
return True
@discord.ui.button(label="Deposit "+moneycurrency,style=discord.ButtonStyle.blurple, emoji=":up:")
async def deposit(self,interaction:discord.Interaction,button:discord.ui.Button):
This has a Timeout in it, How can i make that the buttons get grey on timeout error?
@client.event
async def on_voice_state_update(member, before, after):
if after.channel.id == 984492572544213083:
CAT = discord.utils.get(member.guild.channels, id = 984491906237075496)
vc = await member.guild.create_voice_channel(f"{member.name}", category = CAT)
await member.move_to(vc)
elif str(before.channel.name) == str(member.name) and after.channel == None:
await before.channel.delete()โ
Ok. I made this code but it only creates and when everyone leave it wont delete
pingu look at what i sent slime
Ok
!d discord.VoiceChannel.members
property members```
Returns all members that are currently inside this voice channel.
Ok
there's a lot of resources in .gg/hikari 's #886584307454472243 ( getting-started-with-hikari ) channel, in case you wanna check out
property voice```
Returns the memberโs current voice state.
bruh
Hope it works
wtf
?
.?
okay maybe try this py elif not before.voice is None and after.voice is None: if len(before.voice.channel.members) == 0: await before.channel.delete()
there we go
Yes but how do i do it in timeout
numba doesnt like bytesIO
Ok
@bot.command(name='add')
@commands.has_any_role(roles)
@cooldown(1, 1000, commands.BucketType.user)
async def cmd_add(ctx):
await cmd.add_report(ctx, bot)
cmd_add.reset_cooldown(ctx)
@cmd_add.error
async def cmd_add_error(ctx, error):
if isinstance(error, commands.MissingRole):
await ctx.send("You don't have access to this role")
Someone know why this doesn't return message on missing role? Just blocks the command and that's it
whats the role variable, a list or something?
a list of roles, each role is an integer
try commands.MissingAnyRole
nah thats optional lol
AAAAH I'M SO STUPID THANK YOUUU HAHAHA
That worked ! โฅ๏ธ
๐
oh sry sry not a list, it's a single role, because method takes args .has_any_role(*args) so each role will be sent and you separate with comma
pip install hikari-lightbulb
yeah... if it was a list of role ids you could just do has_any_role(*thelist)
not important, as said
hikari is like discord
lightbulb is like discord.ext.commands
like if you wanna make an embed so you will ofcourse use hikari to do that
ยฏ_(ใ)_/ยฏ
are you on mac/linux by any chance?
okay i dont feel like doing numba with PIL to keep my sanity
class Transfermoneybuttons(discord.ui.View):
def __init__(self, amount, author, timeout=20):
super().__init__(timeout=timeout)
self.amount = amount
self.author = author
async def on_timeout(self, interaction: discord.Interaction):
print(test)
for child in self.children:
child.disabled=True
await interaction.response.edit_message(view=self)
You know why this is not workin ive set the timeout to 20s eventho its like 3 minutes + the on_timeout isn't working
see the error in your console
No error
Idk why but since i started using cogs no errors will show up
you probably have a error handler which eats up ur error
any on_command_error events?
No
/listeners?
if you guys want dis feel free to use it
?
modify it if u want ๐
any way to only take the argument but still work if it doesn't have the argument?
for example, if there is an argument, it would use it, otherwise not
i havent done much research on async photo editing libraries
async def command(ctx, username: str="Blabla")
so if i did !update it would update me but if i did !update th it would update th
If no string is specified it will take Blabla
so can i do something like this
Yes
Whats the argument self
but you know what i mean
Yes
You could replace it (Like you did) with another argument
Or just place in a string
This same works with
int=0, discord.Member=None
and more
so wait could i do this?
no, u can set a default value, then check if its the default value and do something
like
def ...(ctx, val: str | None = None):
if val is None:
val = 'foo'
ohh so i would do if username=0 then username=message.author.nickname?
async def command(ctx, username: str=None):
if username = None:
username = ctx.author.nick
So that should work, You can also change it to message.author.nickname
or what ever you want
i kinda forgot what the better way to do this is
elif
@eager bluff
class Transfermoneybuttons(discord.ui.View):
def __init__(self, amount, author, timeout=20):
super().__init__(timeout=timeout)
self.amount = amount
self.author = author
async def on_timeout(self, interaction: discord.Interaction):
print(test)
for child in self.children:
child.disabled=True
await interaction
Any body know why the on_timeout function does nothing, Not even a error?
why are you awaiting interaction? what's that supposed to do in your head?
ur literally just printing cadet
Ohh i didn't copy the whole code
consider using dicts
await interaction.response.edit_message(view=self)
you don't pass any args to on_timeout, and if you're not getting any errors, you probably have an eh that's eating it up
How can i fix that?
My english is very bad
fix what? errors not showing up or buttons not being disabled when on_timeout is called?
Buttons not being disabled
you'll have to set an attribute of the class to the message that was sent via a Messageable.send, and use that as your message-edit method
class View(...):
async def on_timeout(self):
await self.message.edit(view=self)
# in your command function
view = View()
message = await ctx.send(..., view=view)
view.message = message
So i tried this but after the timeout nothing happens
I even put a print("test") on start no response
nvm
await self.message.edit(view=self)
AttributeError: 'Transfermoneybuttons' object has no attribute 'message'
THis what happens
did you add a message attribute in your __init__?
how would i do this but for administrators? admistrator_guild doesnt work
@has_permissions(manage_guild=True)
just administrator
None will do just fine
Ok
super().init(timeout=timeout)
self.message = None
Right?
without guild?
Just put it Administrator
yes
AttributeError: 'NoneType' object has no attribute 'edit'
are you setting your view's message attr to the actual message like I showed here?
@commands.command()
async def transfer(self, ctx, amount: int=100):
await open_account(ctx.author)
users = await get_economy_data()
message = await ctx.send(embed = embed,view=Transfermoneybuttons(amount, ctx.author))
view.message = message
Thats right?
you're not defining view though
Ohh i just noticed
Still not working
traceback?
show code
@commands.command()
async def transfer(self, ctx, amount: int=100):
await open_account(ctx.author)
users = await get_economy_data()
embed = discord.Embed(title="Withdraw or Deposit", description=f"Choose if you want to withdraw or deposit `{amount}{moneycurrency}`")
message = await ctx.send(embed = embed,view=Transfermoneybuttons(amount, ctx.author))
view.message = message
class Transfermoneybuttons(discord.ui.View):
def __init__(self, amount, author, timeout=10):
super().__init__(timeout=timeout)
view.message = None
self.amount = amount
self.author = author
async def on_timeout(self):
print("test")
for child in self.children:
print(child)
child.disabled=True
print("test")
await self.message.edit(view=self)
again, you're not defining view
no, python has no clue what view is, therefore it will have even less of a clue what view.message is
Ohh ok
when instantiating your ui.View class, assign it to a variable, and use that variable to set the .message attr
view=Transfermoneybuttons(amount, ctx.author)
``` do i have to replace this with view?
yes and wdym
lmao
Command still not working
let's see your updated code
@commands.command()
async def transfer(self, ctx, amount: int=100):
await open_account(ctx.author)
users = await get_economy_data()
view = View()
embed = discord.Embed(title="Withdraw or Deposit", description=f"Choose if you want to withdraw or deposit `{amount}{moneycurrency}`")
message = await ctx.send(embed = embed,view=Transfermoneybuttons(amount, ctx.author))
view.message = message
in the example I showed you, View was a placeholder class for your actual view class (I'm assuming it's called Transfermoneybuttons (best practice to use camel-case for class naming too)), so your view = View() statement will error (no traceback is shown because you probably have an error handler that's eating up the traceback)
I have no error handler
idk why it doesn't show any errors
hmm, well either way, that's why your command is not functioning
I have prints in it
and it stops after the view variable
because the class View doesn't exist
did you pass in the required arguments to the class?
it think because i forgot the variables
still nothing
code?
@commands.command()
async def transfer(self, ctx, amount: int=100):
await open_account(ctx.author)
print("1")
users = await get_economy_data()
print("1")
view = Transfermoneybuttons(amount, ctx.author)
print("1")
embed = discord.Embed(title="Withdraw or Deposit", description=f"Choose if you want to withdraw or deposit `{amount}{moneycurrency}`")
print("1")
message = await ctx.send(embed = embed,view=view)
view.message = message
stops after 2nd print
assuming you haven't changed anything here, what is view.message?
.
Didnt you said i should do that?
well yes, but that's in the command, not in the view
Its the command
that's the ui class?
No
class Transfermoneybuttons(discord.ui.View):
def __init__(self, amount, author, timeout=10):
super().__init__(timeout=timeout)
view.message = None
self.amount = amount
self.author = author
async def on_timeout(self):
print("test")
for child in self.children:
print(child)
child.disabled=True
print("test")
await self.message.edit(view=self)
Thats it
that's what I'm referring to
in line 4, you've got view.message = None, what's view?
do you mean self?
view = Transfermoneybuttons(amount, ctx.author)
could you change it?
so its right
^ ?
i think so
I dont really understand you because my english is very bad
Im also very new at programming and not experienced with discord.py
dpy isn't a really beginner-friendly library
so sorry, I thank you much but i dont think i understand it and i dont want to waste your time any more
I understand discord.py in the simple way but things like buttons get me really fast into trouble
it's fine. What's happening is that your trying to access view where it is not defined. Just replace view with self in the class and see where that takes you
still doesn't goes after
view = Transfermoneybuttons(amount, ctx.author)
@fading marlin
dont call the deco
its just
@Bot.event
because it only takes 1 argument which is a coroutine object
@bot.event()
async def on_ready():
...
@bot.event(on_ready)
async def on_message(message):
...
siuu
i made my lib kinda like that
@Bot.on("MESSAGE_CREATE")
async def example(payload: dict[str, "Any"]) -> None:
...
you can also use the enum
@Bot.on(GatewayEvents().MESSAGE_CREATE)
async def example(payload: dict[str, "Any"]) -> None:
...
i still have allot to do
how can i downgrade back to discord py 1
i do not like the new version
you can uninstall 2.0 and just use 1.7.3 which is downloaded from pip