Traceback (most recent call last):
File "/home/runner/testingthis/venv/lib/python3.8/site-packages/discord/client.py", line 343, in _run_event
await coro(*args, **kwargs)
File "main.py", line 43, in on_message
async with aiohttp.ClientSession('https://aipokedex.com',headers=headers) as session:
TypeError: __init__() takes 1 positional argument but 2 positional arguments (and 1 keyword-only argument) were given``` how to resolve this error ?
#discord-bots
1 messages · Page 858 of 1
why is the url there?
it's supposed to be inside session.get
or wherever you make the request
!d aiohttp.ClientSession
class aiohttp.ClientSession(base_url=None, *, connector=None, cookies=None, headers=None, skip_auto_headers=None, auth=None, json_serialize=json.dumps, ...)```
The class for creating client sessions and making requests.
ah, use base_url kwarg there
for example ```py
!msg {"description" : "example", "title": "example title", "image": "https://exmampleimg.com", "thumbnail" : "https://examplethumbnai"}
!e ```py
from json import loads
arg = '{"description" : "example", "title": "example title", "image": "https://exmampleimg.com", "thumbnail" : "https://examplethumbnai"} '
dictionary= loads(arg)
print(type (dictionary), dictionary)
Ah the bot does not support json evals
No I'm dumb
this will work anyways
Cool
how to downgrade aiohttp to meet with requirements of discord?
pip install aiohttp==version
BTW, no need to downgrade it if there are no breaking changes
breaking changes means?
like changing a method name from get_xxx to get_yyy and so on
ohh
its giving some error like cant make package because discord requires this version and that
then just do pip install aiohttp==version
ty
why not working using sublime text for it
is it possible to make an event where if someone decides to put the server's vanity url on their status the bot would detect it?
you can iterate through all the members in the server and check their status
bearing in mind this requires member intents
icic thank you
How to get ctx from interaction ?
You mean like a message?
interactions don’t have ctx
@client.event async def on_message(message): ctx = await client.get_context(message)
found this on stackoverflow
interactions have the interaction
can I invoke a command using interaction ?
Generally ApplicationCommandInteration
it has different methods like send_message instead of send
Yes that’s what a slash commands is
What lib are you using
nextcord
they have slash commands now?
yes but im not using a slash command
They did before too
What are you using? A button interaction or something
dropdown
It was in the alpha release last time I used it
I know this doesn't really help but to be honest most people use discord.py, you'd find a lot more resources online for discord.py
It stop updated
Uh, I guess, they released it officially quite a while ago
their v3 is alpha
nah we use disnake here
and I used to use nextcord religiously
D.py doesnt have slash commands, also, nextcord has examples of views and slash commands on their github
still prefer disnake more due to their pushing of features earlier than nextcord
And the fact they test everything multiple times
Which is reassuring
Sad that everyone leaves after I write something
🗿
You should use slash commands or something for it, sending raw dict is weird
You can just use the send method on the user object
No need to create a dm channel
It's done automatically
Don't use a bare exception
You'll want to handle the specific error
When a member has their dms closed the error is
Would it not be forbidden
hy guys how to sent a embedd text in discord bot like the one above
!d discord.Embed
class discord.Embed(*, colour=Embed.Empty, color=Embed.Empty, title=Embed.Empty, type='rich', url=Embed.Empty, description=Embed.Empty, 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.
Certain properties return an `EmbedProxy`, a type that acts similar to a regular [`dict`](https://docs.python.org/3/library/stdtypes.html#dict "(in Python v3.9)") except using dotted access, e.g. `embed.author.icon_url`. If the attribute is invalid or empty, then a special sentinel value is returned, [`Embed.Empty`](https://discordpy.readthedocs.io/en/master/api.html#discord.Embed.Empty "discord.Embed.Empty").
For ease of use, all parameters that expect a [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.9)") are implicitly casted to [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.9)") for you.
it raises both but it only raises forbidden if yuou dont have perms to get the message history
robin and i had this discussion a bit ago
he said httpexception would be best more cases iirc
Cool
will i able to send embedd text though message.channel.send() method
embed=embed_name
thx ❤️
hi shouldnt this work? Im using a .ini file as config file but I only get errors when I try to run it
config.ini
[Bot]
TOKEN = 'BOT_TOKEN'
# Config File
file = 'config.ini'
config = ConfigParser()
config.read(file)
bot.run(config['Bot']['TOKEN'])
Error:
raise LoginFailure('Improper token has been passed.') from exc
discord.errors.LoginFailure: Improper token has been passed.ilure: Improper token has been passed.
Try printing the token var
Why are you using a .ini file when you can simply put it in the main.py?
looks better + personal preference
Because most people don’t like exposing their tokens
But if you have the file in your computer it doesn't matter
But if you are making a public respository it matters
Then it's easier if you make a .env file
That’s not always the case
You literally argued the point to put it in the main file
Then are saying to use a .env
anyways, it's better we shift from the argument. They're using a .ini file because it's their preference
lol
sum1 help me with this .
are you on discord.py 2.0+?
Oh so it's basically json
I'm just saying that if she / he gets that error, it's easier to make a .env repository
Install discord.py from their github repo
Key and value pairs
pip install git+repo_url
kk thx
wait do u know the link to it ?
thank u
another error
Error,help me(Replit)
you forgor : after def stop(self,bot)
This code is pain
Oh ok
yep it is 😔
legit
Wdym lol,I am making music
we found another one
not a good idea
And make a bot like Rythm
the way you code it is the pain
in discord.embed
i want to small the image size how i can do it ?
Yeah
Not a good idea
Have you installed git?
^
YouTube forced rhythm to shut down
Why not
You can't
dont think so how do i do that
they don’t want people using their API for music bots
cuz it breaks EULA / ToS
Head to their website and download it
i wanna make the event mention the member after smt changed but if i put 'member' it keeps saying missing 1 required positional argument: 'after'. Help please-
yeah thats why most of the bots are getting deleted
So I cant make a music bot?
okay
you can but it's against their ToS, I'd comment more on the topic but I'd rather not get banned lol
^
Are you in a class?
banned..?
it's against rule5
no-
You can get banned from discord
oh ye, i forgor that webhook is a whole different thing in discord, how do i actually let discord make POST requests to my server, not me requesting incoming messages to them? and let discord.py automatically handle them
i think it's called interaction endpoint url
music bots aren't allowed?
it doesn't have anything to do with discord, it is a problem between the company (youtube) and you. So you won't be banned from discord but might be banned from the company
as long as it breaks the EULA or ToS of your music source, thats not allowed
You can get banned from discord. It's against their tos to break others tos afaik
alrighty
anybody can help? or is this isn't supported by discord.py?
^^
Do you mean sending messages to discord via a webhook?
without an event or something?
Can we see your entire file?
Put it in here
!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.
What's with the 6 second slowmode
!d discord.on_member_update
ah
Hello guys ! I created a discord bot on multiple guilds, and each server has an object which contains different informations, such as an admin list. I have a command named !addadmin which need 2 parameters -> server id and discord id. When I add an admin on 2 differents server, lists are the same but it's supposed to be 2 differents lists. This is complete non-sense
elif message.author.id == admin and message.content.startswith('!addadmin'):
msg = message.content.split(' ')
index = getguild(int(msg[1]))
listguilds[index].addToAdminsList(int(msg[2]))
print("Users as been add to administrator in the following guild : " + listguilds[index].guildname)
https://paste.pythondiscord.com/agehamikel - im still a beginner so um dont bully me please-
👀
you shouldn’t need a server id param if you invoke it in that guilds context.
I need it
The code is damn impressive, if u r a beginner ngl
wow a beginner that actually knows some Python
I understand what you say, but it's not solving my problem right now
Indeed a rare sighting nowadays
I'll use a database whatever
so a long time ago, i tried making discord bots with AWS Lambda + py, and i see discord has interactions endpoint url thing, where you can assign in the developer portal, i found out that if you do have the interaction endpoint url, discord will send POST requests to your server / endpoint when your bot receive a message, now, how can i do this exact same thing in discord.py where the POST requests are handled by discord.py itself?
sorry if my explaining is kinda weird 😂
Discord doesn't send POST requests or smth. It uses gateway to send events, like on_interaction, on_message and stuff
err i got help from stackoverflow 
Don't tell me u copied the code...
💀
yeah, how do i handle those in discord.py?
at least u didn't blindly copy pasted
it uses the aiohttp module to open a websocket with the Discord API. Take a look at the gateway.py file in dpy

reinstall
wym
im still a beginner so i dont rely on myself too much since i dont even have much knowledge on python yet (still trying to understand) 
reinstall the module
Its fine, just never stop learning things and don't blindly copy paste code without understanding and u r fine. We are always here in case u need some code help!
pages ?

yes
All cool (:
the problem is, my script keeps turning off, so the websocket connection would close too, i do have an endpoint tho, from what i read, the interaction endpoint url in discord developer portal is used by discord to send messages to your endpoint when it receives mesages
loop.run_forever()```
Run the event loop until [`stop()`](https://docs.python.org/3/library/asyncio-eventloop.html#asyncio.loop.stop "asyncio.loop.stop") is called.
If [`stop()`](https://docs.python.org/3/library/asyncio-eventloop.html#asyncio.loop.stop "asyncio.loop.stop") is called before [`run_forever()`](https://docs.python.org/3/library/asyncio-eventloop.html#asyncio.loop.run_forever "asyncio.loop.run_forever") is called, the loop will poll the I/O selector once with a timeout of zero, run all callbacks scheduled in response to I/O events (and those that were already scheduled), and then exit.
If [`stop()`](https://docs.python.org/3/library/asyncio-eventloop.html#asyncio.loop.stop "asyncio.loop.stop") is called while [`run_forever()`](https://docs.python.org/3/library/asyncio-eventloop.html#asyncio.loop.run_forever "asyncio.loop.run_forever") is running, the loop will run the current batch of callbacks and then exit. Note that new callbacks scheduled by callbacks will not run in this case; instead, they will run the next time [`run_forever()`](https://docs.python.org/3/library/asyncio-eventloop.html#asyncio.loop.run_forever "asyncio.loop.run_forever") or [`run_until_complete()`](https://docs.python.org/3/library/asyncio-eventloop.html#asyncio.loop.run_until_complete "asyncio.loop.run_until_complete") is called.
yeah, i used run_forever
im aware but im not too fond of javascript either-
from the developer portal itself
Ah, missed that part
uh yes
expected emoji jobName
if l >= 10:
g = []
for i in range(len(topJobList)):
g.append((job_emote[topJobList[i]], topJobList[i]))
v = "\n".join(map(str, g))
e.add_field(name="Top Job List: ", value = "".join(v), inline=False)```
code used
Wish I followed these... I just went on copying code and understanding it myself without anyone's help, with google
Fun but difficult tbh
Took me an year and a half to like become an intermediate-professional in Python
@restive coral , we found a half baked
🗿 help
Huh?
whats that supposed to mean
idk
Reptile | ᓇᘏᗢ is half of ConfusedReptile | ᓕಲᗣ
Ah that way
ah
no error but it send (image below) dat text instead of what i want, which is "emoteImage Name"
🗿 ok, lemme try
w-where to add that 🗿
@slate swan :white_check_mark: Your eval job has completed with return code 0.
001 | ('💖', 'healer')
002 | 💖 healer
ah i see, ok thanks
is there a way discord.py can handle this?
they have dicord server!!!!!111??!?
didnt know tht, ty
ig i'm not doing it right 🗿
if l >= 10:
g = []
for i in range(len(topJobList)):
g.append((job_emote[topJobList[i]], topJobList[i]))
v = "\n".join(map(str, *g))
e.add_field(name="Top Job List: ", value = "".join(v), inline=False)```
so, just "*v"?
🗿
e.add_field(name="Top Job List: ", value = *v, inline=False)```...
sum1 help
k wait
what are you trying to do
run my bot but im getting an error 'cogs.pag' raised an error: ImportError: cannot import name 'pages' from 'discord.ext' (unknown location)
(':stab~1: ', 'knight')
(':tank: ', 'tank')
(':moni: ', 'stealer')
(':royalguard: ', 'royal guard')
(':brewer: ', 'brewer')```
what are you trying to do
what do you want pages to be?
yes
is print?
🗿 ??
oh ok (variable??)
🗿 ok
ok 🗿 so u r yerlikaya
:v ok
🗿 ok wait
["(':healer: ', 'healer')", "(':stab: ', 'knight')", "(':tank: ', 'tank')", "(':moni: ', 'stealer')", "(':royalguard: ', 'royal guard')", "(':brewer: ', 'brewer')"] 🗿
arent they are the same 🗿
🗿 ok
:big_moyai:
map returns an object if it's true right?
embed with buttons ?
i try in dat embed=*v but....
k then
(':healer: ', 'healer') (':stab: ', 'knight') (':tank: ', 'tank') (':moni: ', 'stealer') (':royalguard: ', 'royal guard') (':brewer: ', 'brewer')
hey is there anyone work with me on the project of NLP(natural language processing) if yes please pin me out
Maybe ask in #python-discussion? That is not related to this channels topic.
🗿 what da hell is dis
no prob and GGTY 🗿👍
ggty?
my way to say big thanks
i see
sure!
first of all, dont call it Application
The cog loading could use some work? Did you try what I suggested to you a while ago
its not an Application, its a bot - you can call it Bot or the name of your prroject
use load_extensions
!d disnake.ext.commands.Bot.load_extensions
load_extensions(path)```
Loads all extensions in a directory.
New in version 2.4.
Isn't self.connection supposed to be a connection object?
Here is what I suggested in case you lost it
No it's not, you just do it = object , not create an instance of it
You also annotated the function returns, but not anything else? It would be best to stay consistent
like ```py
#what u did
bot = commands.Bot
#what you should
bot = commands.Bot()
that's just an example of instancing.
True, but for regular ol people it's a lot harder to infer the type
For me with typehinting it's always all or nothing
A nitpick @ line 40 asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy()) you could set that below the imports
Yea gotit, I'm on phone and the text appears to small so..
just iterate through and load them individually
Why tho
that way you can check for pycache or unwated stuff
Ah that way
look at the source code of load_extensions
it literally iterates throughj
os.walk(top, topdown=True, onerror=None, followlinks=False)```
Generate the file names in a directory tree by walking the tree either top-down or bottom-up. For each directory in the tree rooted at directory *top* (including *top* itself), it yields a 3-tuple `(dirpath, dirnames, filenames)`.
!d pkgutil.iter_modules
pkgutil.iter_modules(path=None, prefix='')```
Yields [`ModuleInfo`](https://docs.python.org/3/library/pkgutil.html#pkgutil.ModuleInfo "pkgutil.ModuleInfo") for all submodules on *path*, or, if *path* is `None`, all top-level modules on `sys.path`.
*path* should be either `None` or a list of paths to look for modules in.
*prefix* is a string to output on the front of every module name on output.
Note
Only works for a [finder](https://docs.python.org/3/glossary.html#term-finder) which defines an `iter_modules()` method. This interface is non-standard, so the module also provides implementations for [`importlib.machinery.FileFinder`](https://docs.python.org/3/library/importlib.html#importlib.machinery.FileFinder "importlib.machinery.FileFinder") and [`zipimport.zipimporter`](https://docs.python.org/3/library/zipimport.html#zipimport.zipimporter "zipimport.zipimporter").
Changed in version 3.3: Updated to be based directly on [`importlib`](https://docs.python.org/3/library/importlib.html#module-importlib "importlib: The implementation of the import machinery.") rather than relying on the package internal [**PEP 302**](https://www.python.org/dev/peps/pep-0302) import emulation.
this one's the best, disnake uses it for client.load_extensions("./cogs")
basically loading all the cogs in the folder?
wait
lemme just send exactly what disnake does
!d disnake.ext.commands.Bot.load_extensions
load_extensions(path)```
Loads all extensions in a directory.
New in version 2.4.
Mhm yea
if you're using disnake then use that
they changed load_extensions im pretty sure
looks like the most efficient method now
it wasn't in discord.py. I didn't change it, I added it
but i think before it was worse
has it always been that?
load_extension for 1 extension, load_extensions for multiple
load_extension was a thing, load_extensions wasnt
Hi, is there a way to detect if the bot is added to a new server while running ? Thanks !
I didn't want to touch load_extension because it looked like it would break if I tried to touch anything
I migrated to hikari purely because of all the internal dpy fuckery
!d discord.on_guild_join
discord.on_guild_join(guild)```
Called when a [`Guild`](https://discordpy.readthedocs.io/en/master/api.html#discord.Guild "discord.Guild") is either created by the [`Client`](https://discordpy.readthedocs.io/en/master/api.html#discord.Client "discord.Client") or when the [`Client`](https://discordpy.readthedocs.io/en/master/api.html#discord.Client "discord.Client") joins a guild.
This requires [`Intents.guilds`](https://discordpy.readthedocs.io/en/master/api.html#discord.Intents.guilds "discord.Intents.guilds") to be enabled.
true since many people just use their dpy code while migrating to forks
Thanks !
All the type: ignores in discord.py's codebase is enough to make me stay away
you sure it's not something like botname/cogs or whatever? It should work with just what you did
the search may be a bit restrictive
try adding an __init__.py
but I swear it shouldn't be required
kinda sussy
it should find events and slash_commands as modules and go recursively into them
try adding a / before cogs? that probably won't change anything though lol
Did you just do /cogs or ./cogs
that cwd error just means it got something like ../cogs
and the python importer just straight up doesn't support that most of the time
I decided to just disallow that instead of dealing with the bugs
wait wait
how are your directories further nested?
If it's cogs/slash_commands/category/cog.py it won't be able to tell that category is a module
wtf
maybe slash_commands needs __init__.py too?
I honestly hate python's importer
that shit's so unreliable
Is your bot in the same server with the emoji?
In the case of the lemon emoji it probably isnt, that's why you got an ID out
that won't be the same emoji...
Hello. Is there any way to reduce cooldown for users with specific role?:
@commands.cooldown(1, 300, commands.BucketType.user)
how do i make it so when I were to click a button only I could see the result
!d discord.ext.commands.dynamic_cooldown
@discord.ext.commands.dynamic_cooldown(cooldown, type=BucketType.default)```
A decorator that adds a dynamic cooldown to a [`Command`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.Command "discord.ext.commands.Command")
This differs from [`cooldown()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.cooldown "discord.ext.commands.cooldown") in that it takes a function that accepts a single parameter of type [`discord.Message`](https://discordpy.readthedocs.io/en/master/api.html#discord.Message "discord.Message") and must return a [`Cooldown`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.Cooldown "discord.ext.commands.Cooldown") or `None`. If `None` is returned then that cooldown is effectively bypassed.
A cooldown allows a command to only be used a specific amount of times in a specific time frame. These cooldowns can be based either on a per-guild, per-channel, per-user, per-role or global basis. Denoted by the third argument of `type` which must be of enum type [`BucketType`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.BucketType "discord.ext.commands.BucketType").
If a cooldown is triggered, then [`CommandOnCooldown`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.CommandOnCooldown "discord.ext.commands.CommandOnCooldown") is triggered in [`on_command_error()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.discord.ext.commands.on_command_error "discord.discord.ext.commands.on_command_error") and the local error handler.
A command can only have a single cooldown.
New in version 2.0.
you may return None if the user has the role.. ( cooldown is a fictional here )
as long as pkgutil doesn't support it disnake won't either
why do you do that when you can just typehint a as discord.User?
just like you typehinted it to a string, typehint it to discord.User
how do i make it so when I were to click a button only I could see the result
could someone help me
what library?
ephemeral = True exists for most of them
you know what, we could make a custom SourceFileLoader to allow that
the master branch right? While creating the response you may use ephemeral=True inside the sending method
yup that worked tysm
nah it's just that I realized it is possible after all. If the disnake team agrees it's worthwhile to add it we might
Hi anyone remember me
I mainly work on hikari these days so there's not a high chance
What will be the purpose of having it built-in?
If it's going to be widely used, then we should add it anyway 
no idea but it's a thing
I'll ping arl or smth
Or import disnake as discord
or use the disnake shim
how would i make a cooldown on a button in discord. (discord.py)
Nvmd
wdym by cooldowns for a button?
well you would be subclassing the ui.Button and would do some cache-ing stuff
Is there any way to rerun command as user in the **on_command_error ** handler?
a button already takes like 2-3 seconds to respond you know
You could disable the button for a certain time period after a user clicks, I guess?
No.
what?
Idk that sorry
uh
Lol
Probably u thinking im arguing
yea sure, use ctx.invoke()
Thanks
!d discord.ext.commands.Context.invoke
I have not coded my bot for more than 1 week
await invoke(command, /, *args, **kwargs)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Calls a command with the arguments given.
This is useful if you want to just call the callback that a [`Command`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.Command "discord.ext.commands.Command") holds internally.
Note
This does not handle converters, checks, cooldowns, pre-invoke, or after-invoke hooks in any matter. It calls the internal callback directly as-if it was a regular function.
You must take care in passing the proper arguments when using this function.
....?
so i dont need to change my code nvmd
I realize that we can import as
U do know u just replied to a week old message of mine, right?
Qh yes
Okay cool then
Is there any way to check if user has specific role by checking role id?
Same as a normal command, use has_permissons
Best bet is to store the time and call it every hour depending on the tim
So store the time in a db and use a tasks.loop to see if the current time is the time you stored in the db
Or if you don't restart your bot that often then use sleep_until @slate swan that's what I do for my reminder cmd
Ye prob the best choice
Guys I want to create an economy bot and I want to make something different from the YT tutorials
No idea
what do you mean by bot's top role?
Interaction has a guild property, so then you could do Interaction.guild.me
guild is None, was the command ran in the guild?
Oh, you haven't ran it yet
Well the linter isn't messing with you, guild can be None | Guild
Just add an if statement checking if guild is not None
interaction.me is the Client's User object
User's aren't bound to a guild, they have no roles
You need to access me through interaction.guild
Is it possible to get what arguments user provided in command in on_command_error event?
Or otherwise grab the guild from interaction.guild_id
you have ctx
you gotta work it out
Oh, then yea just isinstance
I tried using invoked_with but it doesn't give arguments
the errors don't return arguments, maybe the one that's missing if it's MissingRequiredArgument
well ctx.message
!d discord.ext.commands.Context.invoked_with
The command name that triggered this invocation. Useful for finding out which alias called the command.
The list of transformed arguments that were passed into the command. If this is accessed during the on_command_error() event then this list could be incomplete.
completely my bad
I don't think the bot has anything to do with that
does a bot have subprocesses?
that'd be cool

my website for my discord bot is haunted
that image is in a entire other file
and the links lead to their normal images
so?
Hello, im learn some basics about python, actually im after this video: ||https://youtu.be/rfscVS0vtbw|| , do u think im ready to start with discord.py? Or i need to learn some more about py?
This course will give you a full introduction into all of the core concepts in python. Follow along with the videos and you'll be a python programmer in no time!
Want more from Mike? He's starting a coding RPG/Bootcamp - https://simulator.dev/
⭐️ Contents ⭐
⌨️ (0:00) Introduction
⌨️ (1:45) Installing Python & PyCharm
⌨️ (6:40) Setup & Hello Wor...
Because Discord waits for the next PING event sent by the gateway/websocket every x seconds and if it doesn't receive it, it sends the bot offline
Is it possible to get ctx from interaction ? i need to use ctx.invoke to invoke a command from dropdown
you can get context from a message object
unsure how you would use an interaction to get it
You cannot invoke a slash command/message command/user command
def __init__(self, usernames: List[str]):
self.to_check = usernames``` im tryna make username var to be username = ''.join((random.choice('abcdefghijklmnopqrstuvwxyz1234567890')) for x in range(14))
but i get errror
what is the error
discord.errors.NotFound: 404 Not Found (error code: 10062): Unknown interaction
what does this mean
split the string
to use random.choice and pick a random char
Depending on what the command looks like
ok
You could just call it as a method and provide an interaction instead of context
async def _check(self, session: aiohttp.ClientSession,
username: str) -> None:``` what about this
They have some different attributes and methods so you gotta check for that
await bot.get_command('cmd').__call__(inter, arg1, arg2, ...)```
But remember that you are parsing not the `Context`, but `Interaction`. Better refactor your code and extract the command to some method
!d discord.Member.edit
await edit(*, nick=..., mute=..., deafen=..., suppress=..., roles=..., voice_channel=..., reason=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Edits the member’s data.
Depending on the parameter passed, this requires different permissions listed below...
nick param
use an error handler
? whats the problem/error
is there a emoji converter so i can put the emoji in without doing it manually
one easier method to deal with it using a none default value py async def command(ctx, arg: discord.User=None): if arg is None: # not provided return #do your stuff
It’s gathering wrong user list
seems like an internal error
what's the fix?
what lib are u using?
no, which discord api wrapper
dpy, a fork or another lib
ah ok
look at the error
yeah okay
anyways yeah
first time getting this error, last night and earlier today it was working fine
caeden you know a fix?
do pip list
lemme send the list in a hastebin
Trying to make a log Bot, can anyone help as I have no experience with making Bots at all.
Hastebin is a free web-based pastebin service for storing and sharing text and code snippets with anyone. Get started now.
either do py except exceptiontype1, exceptiontype2: or py except (exceptiontype1, exceptiontype2:) you cant py except (exceptiontype1, exceptiontype2), exceptiontype3
!d discord.Member
it isn't in their code tho
class discord.Member```
Represents a Discord member to a [`Guild`](https://discordpy.readthedocs.io/en/master/api.html#discord.Guild "discord.Guild").
This implements a lot of the functionality of [`User`](https://discordpy.readthedocs.io/en/master/api.html#discord.User "discord.User").
x == y Checks if two members are equal. Note that this works with [`User`](https://discordpy.readthedocs.io/en/master/api.html#discord.User "discord.User") instances too.
x != y Checks if two members are not equal. Note that this works with [`User`](https://discordpy.readthedocs.io/en/master/api.html#discord.User "discord.User") instances too.
hash(x) Returns the member’s hash.
str(x) Returns the member’s name with the discriminator.
is it?
its not his code
i don't have a except in my code
yeah, thought so
wait what
try doing pip uninstall Cogs
they have a lib named cogs
ah
oh shit
that's causing the error
Didnt guild permissions for specific members get removed?
The title of the embed. This can be set during initialisation.
how does some bots ask for admin perms and others at the same time?
why not do it inside the class construction
Smh then help, I'm leaving
embed.title = arg
no i have 2 % im just judging rn
bold?
if bold its like this
**Bold** would give you bold
Alright then, imma head out before you judge the rest of me 😔
async def command_name(ctx, title, desc):
# make embed
title = embed.title
desc = embed.description # smth like that
no?
not how kwargs work lol
yeah
you're just setting a variable
what is your issue its not very clear
can you reword it?
I think he wants to make custom embeds as seen in other bots thru commands
you know Carl bots embed builder? smth like that
Hello, can someone explain me how is it possible and what could be the problem ? Thanks
g is a tuple and g[3] is an id of a channel
ah
just make different arguments lol
just add the kwarg in to the description kwarg?
no need for that f string lol
the method only takes a snowflake maybe in the tuple you added the id as a string?
no need of f string like f".."
Let me check for a second
just take a positional argument that takes the title and then a kwarg its basic python
<class 'int'> for the g[3] variable
can you show whats g
def recoverAllGuilds(self):
with mysql.connector.connect(**self.connection_params) as db:
with db.cursor() as c:
request = "SELECT * FROM serveurs"
c.execute(request)
results = c.fetchall()
return results
results => g
you probably stored the ids as strings if not they are wrong
Yeah but just before the line channel = client.get_channel it's telling me it's an int
I stored them as bigint
I'll check the value
Values are correct
Yeah I know but I'm using a for loop so the value g contains only a tuple, so I can access to g[3] which is an int, but client.get_channel(g[3]) returns None
And all channel ids are correct
then the id is wrong
the method only returns None when incorrect so if its a string or a wrong id it will return None
No
Hey, does someone with python knowledge, know how to make member: disnake.Member param optional?
It's integer, and I checked over and over the values
Can anyone help me make a log bot on Discord?
Ok I found my mistake
There is a 3rd point for the get_channel to return None
from typing import Optional
async def rps(self, inter, option: rps_options, member: Optional[disnake.Member]):
...
member: disnake.Member = None
no need lol
yeah xD
optional is good for return types as well but since 3.10 has typing unions what for
Log bot?
logging everything is against tos
if you have a reason to log msgs youre fine but everything and saving a ton of data in discord is against tos
get_channel returns None if it's still not connected to the server
Thankyouu!!
you mean if it wasnt cached?
Yes, if you try to access get_channel when the bot is still starting
Yeah, It'll log everything that happens in a server.
well you have to wait until the bots cache is ready
!d discord.ext.commands.Bot.wait_until_ready
await wait_until_ready()```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Waits until the client’s internal cache is all ready.
use this^
Nice
youve been answered already
Oh, where
^
oh ty
^
😔 just use a database to store stuff, then use that data against users to threaten them :)
still against tos
Yeah I know that but what I mean is, for example when someone deletes a message or bans a member or a member leaves/joins.
😔 who cares
events
Yeah.
just check docs for the events lol
discord.on_member_join(member)``````py
discord.on_member_remove(member)```
Called when a [`Member`](https://discordpy.readthedocs.io/en/master/api.html#discord.Member "discord.Member") leaves or joins a [`Guild`](https://discordpy.readthedocs.io/en/master/api.html#discord.Guild "discord.Guild").
This requires [`Intents.members`](https://discordpy.readthedocs.io/en/master/api.html#discord.Intents.members "discord.Intents.members") to be enabled.
ASSHHHHLEYYY
So much discord Moderators here.
@bot.event
async def on_message(message):
if message.author.bot:
return
if message.guild.id != 692305542324027424:
print("222")
return
with open("banwords.json") as f:
banwords = json.load(f)
with open("banwords.json", "w") as f:
json.dump(banwords , f)
if {i.lower().translate(str.maketrans('','', string.punctuation)) for i in message.content.split(' ')}.\
intersection(set(json.load(open('banwords.json'))["banwords"])) != set():
name = 'banwords'
base.execute("""CREATE TABLE IF NOT EXISTS {}(userid INT, count INT)""".format(name))
base.commit()
warning = cursor.execute('SELECT * FROM {} WHERE userid = ?'.format(name),(message.author.id,)).fetchone()
if warning == None:
cursor.execute('INSERT INTO {} VALUES(?, ?)'.format(name),(message.author.id,1))
base.commit()
await message.channel.send(f'1 предупреждение\n{message.author.mention} по губам отшлепать?')
elif warning[1] == 1:
cursor.execute('UPDATE {} SET count = ? WHERE userid = ?'.format(name),(2,message.author.id))
base.commit()
await message.channel.send(f'2 предупреждение\n{message.author.mention} по губам отшлепать?')
elif warning[1] == 2:
cursor.execute('UPDATE {} SET count = ? WHERE userid = ?'.format(name),(3,message.author.id))
base.commit()
role = message.guild.get_role(921806885831716875)
await message.channel.send(f' 3 предупреждение.\n{message.author.mention} по губам отшлепать?')
cursor.execute('DELETE FROM banwords WHERE count AND userid') # удаляет значение переменных
base.commit()
await bot.process_commands(message)
!d discord.on_member_join
discord.on_member_join(member)``````py
discord.on_member_remove(member)```
Called when a [`Member`](https://discordpy.readthedocs.io/en/master/api.html#discord.Member "discord.Member") leaves or joins a [`Guild`](https://discordpy.readthedocs.io/en/master/api.html#discord.Guild "discord.Guild").
This requires [`Intents.members`](https://discordpy.readthedocs.io/en/master/api.html#discord.Intents.members "discord.Intents.members") to be enabled.
OKIMIIIII
Hi honey
many*
This command is used only on one server, but for some reason I stopped using other commands on other servers, if I use other commands on other servers, 222 is written to the console, although this if is in another command, what's the problem?
Hiiiiiiiiii caedennnnnnn
oh yeah lmao 🤣
u do know this has become boring, right? 👀
:(
ignore him hes mad he doesnt get welcomed
Meh as if I want to get welcomed
did someone say meh?
😳
Meh who tf would even say meh
But hun always uwu
bro DeniaL where you come from😳
No
I've been summoned by meh
😳 i see that
@bot.event
async def on_message(message):
if message.author.bot:
return
if message.guild.id != 692305542324027424:
print("222")
return
with open("banwords.json") as f:
banwords = json.load(f)
with open("banwords.json", "w") as f:
json.dump(banwords , f)
if {i.lower().translate(str.maketrans('','', string.punctuation)) for i in message.content.split(' ')}.\
intersection(set(json.load(open('banwords.json'))["banwords"])) != set():
name = 'banwords'
base.execute("""CREATE TABLE IF NOT EXISTS {}(userid INT, count INT)""".format(name))
base.commit()
warning = cursor.execute('SELECT * FROM {} WHERE userid = ?'.format(name),(message.author.id,)).fetchone()
if warning == None:
cursor.execute('INSERT INTO {} VALUES(?, ?)'.format(name),(message.author.id,1))
base.commit()
await message.channel.send(f'1 предупреждение\n{message.author.mention} по губам отшлепать?')
elif warning[1] == 1:
cursor.execute('UPDATE {} SET count = ? WHERE userid = ?'.format(name),(2,message.author.id))
base.commit()
await message.channel.send(f'2 предупреждение\n{message.author.mention} по губам отшлепать?')
elif warning[1] == 2:
cursor.execute('UPDATE {} SET count = ? WHERE userid = ?'.format(name),(3,message.author.id))
base.commit()
role = message.guild.get_role(921806885831716875)
await message.channel.send(f' 3 предупреждение.\n{message.author.mention} по губам отшлепать?')
cursor.execute('DELETE FROM banwords WHERE count AND userid') # удаляет значение переменных
base.commit()
await bot.process_commands(message)
salty
This command is used only on one server, but for some reason I stopped using other commands on other servers, if I use other commands on other servers, 222 is written to the console, although this if is in another command, what's the problem?
who is that
Can you help me?
Sure what's up
pip install discord.py[voice] @slate swan
@maiden fable .
This command is used only on one server, but for some reason I stopped using other commands on other servers, if I use other commands on other servers, 222 is written to the console, although this if is in another command, what's the problem?
because of if message.guild.id != 692305542324027424
Imagine reading the error :catsip:
i thought i already had it installed but i had downgraded py on accident and it got rid of it all
You do know u don't have nitro, no?
:wah:
How to fix?
And then there is me who copy pasted the site packages folder when I upgrade to Python 3.10 lmao
remove if message.guild.id != 692305542324027424
Ok,thank you
np
Either Stop pointing it out or gift me nitro lmao
It do be hella expensive here
the classic one costs like 5 USD here which is hella expensive
!rule 7
7. Keep discussions relevant to the channel topic. Each channel's description tells you the topic.
^
wonder who started being ot
Totally not me
Hm,i need this event to work on one server.
hun did
👁️👁️
Don't expect an answer from me, I hate slash commands
User, Message commands FTW since no way of giving args
Which fork?
Bruh
We dont about that
Now who is breaking rule 7?
!ot
Off-topic channel: #ot2-never-nester’s-nightmare
Please read our off-topic etiquette before participating in conversations.
U do know that simply saying "Go away from here" will also make me leave this channel, right?
I dont want you to go, hun
guild_id: int
if getattr(message.guild, 'id', None) != guild_id:
return
the guild id of that server is the guild_id
kinda useless get attr imo
if __name__ == '__main__':
username_list = ''.join((random.choice('abcdefghijklmnopqrstuvwxyz1234567890')) for x in range(4))
total = len(username_list)
system(f'cls && title Ok..')
checker = Checker(username_list)
loop = asyncio.get_event_loop()
loop.run_until_complete(checker.start())```
```py
lass Checker:
def __init__(self, usernames: List[str]):
self.to_check = usernames
async def _check(self, session: aiohttp.ClientSession,
username: str) -> None:
total_checked = 0
async with session.head(
f'https://www.tiktok.com/@{username}') as response:
if response.status == 200 and len(username) > 2:
print('%s[UNAVAILABLE] https://www.tiktok.com/@%s%s' %
('\u001b[31;1m', username, '\u001b[0m'))``` how do i change it from importing to txt to random string
if the msg was in dms then its needed
Ah yea then its a good way
xd
if it were in dms it would not be related to the guild obj
Is there a way disable member param, if I choose Robot as option?
Bro
Replace guild_id with server id?
?
yea, guild is going to be None then its going to raise an error "NoneType has no attr id" bc of message.guild.id
He answered your question
guild_id = your discord guild id
why get attr? so you can get it no matter what guild or
Don't think that's possible
You can of course just ignore the extra parameter
Thank
I have the following code:
import discord
import asyncio
import threading
client = discord.Client()
async def do():
while True:
await client.get_channel(id).send("test")
@client.event
async def on_ready():
th = threading.Thread(target=asyncio.run, args=(await do(),)
th.start()
print("HELLO")
client.run("token")
And I want that HELLO to be printed, actually I want to run a asyncio.run in a thread and continue with the rest of the code, but what happening is that the thread prevent other code from being executed till it ends, any solutions ??
Note: I tried with and without await in the args
on_ready
if the message was sent in dms then the message.guild = None, so if u did message.guild.id its going to raise an error its like saying None.id
xdd
np
okay.
guys please help
ah so it wont raise a none type error
yea thats why use getattr xdd
a clever
ty ;)
yeah dont
I'm no expert but
1 - That won't work because you didn't supply id
2 - Why would you want to run an async func like that in a thread
youre trying to send a msg on a while true loop that will get you ratelimited easily
I tired without
still the same problem
and use the bot framework
hello is not being printed
!d discord.ext.commands.Bot
class discord.ext.commands.Bot(command_prefix, help_command=<default-help-command>, description=None, **options)```
Represents a discord bot.
This class is a subclass of [`discord.Client`](https://discordpy.readthedocs.io/en/master/api.html#discord.Client "discord.Client") and as a result anything that you can do with a [`discord.Client`](https://discordpy.readthedocs.io/en/master/api.html#discord.Client "discord.Client") you can do with this bot.
This class also subclasses [`GroupMixin`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.GroupMixin "discord.ext.commands.GroupMixin") to provide the functionality to manage commands.
You could use a task loop from the commands.Bot class
I used the Client class once
bro what for
Someone wanted a bot to post eth prices every day or smth
Was just a simple task to use tasks
why not use the bot frame work even for tasks lol
cz it is ram consuming
idk kinda bad practice but whatever lol
Who said it was bad practice 
you have a subclass that has way more methods than the parent class why not use the child class🗿
who said hun needs practice 
I need more moyai emojis
Hunter*
k hun
how
windows 11
!d discord.ext.tasks.loop
discord.ext.tasks.loop(*, seconds=..., minutes=..., hours=..., time=..., count=None, reconnect=True, loop=...)```
A decorator that schedules a task in the background for you with optional reconnect logic. The decorator returns a [`Loop`](https://discordpy.readthedocs.io/en/master/ext/tasks/index.html#discord.ext.tasks.Loop "discord.ext.tasks.Loop").
anyone know?
my goal is to make an async function still running while other code or the code under it being executing
with?
he only likes it when ash does it
It's a decorator so
from discord.ext.tasks import loop
@loop(seconds=...,minutes...)
async def foo():
pass
she doesn't wanna listen so meh
what?
😏
meh
meh, if meh also stops listening I will stop saying him
Okay I suck at slash commands
stop the ping
LOL
stop calling me "hun"
XD
confused screams
okay hunter
Thanks
I also stopped calling Ashley brirl instantly
If you want to apply options it's usually:
async def (interaction, argument : str = SlashOption(name,description, required etc..)
pass
unless we using two different libraries
!d
!d discord
To work with the library and the Discord API in general, we must first create a Discord Bot account.
Creating a Bot account is a pretty straightforward process.
Similar names: discordpy.discord, disnake.discord
class discord.ui.View(*, timeout=180.0)```
Represents a UI view.
This object must be inherited to create a UI within Discord.
New in version 2.0.
👀 they usually do so in under 5 seconds for me
lucky
people hate slash commands mainly because in mobile it takes a bit to register lol
Makes sense I don't use mobile discord due to its horrible response times
yeah
right now title is a kwarg make it a positional argument
(ctx, titleMsg=None , *, announcementMsg=None) should be your params
np
yeah its a positional argument
well im not sure because arguments would get confused
and having 2 kwargs idk how the wrapper wont get confused with the parameters
Is it possible to make sure that when the bot is restarted, the variable (sql database) is not reset, otherwise it was 2/3 warns, and after rebooting 0?
Do you store the stuff in database?
And do you run the code locally and what database system do you use?
there is a table where the userid and the number of warns
sqlitw3
And do you host code locally?
hi guys, whats the problem?
@client.event
async def on_ready():
db = sqlite3.connect("main.sqlite")
cursor = db.cursor()
cursor.execute('''
CREATE TABLE IF NOT EXISTS main(
guild_id TEXT,
msg TEXT,
channel_id TEXT
)
''')
print("DB Done")
@client.group(invoke_without_command=True)
async def welcome(ctx):
await ctx.send("Available Setup Commands: \nWelcome channel <#channel>\nwelcome text <message>")
@welcome.command()
async def channel(ctx, channel:discord.TextChannel):
db = sqlite3.connect('main.sqlite')
cursor = main.cursor()
cursor.execute(f"SELECT channel_id FROM main WHERE guild_id = {ctx.guild.id}")
result = cursor.fetchone()
if result is None:
sql = ("INSERT INTO main(guild_id,channel_id) VALUES(?,?)")
val = (channel.id, ctx.guild.id)
await ctx.send(f"Channel has been set to {channel.mention}")
elif result is not None:
sql = ("UPDATE main SET channel_id = ? WHERE guild_id = ?")
val = (channel.id, ctx.guild.id)
await ctx.send(f"Channel has been updated to {channel.mention}")
cursor.execute(sql,val)
db.commit()
cursor.close()
db.close()
Error:discord.ext.commands.errors.CommandInvokeError: Command raised an exception: NameError: name 'main' is not defined
Make the title msg a kwarg too, there's nothing much you can do
def(ctx, *, msg)
Then you will need the command invoker to add a delimiter in it too so that you can use it to split the msg parameter
Rip I'm bad at explaining
he had 2 kwargs but how would the wrapper not get confused by them?
well on each command youre connecting to the db and connecting on ready which on ready it can be fired many times
Get better
i wanna know if you can in js

😔
Well I'm on my phone so 
doesnt matter
My lack of understanding of what is happening prohibits me to snap myself out of my daze, I cant get better
The Code of Conduct for our community.
read this

!rule 1
1. Follow the Python Discord Code of Conduct.

Get better at getting better 
!rule 7 thanks
7. Keep discussions relevant to the channel topic. Each channel's description tells you the topic.
!ot thanks
Off-topic channel: #ot2-never-nester’s-nightmare
Please read our off-topic etiquette before participating in conversations.
im just saying if you dont think it falls into it i can ping them
and prove you wrong
stop starting drama for some irrelevant bullshit
!rule 7 welcome
7. Keep discussions relevant to the channel topic. Each channel's description tells you the topic.
<@&831776746206265384> @slate swan says that swearing doesnt fall into inappropriate language only pinged you guys since he isnt quite following rule 1
That is what you are supposed to do, yes
im just saying to follow the rules
While swearing is not against our rules, excessive swearing, or at other users, falls under harassment and is not permitted
Uhm, isnt minimal and which is not pointed towards anyone allowed?
still not good practice as many young developers come into this channel i we like to keep it civil
he didn't swear anyone
The context was different
doesnt matter
my respect for you
Lets take you for an example 🫂
i dont swear here
@slate swan please back off, because you are causing a problem by prolonging this
im just saying i like to keep this channel family friendly and theirs nothing wrong with that lol
Then if it becomes a problem, contact @novel apex after maybe one attempt to resolve. It's been a few screens now.
!rule 3
That 3d mute turned you in drama queen seems like 

@hoary cargo that's also inappropriate
New topic, final warning for everyone here
.topic
**What's one feature you wish more developers had in their bots?**
Suggest more topics here!
memes
say all you guys want but i go by the rules
img commands
Potential Nukes and nuke templates 😔
uhh
what
and I've been around the block, I thought
!sshhhhhhhhhhhhhhhutthefuckup
HUH
!shhhhhhhhhhhhhhhutthefuckup
✅ silenced current channel for 15 minute(s).
I just need to make sure everyone is clear on something
Treat our staff with respect. If you disagree with a decision made, contact modmail. If you continue to harass our staff, there will be a problem.
Okay?
Okay
!unhush
✅ unsilenced current channel.
I literally laughed when you asked this lol
can you guys pls keep this discussion not against tos or against the rules?
sure we'll do that
Thank you mina
what features are you guys working on today?
birthday system!
oh so the bot pings them a birthday message?
yeah
should have it include a birthday gif :)
i was gonna make a command that gives the movies that are on the top of the week but ill have to find an api for it lol
with imgs
bro that's nice
yeah
I'll steal that soon cool
sure im working on akeno so go for it
ic
hey mina have you learned dpy yet?
IMDB has an API
Qt Style Sheets support various properties, pseudo-states, and subcontrols that make it possible to customize the look of widgets.
Similar names: arcade.color
i made some contributions to our bots using dpy so that counts right? 
how can i get a link to show content in a embed like that
ig so, btw what do you work on like category
Try hitting the url with aiohttp and then parsing the opengraph metadata
any website just look up on google hex codes
!d discord.Embed.set_thumbnail
set_thumbnail(*, url)```
Sets the thumbnail for the embed content.
This function returns the class instance to allow for fluent-style chaining.
Changed in version 1.4: Passing [`Empty`](https://discordpy.readthedocs.io/en/master/api.html#discord.Embed.Empty "discord.Embed.Empty") removes the thumbnail.
i made some super small PRs, often 1-2 lines lol.
did you guys notice the new "Channel claimed by so-and-so" in our help channels?
Yep!
Hello can someone help me with this discord problem. First one main.py and the next picture is music.py import discord
from discord.ext import commands
import youtube_dl
class music(commands.Cog):
def init(self, client):
self.client = client
@commands.command()
async def join(self,ctx):
if ctx.author.voice is None:
await ctx.send("You're not in a voice channel!")
voice_channel = ctx.author.voice.channel
if ctx.voice_client is None:
await voice_channel.connect()
else:
await ctx.voice_client.move_to(voice_channel)
@commands.command()
async def disconnect(self,ctx):
await ctx.voice_client.disconnect()
@commands.command()
async def play(self,ctx,url):
ctx.voice_client.stop()
FFMPEG_OPTIONS = {'before_options': '-reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 5', 'options': "-vn"}
YDL_OPTIONS = {'format': "bestaudio"}
vc = ctx.voice_client
with youtube_dl.YoutubeDL(YDL_OPTIONS) as ydl:
info = ydl.extract_info(url, download=False)
url2 = info['formats'][0]['url']
source = await discord.FFmpegOpusAudio.from_probe(url2,
**FFMPEG_OPTIONS)
vc.play(source)
@commands.command()
async def pause(self,ctx):
await ctx.voice_client.pause()
await ctx.send("Paused")
@commands.command()
async def resume(self,ctx):
await ctx.voice_client.resume()
await ctx.send("resume")
Also, the color numbers used are formatted like
0xRRGGBB in hex
except white.. which they treat as black.. (so lets ignorethat)
yeah with a prefix of 0x
another community member made the suggestion but yeah
0xFF0000 is red
no that breaks youtube tos
ic nice
!ytdl highly recommended to read this
Per Python Discord's Rule 5, we are unable to assist with questions related to youtube-dl, pytube, or other YouTube video downloaders, as their usage violates YouTube's Terms of Service.
For reference, this usage is covered by the following clauses in YouTube's TOS, as of 2021-03-17:
The following restrictions apply to your use of the Service. You are not allowed to:
1. access, reproduce, download, distribute, transmit, broadcast, display, sell, license, alter, modify or otherwise use any part of the Service or any Content except: (a) as specifically permitted by the Service; (b) with prior written permission from YouTube and, if applicable, the respective rights holders; or (c) as permitted by applicable law;
3. access the Service using any automated means (such as robots, botnets or scrapers) except: (a) in the case of public search engines, in accordance with YouTube’s robots.txt file; (b) with YouTube’s prior written permission; or (c) as permitted by applicable law;
9. use the Service to view or listen to Content other than for personal, non-commercial use (for example, you may not publicly screen videos or stream music from the Service)
!e print(0xFFFF00)
@west escarp :white_check_mark: Your eval job has completed with return code 0.
16776960
@west escarp :white_check_mark: Your eval job has completed with return code 0.
0xffff00
to go the other way
!pypi discordheximals i actually have a package with 742 colors that are methods that return hex codes
returns hexcode by name for discord.py and its forks
not trying to advertise but if anyone would like to use it its their lol
@umbral umbrafyi like ashley said above, unfortunately we won't be able to help with such projects (using youtubedl or other projects that would break providers' ToS)
basic color codes
default = 0
teal = 0x1abc9c
dark_teal = 0x11806a
green = 0x2ecc71
dark_green = 0x1f8b4c
blue = 0x3498db
dark_blue = 0x206694
purple = 0x9b59b6
dark_purple = 0x71368a
magenta = 0xe91e63
dark_magenta = 0xad1457
gold = 0xf1c40f
dark_gold = 0xc27c0e
orange = 0xe67e22
dark_orange = 0xa84300
red = 0xe74c3c
dark_red = 0x992d22
lighter_grey = 0x95a5a6
dark_grey = 0x607d8b
light_grey = 0x979c9f
you can use .bm command to bookmark if you guys would like that
asdf
do with u
asdf
British docs
is it really?
classmethod red()```
A factory method that returns a [`Colour`](https://discordpy.readthedocs.io/en/master/api.html#discord.Colour "discord.Colour") with a value of `0xe74c3c`.
!d discord.Colour.red
classmethod red()```
A factory method that returns a [`Colour`](https://discordpy.readthedocs.io/en/master/api.html#discord.Colour "discord.Colour") with a value of `0xe74c3c`.
wooooow
aliases
Is it possible to make the value of the variable be saved, and after restarting the bot, it will have the same value that was before the restart? Sql databases
Rip british me who used Color all the time
why is it for discord.py specifically? seems like it could be used in literally anything
yeah it can it just adds the prefix of 0x but i have the version that returns raw hexcode
British is definitely sexy
TOPIC
ofc
wdym "adds the prefix 0x", that's literally just a way to represent a hexadecimal number
it has nothing to do with discord
in dpy dont you always have to add the 0x prefix?
Do you have some ticket-bot code?
Is it possible to make the value of the variable be saved, and after restarting the bot, it will have the same value that was before the restart?
no
i think it returns an error im not sure
New Conversation Topic: How are you still sane after using py-cord?
Okimii we need answers

never used pycord
depends on the situation. By itself it doesn't raise an error
it's really just a python feature, literally not a single thing to do with discord.py
how so?
wdym how so. Literally just doesn't. idk what specifically is the thing that you would associate it with
i ment on "it's really just a python feature"
maybe so it knows its a hexcode idk
yeah that's what I'm saying, it's used to represent a hexadecimal integer
yeah makes sense
0x for hexadecimal, 0b for binary and 0o for octal
while making it the return type was an int while i thought it was a str because it had letters so it does make sense