#discord-bots
1 messages ยท Page 73 of 1
Good luck ๐ค๐ป
Or there are better things to do than make another wrapper ๐
no theres many reasons why it would be better to have a custom wrapper

Ye but discord bots rly arent worth it in my opinion
cough cough mee6 uses a custom wrapper written in python?
Ok but like thats worth it since it brings money
and python brings happiness isnt that enough๐ฟ
It is but not enough to make custom wrapper ig ๐
but making a custom wrapper brings people happiness ๐ค
Ppl wouldnt even realise Itโ s not made in custom wrapper it wasnt open source
So ig ppl can still be happy
Unable to convert '?' to valid command, tag, or Cog.
!src
it is open source?
The Python bot uses discord.py
Ig disnake is from when dpy was discontinued
that is correct
That was worse that corona
ive never tried it and never will
Lmao okok
U dont know how lucky u are
As long as u havent tried discord.js either
Ruby?
yep
Haha how was it
its not that bad its actually a bit similar to discord.py
Rn Iโ m working on some integration between discord whatsapp and telegram
And Itโ s using discord.js

And js is just deciding to make my life hell
js is a nightmare sometimes
"I want to make a simple multipage websit-" gets crushed by 3 GB node_module folder and like 50 choices in web frameworks and libraries
And from what I heard js and databases dont != healthy developer
LMFAOOO
Node.js ๐
yeah, needless to say I just used jekyll for that project
Whats that, a cms?
async def h(ctx, channel: discord.TextChannel):
channel = bot.get_channel(101312783609103568)
async for command in channel.slash_commands(query="no", limit=None):
if command.name == "hello":
await command[0]()```
TextChannel has no attribute slash_commands
Static site generators are great
Love them for documentations cause it's just so easy
It's static site framework writen in ruby. You can put markdown through it and it'll spit out html based on templates you give it.
โTextChannelโ object has no attribute โslash_commandsโ
Ohhh thats nice but Iโ m guessing Itโ s just static html pages?
text channels don't have slash commands ยฏ_(ใ)_/ยฏ
yeah, no dynamic content
Not usefull for web applications
yeah for web applications, I just don't use js
In school next year they are gonna teach us html and word press and php
I use quarkus for backend
At least it's not java
Frontendโฆ I dont do ๐
Java > JavaScript
yes
You can't be serious
You set the value of channel to the value of channel.id, overwriting the channel object
Use some different variable names
Idk I like oop and Itโ s strongly typed
And Itโ s not random nonsense
But I like kotlin more
Yeah, I can see why Java is a good learning language, maybe not the first language I would want to encounter learning programming, but still it's easier than languages like C for static typing and OOP imo
Javascript has OOP too
It's multi-paradigm
you just say that because youre sponsored by wix
Java is just too much boilerplate
Also don't overlook the fact that Java is memory-hungry
Even for small applications
Yes but.. It also has undefined and null and === and so much random stuff
And java has the worst semantics I've seen. Reading source of java applications is literally horrible they have 5 empty directories all nested and the final one has actual code
I don't like Javascript, but java is def worse imo
What are you trying to get about the channel?
U can do (โbโ + โaโ + + โaโ) and u will get banana ๐
If you want type, it's just channel.type
baNaNa
Itโ s like the first language I ever used
U gotta do .lower as well ig
And why the long names as well in java?
Also it also comes down to what ur used to
I literally sometimes cannot fit the whole line in my neovim buffer because it's so long
I never use java unless I'm required to for something
This is what your used too??
or I'm playing Minecraft
I can't understand how you'd get used too that
idek what spring boot is ngl
Ye u get that shit in java ๐
It's just a random java project I got from github's trending
I dont think Itโ s possible
But I swear you look at any java project in trending and it'll have soo many folders like that
Framework for microservices
yeah, that's java package structures
But there is a better one for java called quarkus
What's the point of so many folders?
Yes u got project name then ur organisation and then src and tests and then u got service layer, entities, daos, resource etc.
how to react to message discord py?
You know, maybe we should not talk about java in the #discord-bots channel
!d discord.Message.add_reaction
await add_reaction(emoji, /)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Adds a reaction to the message.
The emoji may be a unicode emoji or a custom guild [`Emoji`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Emoji "discord.Emoji").
You must have the [`read_message_history`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Permissions.read_message_history "discord.Permissions.read_message_history") permission to use this. If nobody else has reacted to the message using this emoji, the [`add_reactions`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Permissions.add_reactions "discord.Permissions.add_reactions") permission is required.
Changed in version 2.0: `emoji` parameter is now positional-only.
Changed in version 2.0: This function will now raise [`TypeError`](https://docs.python.org/3/library/exceptions.html#TypeError "(in Python v3.10)") instead of `InvalidArgument`.
!d discord.Message.add_reactions
does not work
does not react
That will remain a mystery
Can you show your code?
await interaction.response.send_message("embed has been sent", ephemeral=True)
reaction1 = "๐"
await msg.add_reaction(emoji=reaction1)
reaction2 = "๐"
await msg.add_reaction(emoji=reaction2)```
What is msg defined as?>
msg = await channell.send(embed=evm)
!d discord.Emoji
class discord.Emoji```
Represents a custom emoji.
Depending on the way this object was created, some of the attributes can have a value of `None`...
The emoji can be a string, that's not the issue
Try using that
especially unicode emojis
https://pastebin.com/6NE4sYSR can someone help? I don't understand why company ranks don't work, no error is given
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
emoji=... does not work here since the function signature is defined as (emoji, /)
Pass it as a positional argument otherwise it'll error
The function is guarded to be pos-only
im using nextcord which is discord py fork idk if this works with it ill try it
!e ```py
def foo(bar: str, /) -> None:
print(bar)
foo("Hello World!")
foo(bar="Hello World!")
@pliant gulch :x: Your 3.11 eval job has completed with return code 1.
001 | Hello World!
002 | Traceback (most recent call last):
003 | File "<string>", line 5, in <module>
004 | TypeError: foo() got some positional-only arguments passed as keyword arguments: 'bar'
It should work, just try it out
Can someone help?
Many people can
๐ great answer
alright well can you look at the pastebin please and tell me why comapny ranks don't get called
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
!d for loop
BNF ๐
All those if statements could be done with a for loop
This is a bit of code, what in particular isn't working?
well the general idea is
someone types a rank they want in #role-request
a message from the bot gets sent to #admin and then we have to react to the bot with 'confirm' to give that person said rank
all ranks work apart from the company ranks, i.e, (1st, 2nd, 3rd company)
and I have no idea why
does "Confirmed" send? Is the only thing it doesn't do is adding the role?
no and the message to reply to doesn't send either
Try printing out the values you use in these if statements then, and seeing what values are in them
if message.channel == channel:
if message.content in list:
if mention == 'None':
You might be getting some values that you might not be expecting
Should note, you don't have to use a string 'None', you could just use the actual None value
Then check if mention:
- ๐ has
Discordrecently changed thread archiving to7days of inactivity, ignoring theauto_archive_durationparameter ofTextChannel.create_thread(), which now seems more of anauto_hide_duration? Is there a new way to auto-archive a thread?
TypeError: Dropdown.callback() missing 1 required positional argument: 'select'
any help?
Traceback (most recent call last):
File "", line 409, in _run_event
await coro(*args, **kwargs)
File "d:\shr!ke.exe\Marvis\marvis.py", line 158, in on_command_error
raise error
discord.ext.commands.errors.HybridCommandError: Hybrid command raised an error: Command 'list' raised an exception: OperationalError: no such column: reason```
CREATE TABLE IF NOT EXISTS `blacklist` (
`user_id` varchar(20) NOT NULL,
`moderator_id` varchar(20) NOT NULL,
`reason` varchar(255) NOT NULL,
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
);```
you probably forgot a parameter, it's async def callback(self, interaction: Interaction)
!e
Print("Hello World!")
@hollow plank :x: Your 3.11 eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "<string>", line 1, in <module>
003 | NameError: name 'Print' is not defined. Did you mean: 'print'?
#bot-commands
What's this SQL dialect that uses backquotes, have never seen one tbh
Yeah probably
Asher is so smart
sup ashley 
I just keep on smiling like I'm good, wbu
nothing just having fun lately vacation ends this sunday
w-w-w-wait, Pyweek starts tmrw
yesh
oof
Since the news/update my bot only responds to dms now.
rip
F
if u enable message content it should work but ur bot can't join new servers
is this the one in the intents?
yes
I only use it for my personal server so no problem there
hmm if its not a verfied bot there should be no problem
what
Ok i'll try that. thanks
open applications its written there
@primal token yo is ur pfp kurzegesat
dont have any
yep
asher can you send a ss?
yes
thanks
actually u can just try many big bots still responding to prefix commands
lemme open my applications page meanwhile
And how that does that supports your point?
bro clean your screen
its in the changelog yesterday it was on applications page they removed it today so took some time to find
yessir
the heck you doing to have your screen that dirty
either way your statement isnt quite true as you never explicitly said that your statement is only directed at verified apps that have asked for the intent and not enabled
Asher โ Today at 12:01 AM
if u enable message content
have you ever heard of not touching your monitor/tvs screen?
is the monitor touch screen or something to be touching it so much
bruh unverified apps have message content intent anyway
u sound like my parents now ๐ฅฒ
still your statement had me confused on how general and uncorrect it was
yes yes my fault sir ๐
You probably were looking at pycords codebase and wanted to punch your monitor
kewl how u know altho i wouldn't have punched that way no more coding for me ๐
kek i wouldve punched my left monitor(dual monitors)
rich ppl
me only have a potato laptop ๐ฅฒ
i saved for my desktop for like 5years and now i cant even buy a kitkat, im at the verge of being homeless
hmm u live alone?
same ๐ง
Someone lives in my walls
nice the patience
me
you wouldnt fit in them

theyre pretty thin walls what can i say
if i started saving a week after saving i would go to pizza hut or something and spend it all
๐
it's better to beg than to steal, more like it's better to work than to beg
I legally cant work, whats your point?
hm that's sad
its not sad, its nice not thinking about a job/work, the only thing i'm thinking about is formulas i need to learn for physics๐
have fun
i need to learn like 20 formulas im having the time of my life right now
only 20
for now
Why does this look so cursed ๐
Looks fine
Looks good to me over binding app commands to a tree๐ด
and a @describe decorator
๐
Example ^
thx
You create a discord.ui.View, add ui components/items to it and pass it to view kwarg of .send
can u make mutiple?
yes
hikari is neat
you mean a subclass? you can always call an instance and add the components right?
@sly fog
ok
nonono let him learn 2.0
what
internally it calls @bot.tree.command ๐
hikari with lightbulb is even better
agreed
lightbulb ๐ณ
im talking about disnakes implementation which is the same lol
I hate nitro-less days
that is discord.py 2.0 lol
ew
ok
ok
๐

Waht
@slate swan miru good too
I mean, you can create an instance of discord.ui.View, add items with its add_item method and pass the view obj to the view kwarg of Messageable.send
yes
what is taht
hikari component handler.
Ngl, subclassing is neater imho
All those decorators ๐ฅบ
ew
You can subclass if you want, in the end you have to instantiate it
Why tho? nitros only good feature is using emojis everywhere and i wouldnt doubt it would be removed from nitro classic, its quite funny seeing how discord has 2 nitros, but either way my point doesnt matter because i have no nitro kek
elaborate
why are you even applying brain on that
oh wait miru nvm, I mistook it with some other shitty lib
Discord and Skype
i got my grandma on skype
dont u dare
,
!ot
Off-topic channel: #ot2-never-nesterโs-nightmare
Please read our off-topic etiquette before participating in conversations.
@slate swan do you have instagram
bro
And yea, I mean ot2, not #ot3-discord-bots
ok
I do but I won't share it :pepe_exit:
oof
the only account ive viewed this week on insta was a cat account mina shared with me kek
https://www.instagram.com/brownsugar_ddang/ very cute cat
potato
I have 100 voice channels in my discord and i want my bot to join each one for about 5 seconds before joining another one.
!d discord.Guild.voice_channels
property voice_channels```
A list of voice channels that belongs to this guild.
This is sorted by the position and are in UI order from top to bottom.
you can iterate through each channel in a command or a task depending on what you want
and make sure to play a rickroll each time the bot joins a channel
straight to jail you go
i want it to be like join vc 100, wait like 1 sec then join vc 99
the song is love, its literally in my Spotify top10s
with a try/except block cuz you might not have the perms to join some vc
overrated song
cmon its not even that annoying
Underrated ๐
Same same
not as old but i love it
Or eric clapton layla
laufs in metal
good one as well
What bands?
mayhem bathory etc
Megadeth?
wait let me give the original link
This part of the song just makes me feel some type of way like- angsty? And emotional?! But anyways its been in my head for a good while so i just put it on a loop for like 5 mins so hopefully other ppl will find this and enjoy it too :)
i heard some songs from them but didn't engage too much
lets move to an ot channel before ee get yeeted
Big MacDonalds
how to know if an error is Mission Permission or Unknown Ban
when printed type both are discord.errors.ApplicationCommandInvokeError
in pycord
\
is this the way ^ ?
you can accept an argument with a discord.Emoji typehint and use the id attr to it
async def mycmd(ctx, emoji: discord.Emoji):
em_id = emoji.id
but note that this is only applicable for custom static/animated emojis and not default emojis
or you can always get/fetch the emoji
welcome
So, links arent considered attachments. What would be a good way to seeing the type of attachment, and if the message has a link
wat
!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.
x == y Checks if two embeds are equal.
New in version 2.0...
what do you want from an embed?
Embed.video.url
w-w-wh-hat?
!d discord.Embed.video
property video```
Returns an `EmbedProxy` denoting the video contents.
Possible attributes include:
โข `url` for the video URL.
โข `height` for the video height.
โข `width` for the video width...
uhm... I don't think message.Embed is a thing
!d discord.Message.embeds
A list of embeds the message has. If Intents.message_content is not enabled this will always be an empty list unless the bot is mentioned or the message is a direct message.
yeop
So wait just replace message.Embed with message.embeds?
yes, message.embeds will return either an empty list or a list of Embed objects
Great
- Try printing
wel[0] - Try using
fetch_channelinstead
ch = await interaction.guild.fetch_channel(...)```
I don't see any code of modal neither you gave me the error
Do you respond to modal interaction
Hey @slate swan!
It looks like you tried to attach a Python file - please use a code-pasting service such as https://paste.pythondiscord.com
Does someone how to make a auto kill 1 if the bot stops working in py ?
its a read only property, meant for video embeds from sites like YouTube and Reddit
yes, depends how and where do you want it
and what guild would it be? is there any reference to it? like the name or something
Search the guild in bot.guilds or bot.fetch_guilds using some filter of your choice
there's a on_guild_join event which gets triggered when the bot is added to a server
Ye
If it happens when the bot joins a guild, you might as well use the event and only run code in it if there is something special about the guild
In an if statement or something
Why? Why not just use the on_guild_join? Will the bot only be in one guild?
If it's only in one guild then just do it manually
How can I check in an autocomplete whether the entry is, for example, 1s 2s 3s or 1m or 1h?
the answer varies with the library you're using
Nextcord
https://github.com/nextcord/nextcord/blob/master/examples/application_commands/autocompleted_command.py
this example has a nice explanation
A Python wrapper for the Discord API forked from discord.py - nextcord/autocompleted_command.py at master ยท nextcord/nextcord
someone
I should make a list like 1s, 2, 3s...., 80s, 81s or what?
yeah, i would make one like this ```py
list_num = [f"{num}s" for num in range(start, stop)]
you can't
oh
But i have also 1m, 2m .... Or
1h, 2h... or
1d, 2d....
can anyone help me on this ๐
!e ```py
print ([*(f"{n}h", f"{n}s", f"{n}m") for n in range(10)])
you have 2 opening ( and 3 closing )
You flipped one parenthesis
aaaa
In the range
yea i was typing on phone and it went wrong
@slate swan :x: Your 3.11 eval job has completed with return code 1.
001 | File "<string>", line 1
002 | print ([*(f"{n}h", f"{n}s", f"{n}m") for n in range(10)])
003 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
004 | SyntaxError: iterable unpacking cannot be used in comprehension
Use list() over the generator expression
so they don't allow that in comps
you can create seperate lists for all 3 types and add them to create a single one
and why would your bot "stop" working?
!e
from itertools import chain
print(list(chain.from_iterable((f"{n}h", f"{n}s", f"{n}m") for n in range(10))))
@brazen raft :white_check_mark: Your 3.11 eval job has completed with return code 0.
['0h', '0s', '0m', '1h', '1s', '1m', '2h', '2s', '2m', '3h', '3s', '3m', '4h', '4s', '4m', '5h', '5s', '5m', '6h', '6s', '6m', '7h', '7s', '7m', '8h', '8s', '8m', '9h', '9s', '9m']
are you getting ratelimited because of spamming, or?
Like this?
replit ratelimits, why else would someone use kill 1
oh i forgor abou that
yeah exactly
kill 1 in general would shut down your computer lmao
if it crashes when u react with a button i could temp restart if i am away from home
does it?
And hiw can i use regex
sounds like you need to fix your code, it's not replits problem
yes, in linux. its the PID for kernel's systemd process
understood
you asked the wrong person, don't have much idea about the re library
regex is cute
because youre making it do that? the part of code was triggered multiple times
How do i add a Slash command to a cog in discord.py
check pins, 2nd message
sarth
ash
im having issues with this import (background its for a bot i built a few months ago and im trying to go back to it)
from discord_components import DiscordComponents
it throwing this error
Traceback (most recent call last):
File "c:\Users\maLev\Desktop\Optimized Arcade Bot\Arcade\src\main.py", line 5, in <module>
from discord_components import DiscordComponents
File "C:\Users\maLev\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\discord_components\__init__.py", line 1, in <module>
from .client import *
File "C:\Users\maLev\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\discord_components\client.py", line 12, in <module>
from .component import Component
File "C:\Users\maLev\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\discord_components\component.py", line 3, in <module>
from discord import PartialEmoji, Emoji, InvalidArgument
ImportError: cannot import name 'InvalidArgument' from 'discord' (C:\Users\maLev\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\discord\__init__.py)
any help would be appreciated
you should not use this library
why?
super outdated and discord.py inbuilt components
ive looked at it and it doesnt work for me...
ah ok
did you sync the command, load the cog and did all the other stuff mentioned there?
so discord.py now has all of the features already integrated if I understood you or do I need a newer library?
what doesn't work, "it" doesn't describe everything
discord.py has em all
k thanks!
yes you just need to update discord.py and you're good to go
but iirc wasn't InvalidError removed in 2.0
why update then
I just had a stroke
@slate swan ๐
that lib is using the class, dont use the lib = don't need to class
?
ashley being a sussy
would me doing external cogs be an issue? i have a folder named: "cogs"
show the error pls
no there's no issues, just load those extensions using load_extension
or show the error
no need
..
i cant do this
from discord import app_commands
why...?
did you update dpy?
please stop making half-assed statements man
dpy 2.0
uh type pip show discord.py IF it has 1.7.3 as the version type pip install -U discord.py if it shows 2.0, reinstall discord.py
thanks
Now i get this
bot.py:24: RuntimeWarning: coroutine 'BotBase.add_cog' was never awaited
bot.add_cog(moderation(bot))
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
Traceback (most recent call last):
File "/Users/c/Desktop/Bot With Cogs <3/bot.py", line 26, in <module>
bot.loop.create_task(ch_pr())
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/discord/client.py", line 108, in getattr
raise AttributeError(msg)
AttributeError: loop attribute cannot be accessed in non-async contexts. Consider using either an asynchronous main function and passing it to asyncio.run or using asynchronous initialisation hooks such as Client.setup_hook
Can you help me with regex
I didn't say I am good at it either, sorry
there are breaking changes in discord.py 2.0, check the docs for them and refactor your code
๐จโโค๏ธโ๐โ๐จ everyone loves regex
,
How can i do a regex for the results 1s - 3000s
add_cog and similar methods must now be awaited
what u need regex for i can try
is this normal the discord.py?
Only discord.py is needed
no, only discord.py is original, rest all need to be deleted at this point
k
just run pip uninstall discord discord-components discord-py-interaction discord-py-slash-command
uwu
File "", line 409, in _run_event
await coro(*args, **kwargs)
File "d:\shr!ke.exe\Marvis\marvis.py", line 158, in on_command_error
raise error
discord.ext.commands.errors.HybridCommandError: Hybrid command raised an error: Command 'list' raised an exception: OperationalError: no such column: reason```
CREATE TABLE IF NOT EXISTS `blacklist` (
`user_id` varchar(20) NOT NULL,
`moderator_id` varchar(20) NOT NULL,
`reason` varchar(255) NOT NULL,
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
);```
Ashley
What are those back ticks for
that works??? i was doing it 1 by 1
thanks
Nova
done
What do you mean by "1s - 3000s"? And what do your strings look like?
im so confused how do you make a slash command with discord.py 2.0.1
can anyone give me an example
after taking a break for 5 months of making bots i dont remember a thing, this is sad
you are literally a life saver tysm
thank ashley, lol
For the time in the /timeout commands
!pypi durations-nlp
imagine making a custom timeout command over the builtin one
He should still check in the slash command whether the input is 52s, for example, or 91m or 5d
@shrewd apex
use this
pip install discord==1.7.3
And i cam check it before sending the slash command?
discord.py smh
Either one works
It shouldn't
@bot.slash_command(description="Sends the bots current ping")
AttributeError: 'Bot' object has no attribute 'slash_command'. Did you mean: 'add_command'?
uhm
How fix
Discord.py 1.7.3 does not have slash commands
Well, it doesnโt have them. They were only added in 2.0.
Maybe you were using another package which monkey-patched your install
but even then, my friends are also using slash commands with that
Iโd suggest just using 2.0
This is because this is not the way you define slash commands in discord.py
read that
see what i dont understand
or
class MyBot(commands.Bot):
def slash_command(self, name: str=None, description: str=None, nsfw: bool=False, guild: int=None, guilds: list[int]=None, auto_locale_strings: bool=True, extras: dict=None) -> ...:
return self.tree.command(name=name, description=description, nsfw=nsfw, guild=guild, guilds=guilds, auto_locale_strings=auto_locale_strings, extras=extras)
๐
mhm
my slash command setup worked perfectly fine on 1.17.3.
But once i install discord.py 2.0 and downgrade back
All of the sudden they dont work...
1.7.3 never had slashes
The libraries with which you created slash commands aren't discord.py, so downgrading from the version of discord.py which has them means you lose them
then how in tf was i able to use it...
discord.py introduces slash commands in version 2 and it is most definitely handled in a different way than the libraries you used
You probably had another package installed that patched your install and added them.
As I had said, you used other libraries
what other library..
Who knows
There are probably a bunch that do it the way you show
maybe connection just expires?
๐ฟ why the fuckkkk
Does anyone have a clue why Oauth2 guilds.join returns a "401 unauthorized" response, though the token is valid, bot has permissions and scope is selected xd
export async function joinGuild(tokenType, accessToken, guildID, userID) {
const res = await fetch(`https://discord.com/api/guilds/${guildID}/members/${userID}`, {
method: "put",
headers: {authorization: `${accessToken}`}
})
}```
are you using a connection or a connection pool
same question
this is a python server not a js server
same logic goes for request lol
python returns the same error, asked about discord api
its Authorization, not authorization and it should be like "Bot/Bearer token" isnt it?
Tried it bearer aswell but no difference, and docs state "All parameters to this endpoint except for access_token are optional."
but bearer goes with it ig then
ohhh
wait lemme try
because for the rest api we use the headers lile this ```py
{
"Authorization": "Bot <bot token here>"
}
shouldn't be, try using a Pool instead
and use aiomysql, not mysql
well then learn how to, cause mysql would be blocking the processes most of the time
it was correctly formatted, other functions are working perfectly, using the same header layout ๐ฅฒ
its not rocket science, just some changes in awaits
checkout tutorials
guilds.join and bot require you to have a bot account linked to your application. Also, in order to add a user to a guild, your bot has to already belong to that guild
are these conditions satisfied?
just watch tutorial how to handle aiomysql and then figure out how to link it with discord bot
there are examples and docs on the Library's docs page
stop referring to how to use "x" with discord bots, but how to use "x"
noone is going to spoonfeed if you watch an year old outdated yt tutorial either
shiit didn't realise that I have to put my real bot's token inside the header xD, thought access_token is fine
is there a way to get a user object with just the ID?
oh no no,that would be a total abuse then lol
xD
yeah definitely, if you have members intents enabled you can just do bot.get_user(id), if you don't then await bot.fetch_user(id)
with this object can I do user.add_role()?
you in reality need to do fetch_user anyway as not all members will be cached
days: int = SlashOption(name="days", description="How many days to mute the Member for", required=False, max_value=28) = 0,```
I got here a error
nope, add_role works on a member object
in that case you should be using Guild.get_member
ah ok thanks I'll try that
mhm, an or statment would be useful then ```py
user = bot.get_user(...) or await bot.fetch_user(...)
I dont think fetch_user caches anyways
that's because you used = twice for the same argument
i think there should be a default kwarg in the SlashOption class
!d nextcord.SlashOption
class nextcord.SlashOption(name=None, description=None, required=None, *, name_localizations=None, description_localizations=None, choices=None, choice_localizations=None, ...)```
Provides Discord with information about an option in a command.
When this class is set as the default argument of a parameter in an Application Command, additional information about the parameter is sent to Discord for the user to see.
there's not, sad
There is
well then just use that :p
it was hidden at the bottom 
yeah the codeblock didn't show all the args
Traceback (most recent call last):
File "C:\Users\domin\AppData\Local\Programs\Python\Python310\lib\site-packages\nextcord\client.py", line 499, in _run_event
await coro(*args, **kwargs)
File "c:\Discord\Maja Projekt\MajaSystem\bot.py", line 220, in on_application_command_error
raise error
File "C:\Users\domin\AppData\Local\Programs\Python\Python310\lib\site-packages\nextcord\application_command.py", line 848, in invoke_callback_with_hooks
await self(interaction, *args, **kwargs)
File "c:\Discord\Maja Projekt\MajaSystem\modules\mod\cog.py", line 195, in timeout
time = datetime(day=now.day + days, hour=now.hour + hours, minute=now.minute + minutes, second=now.second + seconds)
TypeError: 'module' object is not callable```
Mhh
Yeah, the datetime module do be like that
from datetime import datetime
Traceback (most recent call last):
File "C:\Users\domin\AppData\Local\Programs\Python\Python310\lib\site-packages\nextcord\client.py", line 499, in _run_event
await coro(*args, **kwargs)
File "c:\Discord\Maja Projekt\MajaSystem\bot.py", line 220, in on_application_command_error
raise error
File "C:\Users\domin\AppData\Local\Programs\Python\Python310\lib\site-packages\nextcord\application_command.py", line 848, in invoke_callback_with_hooks
await self(interaction, *args, **kwargs)
File "c:\Discord\Maja Projekt\MajaSystem\modules\mod\cog.py", line 211, in timeout
future = now + datetime.timedelta(time)
AttributeError: type object 'datetime.datetime' has no attribute 'timedelta'```
In this case you're no longer using the module. So you can either import it, or switch back to the import you had before and use datetime.datetime in the spot you got the error in previously
from datetime import datetime, timedelta
maybe interaction.channel.id works?
Mhh
Ignoring exception in on_application_command_error
Traceback (most recent call last):
File "C:\Users\domin\AppData\Local\Programs\Python\Python310\lib\site-packages\nextcord\client.py", line 499, in _run_event
await coro(*args, **kwargs)
File "c:\Discord\Maja Projekt\MajaSystem\bot.py", line 220, in on_application_command_error
raise error
File "C:\Users\domin\AppData\Local\Programs\Python\Python310\lib\site-packages\nextcord\application_command.py", line 848, in invoke_callback_with_hooks
await self(interaction, *args, **kwargs)
File "c:\Discord\Maja Projekt\MajaSystem\modules\mod\cog.py", line 211, in timeout
future = now + timedelta(time)
TypeError: unsupported type for timedelta days component: datetime.datetime```
What's time?
time = datetime(year=now.year, month=now.month, day=now.day + days, hour=now.hour + hours, minute=now.minute + minutes, second=now.second + seconds)
What are you trying to do
Traceback (most recent call last):
File "D:\python\lib\site-packages\discord\client.py", line 382, in _run_event
await coro(*args, **kwargs)
File "D:\python\lib\site-packages\discord\bot.py", line 1147, in on_connect
await self.sync_commands()
File "D:\python\lib\site-packages\discord\bot.py", line 643, in sync_commands
registered_guild_commands[guild_id] = await self.register_commands(
File "D:\python\lib\site-packages\discord\bot.py", line 473, in register_commands
prefetched_commands = await self.http.get_guild_commands(self.user.id, guild_id)
File "D:\python\lib\site-packages\discord\http.py", line 353, in request
raise Forbidden(response, data)
discord.errors.Forbidden: 403 Forbidden (error code: 50001): Missing Access```
into the same channel, where the id is taken from?
You have to make the welcome channel object and just send it there
maybe there's error on line 356 which results the event from stopping further
creizy now replicate it
Srry I can't
make an alt account
d! datetime.now
!d datetime.datetime.now
classmethod datetime.now(tz=None)```
Return the current local date and time.
If optional argument *tz* is `None` or not specified, this is like [`today()`](https://docs.python.org/3/library/datetime.html#datetime.datetime.today "datetime.datetime.today"), but, if possible, supplies more precision than can be gotten from going through a [`time.time()`](https://docs.python.org/3/library/time.html#time.time "time.time") timestamp (for example, this may be possible on platforms supplying the C `gettimeofday()` function).
If *tz* is not `None`, it must be an instance of a [`tzinfo`](https://docs.python.org/3/library/datetime.html#datetime.tzinfo "datetime.tzinfo") subclass, and the current date and time are converted to *tz*โs time zone.
This function is preferred over [`today()`](https://docs.python.org/3/library/datetime.html#datetime.datetime.today "datetime.datetime.today") and [`utcnow()`](https://docs.python.org/3/library/datetime.html#datetime.datetime.utcnow "datetime.datetime.utcnow").
Hello everyone, who can tell me how to make this window (probably with the help of what attribute) if this is a window receiving discord hypesquad
if it is necessary briefly, then I need to make a window with such questions.
most likely on discord modals only if you enter text there, then there are ready-made answers
that's a window of discord right?
afaik you can't create such a modal rn
that's right, this is a discord window, if you need to know how I opened it, to launch the "HypeSquad" item, click on it and then you will catch it
Multiple choice prompts are currently not part of discord modals or message components, there's no way to make them right now
They might add them in the future, but we don't know right now
can you check whether or not the else statement is running?
can you check whether channel and message are a thing
we need to make sure things are running
you can put a print statement inside the else and the if to get an idea of what's running
yes
!sql-fstrings -- also, this is not related to your error but would extremely advise against
SQL & f-strings
Don't use f-strings (f"") or other forms of "string interpolation" (%, +, .format) to inject data into a SQL query. It is an endless source of bugs and syntax errors. Additionally, in user-facing applications, it presents a major security risk via SQL injection.
Your database library should support "query parameters". A query parameter is a placeholder that you put in the SQL query. When the query is executed, you provide data to the database library, and the library inserts the data into the query for you, safely.
For example, the sqlite3 package supports using ? as a placeholder:
query = "SELECT * FROM stocks WHERE symbol = ?;"
params = ("RHAT",)
db.execute(query, params)
Note: Different database libraries support different placeholder styles, e.g. %s and $1. Consult your library's documentation for details.
See Also
โข Extended Example with SQLite (search for "Instead, use the DB-API's parameter substitution")
โข PEP-249 - A specification of how database libraries in Python should work
where did you put those?
oh ok so since we confirmed that it printed, you can now check the else part
maybe take a look into those excepts? they might be hiding an error from you
The question is can I give a person a role in voice chat if he does not make sounds for 5-10 minutes (the check will be in a green circle around the avatar) and if the person is simply tortured
I don't think so
also, can you add the channel and message prints to the else part as well?
we again need to check whether it's even running the else part
inside the else statement
then test to see if it prints it
How can I edit this embed to add another line of text?
you can grab the embeds from the message using Message.embeds and it seems like this is the only one embed in the message so it is in the first index of the list, you can grab it by indexing Message.embeds to the first element then use the add_field method on the Embed object
and then send the embed again
@uwu.command()
async def uwuwu(ctx: commands.Context, message_id: int) -> None:
message = await ctx.channel.fetch_message(message_id)
embed = message.embeds[0].add_field(...)
await message.edit(embed=embed)
Alright, thanks
how to make bot stop responding to one command until it's finished
I'm trying to write a function to send a user a DM if their id isn't in a JSON, the problem is that when I try to put 'await send()' inside the function, and then calling it inside the on_message coroutine, it raises an error
yes and the error is
basically you can't run the same command two times
you need to wait before it finishes
how do i make a welcome bot
event on member join
I can't remember rn
nice
so, help pls
!d discord.ext.commands.max_concurrency
@discord.ext.commands.max_concurrency(number, per=discord.ext.commands.BucketType.default, *, wait=False)```
A decorator that adds a maximum concurrency to a [`Command`](https://discordpy.readthedocs.io/en/latest/ext/commands/api.html#discord.ext.commands.Command "discord.ext.commands.Command") or its subclasses.
This enables you to only allow a certain number of command invocations at the same time, for example if a command takes too long or if only one user can use it at a time. This differs from a cooldown in that there is no set waiting period or token bucket โ only a set number of people can run the command.
New in version 1.3.
2022-09-03 17:29:11 INFO discord.client logging in using static token
2022-09-03 17:29:11 INFO discord.gateway Shard ID None has connected to Gateway (Session ID: ef0fd2a1e4bf391bf703208b9897a1fa).
fix ?
Traceback (most recent call last):
File "D:\python\lib\site-packages\discord\client.py", line 382, in _run_event
await coro(*args, **kwargs)
File "D:\python\lib\site-packages\discord\bot.py", line 1147, in on_connect
await self.sync_commands()
File "D:\python\lib\site-packages\discord\bot.py", line 643, in sync_commands
registered_guild_commands[guild_id] = await self.register_commands(
File "D:\python\lib\site-packages\discord\bot.py", line 473, in register_commands
prefetched_commands = await self.http.get_guild_commands(self.user.id, guild_id)
File "D:\python\lib\site-packages\discord\http.py", line 353, in request
raise Forbidden(response, data)
discord.errors.Forbidden: 403 Forbidden (error code: 50001): Missing Access
and how to make it just react and not send this You've reached max capacity of command usage at once, please finish the previous one...
handle commands.MaxConcurrencyReached in your error handler to do what you specifically need to do
how
Is your bot verified?
do you already have an error handler?
@bot.event
async def on_command_error(ctx, error):
if isinstance(error, commands.MaxConcurrencyReached):
...
else:
raise error
in main file?
whichever file contains the bot instance
commands is not found
from discord.ext import commands
^
!d discord.Message.add_reaction
await add_reaction(emoji, /)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Adds a reaction to the message.
The emoji may be a unicode emoji or a custom guild [`Emoji`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Emoji "discord.Emoji").
You must have the [`read_message_history`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Permissions.read_message_history "discord.Permissions.read_message_history") permission to use this. If nobody else has reacted to the message using this emoji, the [`add_reactions`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Permissions.add_reactions "discord.Permissions.add_reactions") permission is required.
Changed in version 2.0: `emoji` parameter is now positional-only.
Changed in version 2.0: This function will now raise [`TypeError`](https://docs.python.org/3/library/exceptions.html#TypeError "(in Python v3.10)") instead of `InvalidArgument`.
ty
await ctx.message.add_reaction(...)
tysm
and last question
how to see all server names where bot is invited?
preferably in embed
I don't think you can do that, as per Discored rules
you can get all the bots servers with bot.guilds then use the .name attribute on each guild in that
but yeah you shouldnt show all the bots guilds publicly
got it
That was the stipulation
then you probably have a second error handler somewhere that sends the error message
can someone help me with this it says i dont have the ctx argument but i do clearly do?
setup_hookdoesnt take context
so when internally called it would raise an error
!d discord.ext.commands.Bot.setup_hook
await setup_hook()```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
A coroutine to be called to setup the bot, by default this is blank.
To perform asynchronous setup after the bot is logged in but before it has connected to the Websocket, overwrite this coroutine.
This is only called once, in [`login()`](https://discordpy.readthedocs.io/en/latest/ext/commands/api.html#discord.ext.commands.Bot.login "discord.ext.commands.Bot.login"), and will be called before any events are dispatched, making it a better solution than doing such setup in the [`on_ready()`](https://discordpy.readthedocs.io/en/latest/api.html#discord.on_ready "discord.on_ready") event.
Warning
Since this is called *before* the websocket connection is made therefore anything that waits for the websocket will deadlock, this includes things like [`wait_for()`](https://discordpy.readthedocs.io/en/latest/ext/commands/api.html#discord.ext.commands.Bot.wait_for "discord.ext.commands.Bot.wait_for") and [`wait_until_ready()`](https://discordpy.readthedocs.io/en/latest/ext/commands/api.html#discord.ext.commands.Bot.wait_until_ready "discord.ext.commands.Bot.wait_until_ready")...
math is a SlashCommandGroup
noid how can i add spacing in my app commands name
i want it to be points add
but it says it cant have spaces
yeah im pretty sure slash commands cant have spaces in their names only slash command groups
ah ok
how would i disable buttons after a certain period of time?
how would I get all member ids in a role on pycord? Do I need to have an intent for this
how to make the bot wait for the user to send code
!d discord.ext.commands.Bot.wait_for
wait_for(event, /, *, check=None, timeout=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Waits for a WebSocket event to be dispatched.
This could be used to wait for a user to reply to a message, or to react to a message, or to edit a message in a self-contained way.
The `timeout` parameter is passed onto [`asyncio.wait_for()`](https://docs.python.org/3/library/asyncio-task.html#asyncio.wait_for "(in Python v3.10)"). By default, it does not timeout. Note that this does propagate the [`asyncio.TimeoutError`](https://docs.python.org/3/library/asyncio-exceptions.html#asyncio.TimeoutError "(in Python v3.10)") for you in case of timeout and is provided for ease of use.
In case the event returns multiple arguments, a [`tuple`](https://docs.python.org/3/library/stdtypes.html#tuple "(in Python v3.10)") containing those arguments is returned instead. Please check the [documentation](https://discordpy.readthedocs.io/en/latest/api.html#discord-api-events) for a list of events and their parameters.
This function returns the **first event that meets the requirements**...
!d discord.ui.View.on_timeout
await on_timeout()```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
A callback that is called when a viewโs timeout elapses without being explicitly stopped.
so my command works but it says "sending command" then it says application did not respond how can i fix this?
@nextcord.slash_command(guild_ids=[TESTING_GUILD_ID], description="Test Greet")
async def test_greet(self, interaction: nextcord.Interaction):
async with self.bot.db.cursor() as cursor:
await cursor.execute(f"SELECT channel_id FROM Welcome WHERE guild_id = {interaction.guild.id}")
channel_id = await cursor.fetchone()
welcome_channel = self.bot.get_channel(channel_id[0])
welcomeEmbed = nextcord.Embed(title = "test", description= f"test", color=nextcord.Color.orange())
await welcome_channel.send(f"{interaction.user.mention}", embed = welcomeEmbed)
Hello there
i need some help with my discord bot
so the problem is that i just changed to visual studio because pycharm didnt show error things in the code so i moved to vs code but now there it asks for Intents and i put it in but now my bot doesnt work
there is no output when i input a command
Is it really possible to make a message under which there will be buttons ? Not as a team. And write a message and use event to make buttons under this message
!e print("VVV do you mean like the buttons under this message? VVV")
@sick birch :white_check_mark: Your 3.11 eval job has completed with return code 0.
VVV do you mean like the buttons under this message? VVV
Satisfactory ๐
i lov that game
what about it ๐
but uh anyone knows why intents are broken ?
nah i just saw your activity xD
Can we see any errors, or any code?
wdym?
Without those we can only take vague guesses as to what's wrong
@commands.command(aliases=["firstmessage"])
@commands.cooldown(1, 5, commands.BucketType.user)
async def firstmsg(self, ctx, channel: discord.TextChannel = None):
if channel is None:
channel = ctx.channel
first_message = (await channel.history(limit=1, oldest_first=True))
embed = discord.Embed(color=col)
embed.description=f"{blue} [Jump To The First Message In This Guild]({first_message.jump_url})"
await ctx.send(embed=embed)
``` any help?
No error at all
What happens when you call the command?
no error messages but like i moved to vs code and when i started the bot up it gave an error about intents so i looked it up and i added it and now the bot runs but i dont get an output on commands
What's the error, and what's your code?
can someone help me
TypeError: init() missing 1 required keyword-only argument: 'intents'
and there was no code
just my whole bot
without intents
it says that because your bot didn't respond to the interaction ( invoking slash command )
send something using interaction.response to avoid it
so i added this intents = discord.Intents.default()
and this bot = commands.Bot(command_prefix=BOT_PREFIX, intents=intents)
the intents=intents
but now there is no output on commands
yes
well, so that you just write a message, send it to the chat and just use the ID of the message itself
you know whats wrong?
!intents are required in 2.0 and up
Using intents in discord.py
Intents are a feature of Discord that tells the gateway exactly which events to send your bot. By default discord.py has all intents enabled except for Members, Message Content, and Presences. These are needed for features such as on_member events, to get access to message content, and to get members' statuses.
To enable one of these intents, you need to first go to the Discord developer portal, then to the bot page of your bot's application. Scroll down to the Privileged Gateway Intents section, then enable the intents that you need.
Next, in your bot you need to set the intents you want to connect with in the bot's constructor using the intents keyword argument, like this:
from discord import Intents
from discord.ext import commands
intents = Intents.default()
intents.members = True
bot = commands.Bot(command_prefix="!", intents=intents)
For more info about using intents, see the discord.py docs on intents, and for general information about them, see the Discord developer documentation on intents.
this is correct
latest discord.py version
how do i see it
like that ?
message = await client.wait_for('message', check=lambda m: m.author == ctx.user and m.channel == ctx.channel, timeout=60.0)
supporting slash commands, buttons, selects, context menus, modals, and all the new stuff
You're probably already on 2.0. Or else you wouldn't have gotten this error
ok
you need intents.message_content = True in order to get message content dispatched to you via the gateway
do i have to import smth ?
You also need to enable it in the developer portal
how and where ?
You can find the discord developer portal here: https://discord.com/developers/applications
in what tab
Sorry?
bot ?
I'm not understanding
Ah, yeah that tab
and under what thing in that tab ?
Make sure this is enabled
intents.message_content = True
@paper sluice
interesting lambda
how can you accept image input
when i try this it doesn't accept the image as a paramater
true
!d discord.Message.attachments
A list of attachments given to a message. If Intents.message_content is not enabled this will always be an empty list unless the bot is mentioned or the message is a direct message.
thanks
hello i need some help again, this is my code
from discord.ui import Button, View
@bot.command()
async def button(ctx):
button1 = Button(label="Click me!", style=discord.ButtonStyle.green, emoji="๐")
async def button_callback(interaction):
await interaction.response.send_message("Hi!")
button.callback = button_callback
view = View()
view.add_item(item=button1)
await ctx.send("This message has buttons!", view=view)
i did pip install discord and pip install discord.py but its still giving the error
the thing that isnt working is the (await interaction.response.send_message("hi"))
anyone knows why ?
how can i get a members avatar url?
an update must have changed its name/location because Member.avatar_url dosent work for me anymore
here is what i got and it still works
@bot.command()
async def avatar(ctx, member: discord.Member = None):
if member == None:
member = ctx.author
userAvatar = member.display_avatar
avaEmbed = discord.Embed(title=f"{member.name}'s Avatar", color=color)
avaEmbed.set_image(url=userAvatar.url)
avaEmbed.set_footer(text=footer)
await ctx.send(embed=avaEmbed)
did you typehint member
what do you mean typehint?
what code did you use
so instead of having a just a static string returned for someones avatar. They made avatars asset objects so now it would be Member.avatar.url
i used something else too and it didnt work
this does
yeah this too
oh ok thanks
๐
anyone knows whats wrong with this ?
userAvatar = member.display_avatar
use that and this if you want to put it in an embed
avaEmbed.set_image(url=userAvatar.url)
dont forget .url
I think he knows how
im aware, tylerr just answers
๐
ok
In Formulaire_Modal.__init__ you need to call super().__init__()
does anyone know how to print whenever a message is sent in a discord channel without using a bot?
So you wanna do stuff without a bot account?
On a user account?
correct
Yeah
5. Do not provide or request help on projects that may break laws, breach terms of services, or are malicious or inappropriate.
why does it break tos?
Because self bots are not allowed according to the tos
๐ฆ
Can u show ur code
For Suite_Formulaire_Button
Well it doesnโt take a channel arguement
Well now ur not passing channel in
cant i use wait_for() in slash command ?
@client.slash_command(guild_ids=[1012830605421068359])
@commands.has_permissions(manage_messages=True)
async def purge(interaction: nextcord.Interaction, arg: int):
channel = interaction.channel
deleted = await channel.purge(limit=arg)
await interaction.response.send_message(f"Deleted `{arg}` number of messages!")
for some reason ppl w out manage messages can use the command
any reason why?
never mind i found the fix
it has already been pinned
Ah
Hey guys, if one of you geniuses could check out #help-avocado and maybe let me know where i fuck up, that would be awesome ๐๐ผ
No, why ?
Read the pins
Specifically this message
โ | AttributeError: 'str' object has no attribute 'to_dict'
how tf do you handle a ton of attributes for a class
??
got a player class and it's storing all the game info for each person and it's getting way too big, gotta be a better way 
storing them into dicts i think
some of them are already dicts
database ?
i use dataclasses for that purpose
so i don't have to set those attributes manually
it is a dataclass
just getting too big
seems just fine, whats the issue with it lol?
i guess, it's just painful to my eyes and im about to add a bunch more
here's a better question
what is the alt for wait_for in slash command
wait_for works in slash commands too
say you have a skill tree like this that you need to unpack into a db, what's the best way to store it in the class 
i could do a dictionary to keep track but then it's a pain to unpack, or i could make a single attribute for each one but then my class is bloated
i guess i could do a list and then just store what each index corresponds to elsewhere
You could probably abstract certain related attributes into their own dataclasses
I do believe dataclasses can link to other dataclasses?

that probably would have been a lot neater than some of the mess i've made with these dictionaries
Still could use some help. Trying to edit an embed's description
are you doing message.embeds.to_dict()?
only thing i can think is you're doing message.content.to_dict() which would give you that error?
No, message.embeds[0].description
You can't edit an embed that way
You need to re-send the message, with the same content and your new embed
ย ย ย ย @commands.command(name='edit')
ย ย ย ย @commands.is_owner()
ย ย ย ย asyncย defย _edit(self,ย ctx,ย id):
ย ย ย ย ย ย ย ย messageย =ย awaitย ctx.channel.fetch_message(id)
ย ย ย ย ย ย ย ย embedย =ย message.embeds[0].descriptionย =ย '''
:video_camera:ย toย getย theย <@&731397963259052133>ย role
:microphone:ย toย getย theย <@&732118149285150800>ย role
:tada:ย toย getย theย <@&732868630710190140>ย role
:video_game:ย toย getย theย <@&786174523405107200>ย role
:movie_camera:ย toย getย theย <@&802013687333781534>ย role
:grey_question:ย toย getย theย <@&809068173868400720>ย role
:question:ย toย getย theย <@&948495979940823070>ย role
:robot:ย toย getย theย <@&1015680899511242832>ย role
ย ย ย ย ย ย ย ย ย ย ย ย '''
ย ย ย ย ย ย ย ย awaitย message.edit(embed=embed)
ย ย ย ย ย ย ย ย pass
do embed = message.embeds[0] first i think
On second thought you might be able to edit it that way
Ignore the indent error on the first line, unrelated (Can't fix it)
then change the description like that
right now you're making the embed object the description string rather than the entire embed
So how do I call it then?
how do i respond to an interaction
embed = message.embeds[0]
embed.description = "your new description"```
K
interaction.response then whatever you're doing
ah it changed
.send_message, .edit_message
use print(dir(interaction.response)) to get a full list of possible attributes
Ty
thought it was interaction.response.send_message
yeah that's one possible response
interaction.response not InteractionResponse
oh
hi, i have a question so is it possible to do an app command like async def verify_app_command(self, interaction: discord.Interaction, member: discord.Member) -> None: ... and when moderators use the app command it only shows the members that have "unverified" role?
the function isnt a variable of the VerifyMe class xd
VerifyMe.verifyme isnt valid
look at the class and at the function
np xd
been staring at this for too long
i quitted python for long time too rip me..
looks like its a game ๐ญ
I just made a bot cog that runs DOOM
(playable)
The people in the server are currently collectively trying to beat hangar
You mean behind the scenes or on discord
on discord
okay so uh
when you run a command
it's !<action> <time> where action is the action you want to do, and time is the time in seconds you want to do it for
oh so it takes a snapshot of it after every command?
after an action is executed, the viewport updates
yeah.
guess that's one way to do it
under the hood the game still runs at 35 FPS
although it pauses the game between commands
(35fps = normal DOOM fps)
I am very proud of myself right now
yeah that's pretty cool
people are even asking me to put the cog into a separate bot they can invite to their own servers
I should do that once I run it on a dedicated machine
(because it pops up a console window shortly before it becomes headless)
At that point you might need to start worrying about concurrency, unless you want to have multiple servers running the same instance of doom
but not sure how you've got it setup under the hood so
damn yeah what am I thinking It's doom, you can run it on a toaster
yeah lol
Also yes this did in fact happen because someone asked me 'but can it run doom"
lmao
since someone suggested it I'm also going to add a minimap
If you make it interaction-based, you could make buttons to control the game
And from my experience with interactions, the edit message endpoint is ratelimited per-interaction ๐
discovered that when I made a tetris bot
problem is, you won't be able to specify how long you want to do an action
sometimes you need to turn for an exact amount
or move for an exact amount
and yes, my bot already has interactions, and I did consider it
Hey all, I am wanting to have an external config file used for my bot. Coming from JS so I would use JSON for this file. I see that I can parse JSON with python but is there a better option for that file type?
JSON would probably be the easiest to parse over something like yaml/yml or toml, you can also use a python file but that only would be readable by a python file over using the config files with other things
Got it, thank you. YAML was my main other consideration.
most people also just parse yaml or toml and make it a dataclass so its an object that contains attrs etc over having a dict with JSON
I like that idea quite a bit, thank you
you mean a dict representing a JSON object since both are hashmaps?
you knew exactly what i ment >;33
you're welcome ๐
Yo

hiii
nothing much, wbu????
Meh, just the usual
