#discord-bots
1 messages · Page 1128 of 1
pip install numpy, and this is not the right channel for this
Delete the message
You have your bot token there :)
So go on the Developer Portal and reset it now
gnam
ah just ignore it
@velvet compass Seen you're active, may you delete the message? It contains their bot ID and the user doesn't seem to react.
It isn't reacting since its a photo
what isn't?
I meant the user who sent it didn't react to that
@slate swan I removed your message since it contained your bot token. Please take the time to reset the token to make sure it is not compromised
Ah, usually our bot filters tokens in messages
Yeah realized you meant the bot filter 
I dropped. Thank you very much for keeping up with these things. I will try not to send the token anymore
hmm we'll see since i use slash
Union[Member, ClientUser]: Similar to Guild.me except it may return the ClientUser in private message contexts.
Dear please tell me what is wrong?
Once again, you have not installed the package
pip install tkinter
Reading the error will help you find what package you're missing
Especially for the next time
Yo
@tasks.loop(seconds = 60) # repeat after every 60 secondss
async def myLoop():
await bot.wait_until_ready()
async with aiohttp.ClientSession() as session:
async with session.get('http://87.237.52.47:30226/players.json') as response:
data = await response.read()
hashrate = json.loads(data)
data2 = [player["name"] for player in hashrate]
print(data)
embed = discord.Embed(
title= 'Szerver Státusz',
description = f"Információk: Ha problémád adódik a csatlakozással, nyiss egy ticketet!" ,
color= 0x206694
)
embed.add_field (name= "Szerver Státusz:", value = ('\N{WHITE HEAVY CHECK MARK}') , inline= True)
embed.add_field (name= "Online Játékosok", value = len(data2) , inline= True)
embed.add_field(name= "Játékosok", value = ", ".join(data2) if data2 else "---" , inline= False)
channel = bot.get_channel(962050444031557692)
message = await channel.fetch_message(991736240749695108)
await message.edit(embed=embed)
await message.edit(content="", embed=embed)
myLoop.start()```
When I start the bot, I get this error:
```PS C:\Users\Realm\Desktop\bot> & C:/Users/Realm/AppData/Local/Programs/Python/Python310/python.exe c:/Users/Realm/Desktop/bot/main.py
Traceback (most recent call last):
File "c:\Users\Realm\Desktop\bot\main.py", line 176, in <module>
myLoop.start()
File "C:\Users\Realm\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\tasks__init__.py", line 398, in start
self._task = asyncio.create_task(self._loop(*args, **kwargs))
File "C:\Users\Realm\AppData\Local\Programs\Python\Python310\lib\asyncio\tasks.py", line 336, in create_task
loop = events.get_running_loop()
RuntimeError: no running event loop
sys:1: RuntimeWarning: coroutine 'Loop._loop' was never awaited
PS C:\Users\Realm\Desktop\bot>```
yes i read i tried to install but it doesn't find it. that's why I wrote it, I thought maybe I wrote the command incorrectly
where is the rror still no idea
you need to start the loop in async context
please show the async part in the source code
myLoop.start() is a sync function that creates a task tasks.Loop._loop
👍
@austere gust you need to start the loop in something like the setup_hook
well if not using cogs yeah
How to make a check that the bot was kicked manually from the voice channel
Not using cogs
but now it doesn't updating the message 💀
True
I uploaded to my vps, and it stopped working
when I started on my pc, it worked
💀
maybe the version of discord.py on your vps is v2
because that code would work in earlier versions
exactly the same version
and I am using v2 too
maybe the version on your pc is v2 but before the async changes were added
bro I downloaded the same
I saved the link for my self
https://github.com/Rapptz/discord.py
this is the version I use
An API wrapper for Discord written in Python. Contribute to Rapptz/discord.py development by creating an account on GitHub.
and it is on the vps too
no because there is active development so things will change over time
you can read https://gist.github.com/Rapptz/6706e1c8f23ac27c98cee4dd985c8120 for the asyncio changes
Dear. entered pip install tk and it still gave an error. please tell me what it can be?
although when I enter pip install tkinter it says that there is no such module
oh so the task issue is new
its because the task is never actually starting
I am not using cogs
everything is in main.py 😂
its still the same
it sets client.loop and other things that use the event loop
ty all
when im trying to auto delete a interaction after sent nothing happens,
await interaction.response.send_message("Suggestion sent!", ephemeral=True, delete_after=10)
i dont get an error code, the message just doesnt get deleted
you cant delete ephemeral messages
the user can only dismiss them
oooh, thats gash. no worries cheers
oh that's a thing, thanks!
👍

@slate swan hmm it still returns None(offline) st = inter.guild.get_member(self.bot.user.id).status
im pretty sure you need this

😭
the command is named info not staff fyi
the cog has nothing to do with the command name
unless it's a subclass of GroupCog
wait u can group cogs?
group cogs? what?
i thought GroupCog was like command groups
What would grouping cogs even entail
they are but more like a cog styled group
what so it's a subclass of GroupCog?
hmm
ah, can I see whole of the cog?
...
oh wait, you werent creating the commands using the group variable smh
Dear, tell me what could be wrong?
Afternoon all - is there anywhere I can ask for advice on Slack bots?
role = discord.utils.get(guild.roles, name="[I] Member")``` is [] interfering in the name?
You could try one of the off topics
@sick birch what do u think
What's the issue?
this
the [I]
cheers will give it a try
Well is the role [I] Member in discord?
The name has to match exactly character for character to the one on discord
yes
And it's still returning None?
yeah
@sick birch can I have 2 cog listener for on raw reaction in the same py file?
Then it's either an intents issue or the guild roles may not be cached
Yes, as long as it's a listener as opposed to an event
@commands.Cog.listener()
async def on_raw_reaction_remove(self, payload):``` like this?
Yes
What's not working? the utils.get or the listener?
white_check_mark right? or white check mark
listener
And what about the listener is not working?
@commands.Cog.listener()
async def on_raw_reaction_add(self, payload):
message_id = payload.message_id
if message_id == 991788878228897892:
guild_id = payload.guild_id
guild = discord.utils.find(lambda g: g.id == guild_id, self.bot.guilds)
if payload.emoji.name == 'white check mark':
role = discord.utils.get(guild.roles, name="[I] Member")
member = discord.utils.find(lambda m : m.id == payload.user_id, guild.members)
if member is not None:
await member.add_roles(role)
@commands.Cog.listener()
async def on_raw_reaction_remove(self, payload):
message_id = payload.message_id
if message_id == 991788878228897892:
guild_id = payload.guild_id
guild = discord.utils.find(lambda g : g.id == guild_id, self.bot.guilds)
if payload.emoji.name == 'white check mark':
role = discord.utils.get(guild.roles, name="[I] Member")
member = discord.utils.find(lambda m : m.id == payload.user_id, guild.members)
if member is not None:
await member.remove_roles(role)```
there's the code
Why are they the same?
I have another listener for reactions and it works, it's the exact same
one is for removing
It's not white check mark
Not sure exactly what it is, but try printing it
print(payload.emoji.name) and react with the emoji on discord
the listener wont work
Can you try printing the payload.emoji.name as the first line in the listener?
That's a good step towards diagnosing the issue
doesn't work
Okay, do you have the proper intents enabled then?
yep
Can I see the intents?
intents = discord.Intents.default()
intents.members = True
bot = commands.Bot(command_prefix=">", help_command=None, intents=intents)```
Try discord.Intents.all()
nope
doesn't work py intents = discord.Intents.default() intents.members = True discord.Intents.all()
Can I see the new on_raw_reaction_add function?
wdym
Oh that's not what I meant
what would be new about it
intents = discord.Intents.default()
?
The new print statement as the first line to ensure events are coming through
yeah it didn't work at all
Can I see your intents again, just to make sure you've coded it right
that doesn't even make the programme start
intents = discord.Intents.default()
intents.members = True
bot = commands.Bot(command_prefix=">", help_command=None, intents=intents)```
You haven't changed anything
Use discord.Intents.all() instead of discord.Intents.default()
Well yeah because this is wrong
If you put it in the right place it shouldn't crash instantly
intents = discord.Intents.all()
intents.members = True
bot = commands.Bot(command_prefix=">", help_command=None, intents=intents)``` like this?
Right
kills programme instantly..
Any errors?
Most likely not enabled the privileged intents
I did
Do you get any errors when it crashes? Just to be sure
Can I see the new listener with the print statement?
Just to ensure it's in the right place
We need to figure out if the event's coming through at all
Why would you enable all the intents, if you don't need all of these privileged intents though?
here?
And when you react on discord, nothing is printed in console?
nope
Okay, are you actually loading the cog?
Are there commands in that cog that work?
def load():
for filename in os.listdir('./cogs'):
if filename.endswith(".py"):
bot.load_extension(f'cogs.{filename[:-3]}')
load()```in main
yes
Hmm.. can I see the developer page for your bot?
Make sure the right things are switched on
the other raw reaction add works...
It would crash if they wouldn't be checked
With an error message
I wonder what's special about the other one that works
Can you paste the code for both of your listeners?
Wait how can you start the bot with all intents in code but not crash while not having them all enabled in the developer portal
@commands.Cog.listener()
async def on_raw_reaction_add(self, payload):
message_id = payload.message_id
if message_id == 991482553959731352:
guild_id = payload.guild_id
guild = discord.utils.find(lambda g: g.id == guild_id, self.bot.guilds)
if payload.emoji.name == 'roblox':
role = discord.utils.get(guild.roles, name="Roblox")
elif payload.emoji.name == 'minecraft':
role = discord.utils.get(guild.roles, name="Minecraft")
elif payload.emoji.name == 'brawlhalla':
role = discord.utils.get(guild.roles, name="Brawlhalla")
member = discord.utils.find(lambda m : m.id == payload.user_id, guild.members)
if member is not None:
await member.add_roles(role)
@commands.Cog.listener()
async def on_raw_reaction_remove(self, payload):
message_id = payload.message_id
if message_id == 991482553959731352:
guild_id = payload.guild_id
guild = discord.utils.find(lambda g : g.id == guild_id, self.bot.guilds)
if payload.emoji.name == 'roblox':
role = discord.utils.get(guild.roles, name="Roblox")
elif payload.emoji.name == 'minecraft':
role = discord.utils.get(guild.roles, name="Minecraft")
elif payload.emoji.name == 'brawlhalla':
role = discord.utils.get(guild.roles, name="Brawlhalla")
member = discord.utils.find(lambda m : m.id == payload.user_id, guild.members)
if member is not None:
await member.remove_roles(role)```This is the cog listener that works
The 2nd one is the one that works?
both of those
these work perfectly
If they both work then what was the issue in the first place?
the other 2 don't work
Okay.. can I see the code for the ones that don't work
THESE DONT WORK
Ah, they look identical
-_-
And all 4 of these are in the same cog?
yes
i asked u at the start if there can be multiple of these cog listeners
and you said yes
Which there can be, yes
When I asked you to put the print statement, did you put it in the one that worked or the one that didn't?
And it was the first line, and it still didn't work. Okay, strange
!paste Tell you what. Can you paste everything in that file in here
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.
Don't leave anything out except confidential stuff
e_сross = open( "./emoji/general/crosss.txt", "r", encoding="utf-8").readline()
e_hp = open( "./emoji/сharacteristics/hp.txt", "r", encoding="utf-8").readline()
e_gems = open( "./emoji/resources/gems.txt", "r", encoding="utf-8").readline()
e_profession = open( "./emoji/profession/profession.txt", "r", encoding="utf-8").readline()
e_clan = open( "./emoji/clan/clan.txt", "r", encoding="utf-8").readline()
e_bank = open( "./emoji/general/bank.txt", "r", encoding="utf-8").readline()
e_auction = open( "./emoji/general/auction.txt", "r", encoding="utf-8").readline()
e_earthmap = open( "./emoji/general/earthmap.txt", "r", encoding="utf-8").readline()
e_moonmap = open( "./emoji/general/moonmap.txt", "r", encoding="utf-8").readline()
e_inventory = open( "./emoji/general/inventory.txt", "r", encoding="utf-8").readline()
e_team = open( "./emoji/general/team.txt", "r", encoding="utf-8").readline()
e_donat = open( "./emoji/general/donat.txt", "r", encoding="utf-8").readline()
I did it at all, but the panel still gives an error for some reason (((
In here, the first 2 are the ones that don't work, and the last 2 are the ones that do work?
the first 2 don't work
the add and remoev
the ones with minecraft, roblox work
Okay, just want to make sure since like I said they look almost identical
That's my point
@scarlet aurora can you replace print(payload.emoji.name) with something else like print("Event works") or whatever
you have the code, why don't you do it to your "liking" since I'm probably doing it wrong
They have all intents enabled in code, yet only one activated in the developer portal. It should instantly crash, unless they've changed something in the past months I haven't touched Python.
I already tried that
I can't. Don't have a python environment set up on the machine I'm not and I'd rather not
And it still wouldn't print?
The code linked has 4 listeners, all of them on_raw_reaction_add, the first 2 don't work while the last 2 do work
Which is what stumps me because either they should all work or none of them should work
Oh wait, didn't notice that
but yeah add and remove
still.. should all work
@scarlet aurora instead of printing something to console, try sending a message to discord instead. Maybe you have something that's eating up any stdout
Like await bot.get_channel(payload.channel_id).send("event works")
ight
Dear please tell me what could be wrong?
Don't think so, as the event doesn't even get called in the first place (no print statement)
😔
intents = discord.Intents.all()
intents.members = True
bot = commands.Bot(command_prefix=">", help_command=None, intents=intents)``` killed my programme though
now that I saved it
Yeah that's expected
You don't have all the privledged intents enabled in the dashboard
self._loop.call_soon(self._call_connection_lost, None)
File "C:\Users\llVll\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 746, in call_soon
self._check_closed()
File "C:\Users\llVll\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 510, in _check_closed
raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed
Exception ignored in: <function _ProactorBasePipeTransport.__del__ at 0x000001EEF6EB4AF0>
Traceback (most recent call last):
File "C:\Users\llVll\AppData\Local\Programs\Python\Python39\lib\asyncio\proactor_events.py", line 116, in __del__
File "C:\Users\llVll\AppData\Local\Programs\Python\Python39\lib\asyncio\proactor_events.py", line 108, in close
File "C:\Users\llVll\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 746, in call_soon
File "C:\Users\llVll\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 510, in _check_closed
RuntimeError: Event loop is closed
C:\Users\llVll\Desktop\Projects\TMG Bot .git>``` instant crash
Not saving the file explains that now 
Yeah that's expected. Go back to using the default intents, or enabled all intents in the dashboard
Lol.. that should've hinted something was off
I haven't touched it for ages so I thought it eventually had changed
now we're back at square 1
Still found it weird but yeah
so.. what was the original issue again?
nothing works
the listener doesn't listen to me
😔 does the print statement still work though
i just want to make sure the events are actually getting through
if they are it should just be a logical issue which is easy to solve
no
Did the print statement work with all intents enabled?
And after it was saved of course
no it killed the programme
@sick birch Do you have any SQL knowledge ?
Not really, I suggest ask in #databases
Do me a favour, enable all intents in the dashboard. Then switch over to discord.Intents.all()
Database models still fall into #databases
WALLAHI ASTUFURIHALLAHHHHH
ight, 1 sec
yeah that pretty much sums up what i'm feeling
people don't really reply there 🤔
well.. claim a help channel maybe
nobody replies there either
Not much else you can do other than wait. We can't all post our questions in #discord-bots because that's where everyone's active
it's enabled now
Hello I want to get bans in a server but I also want to set the limit to 5k is this possible ? I tried this guild.bans(limit=5000) but I got this error (TypeError: bans() got an unexpected keyword argument 'limit')
@sick birch
any suggestions?
why would u get 5000 bans first of all?
This server has so many bans xD
why don't u just pull every member banned in a guild put it in a list then enumerate pages
1k isn't enough
does your bot start with discord.Intents.all()?
@woven summit dms
yes
Does the listener print something?
doesn't work
Do the other commands work?
Try putting a print statement in all 4 listeners and see if any of them work
Make sure they're all different prints so you can tell which one printed
yes
And let me know what happens
you wont believe what happened
I think I will at this point
a grand total of NOTHING
Do the other commands work though?
yes
Okay, other commands in cog works, but none of the listeners
We're getting somewhere
And double checking, but you have all the intents enabled, both in dashboard and in the code?
yes
Hmm... that's very odd
the other listeners work
Which other ones? The ones in other cogs?
Are the listeners in the other cogs also on_raw_reaction_add and on_raw_reaction_remove?
Hmm, not sure then. Probably just a d.py bug and not much you can do about it
If you're 100% sure everything else is running properly
🤔
alright @sick birch .... thanks for nothing
So I'm making a interactive FAQ with two dropdowns: A main page with a dropdown and then each topic in the first dropdown opens up to show a message with another dropdown, Is there a way I can pass the value of a SelectOption from one dropdown to the other?
can i help u?
what are u trying to do
discord.app_commands.errors.CommandInvokeError: Command 'userinfo' raised an exception: AttributeError: 'Interaction' object has no attribute 'author' any ideas?
interaction.user
how install my discord bot in a vserver with debian?
We were debugging a strange error for the better part of an hour lol. They have a few on_raw_reaction_add listeners, which weren't even getting called (we knew this because we had print statements as the first line). Other commands in that cog worked just fine. Other listeners of the same type work just fine in other cogs. They're certain all intents are enabled and are set up properly
i tried to help him too in dms.. that's weird
the event is not being called when he adds the reaction.. that's what he said
It was. They saved it, same issue afterward
What is the recommended library for slash commands now? And would it be much work to switch over from discord_slash?
Is there an issue with discord_slash that should make me want to change? And is disnake that much better than discord.py?
They're both relatively on the same level. personal preference
The main issue with discord_slash is that it was hastily put together in that period when everyone was panicking and didn't know which library to use
Right after discord.py announced it was discontinuing development, which was not long after discord themselves announced that migrating to slash commands would be mandatory
So the implementation isn't necessarily great, and probably not upkept as well as discord.py or disnake which seem to be the big contenders
That's beyond me. There was a big gist about it, but I couldn't be bothered to read it myself
Both personal reasons for Danny and others that were in the gist
Does documentation exist for slash commands in Discord.py? Can't seem to find any
beautiful
moduleNotFoundError: No module named 'discord' need help pls
First question.. do you have it installed?
with pip install yes
pip install discord.py
Make sure it's the right version
To be sure use this syntax:
python3 -m pip install discord.py
can i use my windows powershell? or the console in pycharm
PyCharm has its own venv did you install it in there?
nope installed with powershell
and how i install this with venv?
my system can does not find the git link
ERROR: Cannot find command 'git' - do you have 'git' installed and in your PATH?
okay its done
Can I put the bot on a vserver with debian so that it is online 24/7?
i dont can start my bot this error: TypeError: intents parameter must be Intent not <class 'disnake.flags.Intents'>
How long is a "while"?
What do you guys name your cogs?
depends on what the cog contains and it must always be named with upper word
Let's say I just had a cog that contained all my slash commands. SlashCog seem appropriate? Would include cog in the name?
AppCommands would suite better imo
So it is not convention to include Cog in the class name then?
its all personal preference really
Gotcha. What exactly is the rule of thumb for splitting up functionality by cogs?
I have a task that loops, its a very long method that calls one other helper method. Should that get a cog? And then my slash commands in a separate one? Or should one really long command be split into its own cog itself?
Someone is using PyCharm here?
Yeah, why?
File "E:/Windows Apps/Test/python/discord bot/main.py", line 2, in <module>
my_secret = os.environ['TOKEN']
File "C:\Program Files\Python37\lib\os.py", line 681, in __getitem__
raise KeyError(key) from None
KeyError: 'TOKEN'
Process finished with exit code 1``` I got this error when using .env files, I installed ENV plugin
my_secret = os.environ['TOKEN']
bot.run(my_secret)``` here is my code
thats not pycharm thats just the wrong key lol
!e print({1:2}[3])
@slate swan :x: Your eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "<string>", line 1, in <module>
003 | KeyError: 3
I don't think I know anything about ENV plugin, but I usually go to Edit Configurations for my file, go to configuration tab, and you can check if system environment variables are included there or if you have the ones you want set @deep osprey
thanks ❤️
Does anyone know how to get the ID of a custom emoji
yeah

991866568638210108
its discord.Client
The emoji’s ID.
if youre asking for the format its <name:id>
TypeError: Client.event() missing 1 required positional argument: 'coro'
dont call the deco
didn't call anything
No () after @client.event
aka calling the deco lol
python doesnt lie, so check your other lines!
how do i add the account age to my embed like dyno?
!d discord.Member.created_at
property created_at```
Equivalent to [`User.created_at`](https://discordpy.readthedocs.io/en/latest/api.html#discord.User.created_at "discord.User.created_at")
tyy
can i mention @everyone in a disnake embed?
you can't mention (ping) anything in embeds
lol then how does dyno do it
you can still get that ui (?), it won't ping anyone though
oh. how can i mention then since i need to notify the group when the embed was sent should i just have it send a seprate message that mentions and tells them to check the above mention?
mentioning is only allowed in descriptions and field values too
wait will that ping them?
nope
so just do that?
if you do the @fading marlin thing in a title, it'll stay as @fading marlin instead of converting to @fading marlin
you can send the @ outside of the embed, in the same message
wait how would that code look
.send("@ bonk", embed=embed)
unless disnake's Messageable.send for some reason only takes keyword arguments, it should look like that
try it and see
iirc that won't work
it worked lol
you need to do .send(guild.default_role.mention)
i needed to mention the everyone since it was a dnd anoucment for our next session
F-string here is totally useless as it’s already a string
WhAT Do YoU MeAn
oh yeah, and i just remembered~
dammit i forgot
screw my brains memory leak
I'm very guilty of this myself... 
str(str())
!e
print(str(str(str())))
@sick birch :warning: Your eval job has completed with return code 0.
[No output]
Hi robin
Me working on my comamnd challenge 😴
Am i allowed to use slash commands?
optional args in slash commands? yes
I am facing one problem in it
import discord
from discord.ext import commands
from discord import app_commands
class MySlashCog(commands.Cog):
def __init__(self, bot: commands.Bot) -> None:
self.bot = bot
@app_commands.command(name="ping", description="...")
async def _ping(self, interaction: discord.Interaction):
await interaction.response.send_message("pong!")
I am not able to understand what would be setup function for it
async def setup(bot: commands.Bot) -> None:
await bot.add_cog(MySlashCog(bot))
this?
Ye
why is self there?
But i am not able to understand how would it be with slash commands
oops
ah
wdym? same way you'd do normally?
But i think it's different with slash commands
unless something changed that I'm not aware of, nope. You're setting up a cog 🤷
import discord
from discord.ext import commands
from discord import app_commands
class MySlashCog(commands.Cog):
def __init__(self, bot: commands.Bot) -> None:
self.bot = bot
@app_commands.command(name="ping", description="...")
async def _ping(self, interaction: discord.Interaction):
await interaction.response.send_message("pong!")
class MySlashBot(commands.Bot):
def __init__(self) -> None:
super().__init__(command_prefix="!", intents=discord.Intents.default())
async def setup_hook(self) -> None:
await self.add_cog(MySlashCog(self))
await self.tree.copy_global_to(discord.Object(id=123456789098765432))
await self.tree.sync()
bot = MySlashBot()
bot.run("token")
This is an internal cogs but idk how to do in external cogs
The slash commands
oh, you just self.add_cog in your setup_hook iirc
not sure why you'd want to add a cog inside your main file though 
I wanted to ask how could I do with setup_hook
why don't you just add your slash commands using your bot's instance though?
!d discord.ext.commands.Cog.load_extension
!d discord.ext.commands.Bot.load_extension
await load_extension(name, *, package=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Loads an extension.
An extension is a python module that contains commands, cogs, or listeners.
An extension must have a global function, `setup` defined as the entry point on what to do when the extension is loaded. This entry point must have a single argument, the `bot`.
Changed in version 2.0: This method is now a [coroutine](https://docs.python.org/3/glossary.html#term-coroutine "(in Python v3.10)").
I want slash commands in cogs
use this for external cogs
Ik bro
you already have it don't yog?
But not with slash commands
its the same
I already have many cogs for commands
I am using slash comannds first time
But do we need to provide guild_ids to make it work?
no
Will it be global? If yes 😁
you need that only if you want the commands to be limited to some servers
Ty anyway
import discord
from discord.ext import commands
from discord import app_commands
class MySlashCog(commands.Cog):
def __init__(self, bot: commands.Bot) -> None:
self.bot = bot
@app_commands.command(name="ping", description="...")
async def _ping(self, interaction: discord.Interaction):
await interaction.response.send_message("pong!")
async def setup(bot):
await bot.add_cog(MySlashCog(bot))
Is it fine?
I just run the code but my slash comamnd not came
seems fine but is the extension added?
wait for some time, reload your discord, turn integrations off and on
hey sorry if I'm butting in mid conversation but, I was wondering if anyone could help? I want to have my discord bot take user input, turn it into a variable and insert the variable into this BeautifulSoup4 command: ```python
definitions = doc.find_all(text='insert user input here')
print(definitions[0].parent.parent)
to then put into this discord.py bot command:
```python
async def on_message(message):
if message.content.startswith('/i '):
await message.channel.send('')
I reserved a help channel and then immediately saw this channel and figured it would be a better place to ask, since its more directly related
could you be a bit more specific with your question?
Yeah, sorry! I want my discord bot to be able to parse the HTML file for a glossary page, and when a user asks it to find a specific term, spit out the definition for that term. I've already managed to code the HTML parsing, but I need to have it so that instead of using the code I made with a sample term, it will search for the one that the user asks for. I was told the best way to do that was to take input and turn it into a variable and plug it into that first code block.
I hope that's more clear
You're on the right track, you can get the message content using message.content. You can store it in a variable like so:
user_input = message.content
and do whatever you want with it (e.g pass it into another function)
sounds like you want to make some sort of dictionary?
If you are trying to make a dictionary for words and their definitions, then there are cool APIs and you don't have to mess with the whole web scraping thing
well, I'm using requests to just take info from the page, since it's all there. I have the right method of finding the tag for all the text I want, it's just getting the discord command to sift that info with something the user sends instead of just using the one sample term I have in the string of the code.
(this is how it currently is, with the sample term in)
url = 'https://pflag.org/glossary'
result = requests.get(url)
doc = BeautifulSoup(result.text, 'html.parser')
definitions = doc.find_all(text='AFAB')
print(definitions[0].parent.parent)
Okay, sounds good. Just use the message.content inside your on_message command, which contains the user's input
Pass it into your HTML parser/definition finder function, instead of using the sample term
switch to aiohttp if you're sending a request every time the function executes too
There is option of remove integration?
so would that look like?
definitions = doc.find_all(message.content.startswith('/i ')
print(definitions[0].parent.parent)
Keep the if statement as it is, and use message.content inside
oh just message.content, okay
if message.content.startswith(...):
content = message.content
definition = find_definition(content)
...
Of course use your actual function instead of find_definition
it's not, is the same as prefix commands, you move the cog to another file and load it *and add the setup function to the file
oh desktop yes, on mobile phones, no
I'll open discord from chrome using desktop site
kinda off topic (and I've got no means on criticizing anyone), but is there any reason why one would do ```py
a = "a"
func(a)
instead of simply doing
```py
func("a")
(assuming that in both cases "a" isn't an arbitrary value)?
You would if a was a function call, or a few nested function calls
can I say something?
If it was anything but just a regular one function call I would probably do that
I know I'm doing something wrong, but it's not clicking what exactly is wrong. tried recreating it the way you were saying to.
definitions = doc.find_all(message.content)
print(definitions[0].parent.parent)
client = discord.Client()
@client.event
async def on_ready():
print('We have logged in as {0.user}'
.format(client))
@client.event
async def on_message(message):
if message.author == client.user:
return
if message.content.startswith('/i '):
content = message.content
definitions = doc.find_all(message.content)
await message.channel.send(definitions)
With a discord bot:
channel = bot.get_channel(...)
await some_function_that_needs_channel(channel)
vs
await some_function_that_needs_channel(bot.get_channel(...))
the.....your slash commands arent showing up because of the id you passed in copy_global_to
But sarth told no need of ids
that's a global sync too
use the commands extension for making commands
then remove that line
.
i know
What's the problem? That code looks good
So what should I do now?
remove the copy_global_to if you still have it
global sync can take upto one hour
yeah, that's kinda my point, is there any reason why you'd do it as shown in example 1? or just to make code easier to read?
global syncs don't take an hour anylonger.
I dont even have global thing
can
never said they always do, can be instant to 10 minutes in most cases
...?
it's returning in the terminal:
File "/Users/d/Desktop/Discord Bot - Queercoded/queercoded.py", line 12, in <module>
definitions = doc.find_all(message.content)
NameError: name 'message' is not defined```
Means i have not put copy_global_to from starting
nicr
Using example one will give you room to check whether or not get_channel returned None, will save you later in cases of AttributeErrors
Ookay. You sure the indents are set up properly?
Actually try this instead definitions = doc.find_all(content)
So now?
blocking function 😔
It's not showing
import discord
from discord.ext import commands
from discord import app_commands
class MySlashCog(commands.Cog):
def __init__(self, bot: commands.Bot) -> None:
self.bot = bot
@app_commands.command(name="ping", description="...")
async def _ping(self, interaction: discord.Interaction):
await interaction.response.send_message("pong!")
async def setup(bot):
await bot.add_cog(MySlashCog(bot))
Code here
show your syncing part
Just testing for it and then ill do Asher's challenge
Which?
how many times are you syncing?
File "/Users/dannychauser/Desktop/Discord Bot - Queercoded/queercoded.py", line 12, in <module>
definitions = doc.find_all(content)
NameError: name 'content' is not defined```
I think the error is that "content' isn't defined, and it's before the discord command.
Still not able to understand
Whats you want me to give?
I think the error is that "content' isn't defined
except for the fact that it is, just the line above. These errors usually have to do with indentation, can you send a screenshot of the code instead of pasting it? I ask because when you paste it indents can be auto-formatted
the part where you are syncing
did you even read the gist? or simply copy the code from there
Not all
Only cogs part
So you didn't read it
I read only using in cogs
well then go read it now, it explains how syncing in discord.py works and why is it important.
Ah found it. The issue is all the way at the top, I thought it was inside the command
See the yellow squiggly?
That is scoping in Python, and other languages
ohh okay. how would I fix that?
Just remove that line. It's already there inside the command
The content variable is not in the outer scope hence you can't use it at line 12
so would I then also remove print(definitions[0].parent.parent)? because now the definitions has the error line underneath
You should also use Bot instead of Client, and use commands instead of on_message to make your commands.
Yes
That too, yes
Line 12 and 13 must be removed
Full disclosure, I was following a tutorial so most of that is just from how the guy was doing it in vid
Let me guess.. Lucas?
Typical bad guides
Lol the code looked familiar
it was actually freeCodeCamp
But its not given for external cogs
Sad that nobody has made a good/decent tutorial on YouTube
Before you get any deeper into that rabbit hole I'd advise you maybe take it down a notch with the tutorials
external commands? wth is an external cog
and why do you expect every tutorial to have a spoonfeeding example...
But hey.. it seems you only did it for the basic bot structure and decided to do your own thing after instead of following the entire tutorial. So that's good
Yeah most YouTube tutorials are bad, not sure if there is any good out there now
async def setup_hook(self) -> None:
await self.add_cog(MySlashCog(self))
await self.tree.copy_global_to(discord.Object(id=123456789098765432))
await self.tree.sync()
You mean this function?
someone should make an app like youtube but for good tutorials 😔
Make a app called pytube
Seems like a fun project. A youtube clone, written from scratch
I'm a big time newbie, I decided to learn Python like a week ago and was following some lessons from YK Dojo, this is my first foray into actually trying to code something. Probably wayyy too ambitious for my own good
Maybe, if you feel up to it though I'm not one to stop you. Nothing wrong with learning from discord.py, though a bit difficult
A discord bot might not be the first thing you should do due to its complexity, but if you're a good learner it can get easy/normal to learn from doing a bot
Usually I learn a language by looking at its basics/read a book and then by doing an ambitious project
We also don't want to discourage learning so.. it's up to you
so this allows me to actually get a response from the bot when I type a message starting with /i, but it just feeds back two brackets
That means you got back an empty list
I understand, I was told a couple times its probably too big a project, but give it a shot anyway
and you still have the copy_global_to method
and doc.find_all(...) didn't find anything
I mean, you wouldn't be the first one to learn Python by doing a bot
So best of luck and amusement in learning 
So you might wanna add an edge case like:
definitions = doc.find_all(...)
if definitions:
# bot found something! ✅
else:
await ctx.send("No definitions found! ❌") # 😭
I asking should i remove that and put the function in my bot class
what...
now the ctx.send has an error line beneath it. Am I mssing something that should be added first? Also, it's giving that for terms I definitely know are in the HTML, so I'm a little confused
Oops, that's my fault. You don't get ctx in an on_message. Use message.channel.send(...) instead
do you even have a context, cause afaik you were using on_message, h,
No they don't, that's entirely on me
😳 a perfect time to introduce them to the ext.commands extension
As for returning the empty list, try some debugging like manually passing in the same thing you gave in discord
Would be, but for now I'd rather have them fix the issue at hand (finding and sending definitions)
patient enough to spell "patient" correctly eh
class botclass(commands.Bot):
def __init__(self):
super().__init__(command_prefix=">",help_command=None,intents=discord.Intents.all())
async def setup_hook(self):
await self.add_cog(cogs.slash(self))
await self.tree.sync()
bot = botclass()
Is it correct for slash commands?
its ok, you still understand wim
patience -> patient
ghost ping
Anyway is it correct?
absolutely not
you have to use the load_extension method and pass in a string
await self.load_extension('cogs.filename_without_extension')
Now?
class botclass(commands.Bot):
def __init__(self):
super().__init__(command_prefix=">",help_command=None,intents=discord.Intents.all())
async def setup_hook(self):
await self.load_extension('cogs.slash')
await self.tree.sync()
bot = botclass()
ps: they are importing the cog file/folder and adding the Cog class using add_cog manually
Anyway my slash command should work
....
why complicate this, just use a fork 🤷
yes.
okay when you say manually passing in what I gave in discord, like this?
if message.content.startswith('/i '):
content = message.content
definitions = doc.find_all('AFAB')
await message.channel.send(definitions)
(that still yields [], if that's what you meant)
all other forks have the same loading methods..
Code jam project is very difficult
oh i thought yall were talking about slashes
you mean the qualifier?
That's what I meant, yes. Now you gotta figure out why doc.find_all('AFAB') is returning an empty list
Yes
i don't think it's that hard
all the answers are literally in the tasks itself
I think owners of python discord are opening a delivery service
you just need to find a way to implement it
Mr. Hem J. Lock even revealed it himself
You weren't supposed to tell anybody!
Yesterday in v c?
I believe anyone with a decent Python knowledge can solve it
Now that the cat's out of the bag, we're opening a pizza delivery service that delivers for free to all members of pydis 🍕
I'll order cheese pizza from them
you forgot to read again, its literally in the README.MD
Me not in project tho
how did you see the question then?
Qualifier for Python Discord Code Jam 9 - Summer 2022 - GitHub - python-discord/code-jam-qualifier-9: Qualifier for Python Discord Code Jam 9 - Summer 2022
I want to say because it's missing this?
print(definitions[0].parent.parent)```
but that was in a line above the actual discord command. Would it have to go in the actual command?
copy the qualifier.py and tests.py file into ur pc, and modify qualifier.py such that it passes the tests in tests.py
#code-jam-2022 would fit better though
That shouldn't do anything, as it's just printing it
well moreso the actual content being printed, not necessarily the function
The actual issue is within your find_all function
ohhh wait is it because it's missing text=
The find_all function?
well, instead of just brackets, its now giving me the word back which is, I think, an improvement?
Well, we're getting somewhere then
Still not showing :(
still at a loss though, it's only showing the text for that, not the full thing which includes the definition.
Not much we can do about that, as it's within your find_all function. If you're willing to try an alternative, go for a word-definition API, it'll be much easier to work with rather than webscraping. If not, you'll have to try to debug and diagnose find_all and figure out what's going on
for a word-definition API, would it be able to use the same website I'm trying to webscrape, or would it be its own like database? sorry if thats a dumb question lol
Does the website you're currently trying to webscrape have words and their definitions?
Mhm
Okay, then a different API shouldn't really be an issue
Should also be very simple:
r = requests.get("url")
definition = r.json()
With minor tweaks of course but that's 90% of the heavy lifting done with the API
Oh, and you can also remove BS4 from your dependencies
this is all I would need to add, with deleting BS4 as well. what would go into the discord commands?
Just that. You'll be doing those 2 lines each time someone runs the discord command
@bot.event
async def on_message(message: discord.Message) -> None:
# tweak if necessary
r = requests.get("url")
definition = r.json()
await ctx.send(f"Definition for {message.content}: {definition}")
Of course you'll want to add an if statement or else it'll do this on every message, which is obviously undesirable. But you understand the core concept
Anyway, I'm off for the night. Nice chatting with y'all. Ping me with any further questions, and I'll check them out tomorrow morning if I can. Take care 👋
@sick birch bro can you please solve this?
Write a user defined function findname(name) where name is an argument in python to delete
phone number from a dictionary phonebook on the basis of the name ,where name is the key.
Not related to Discord bots, and is that some school assignment?
yes
!rule 8
8. Do not help with ongoing exams. When helping with homework, help people learn how to do the assignment without doing it for them.
Nobody will solve and do it for you
that problem is just like using a dictionary method pop 💀
del dict[key]
!d dict.pop exists
pop(key[, default])```
If *key* is in the dictionary, remove it and return its value, else return *default*. If *default* is not given and *key* is not in the dictionary, a [`KeyError`](https://docs.python.org/3/library/exceptions.html#KeyError "KeyError") is raised.
@slate swan slash command still not showing
how sad
you want my condolences or what
You mean support?

indents
Can u show yr code?
Ok

Remove the await
just run without it?
import discord
from discord.ext import commands
from discord import app_commands
class MySlashCog(commands.Cog):
def __init__(self, bot: commands.Bot) -> None:
self.bot = bot
@app_commands.command(name="ping", description="...")
async def _ping(self, interaction: discord.Interaction):
await interaction.response.send_message("pong!")
async def setup(bot):
await bot.add_cog(MySlashCog(bot))
Yes
got it
Did u call bot.tree.sync_commands() or smth in the on_ready?
has your patience expired
.sync()
That ^
I'm just annoyed
icic
class botclass(commands.Bot):
def __init__(self):
super().__init__(command_prefix=">",help_command=None,intents=discord.Intents.all())
async def setup_hook(self):
await self.load_extension('cogs.slash')
await self.tree.sync()
bot = botclass()
Weird
I never used discord.py 2.0, might wanna ask in discord.gg/dpy but u might wanna try refreshing your discord client by pressing
It loaded
But i loaded cogs two times and in console it also printed cogs.slash was already loaded
@shrewd apex
I thought it was called automatically?
bot.setup_hook()
@maiden fable
i am not too sure myself i call mine in on ready with await setup_hook()
It is
Read it
You don’t call it in on_ready
'cogs.slash' is already loaded
I called it
You've already loaded it above, line 27
And now you're loading it again in your for loop, line 40
I removed in line 40
Yes I want
@commands.command()
async def poll(self,ctx,options:int):
if options <= 10:
await ctx.send("Type the name of options accordingly",delete_after=3)
optionlist = []
option = 1
def check(msg):
return msg.author.id == ctx.author.id and msg.channel.id == ctx.channel.id
while option <= options:
option = option+1
await ctx.send("emter the name of option",delete_after=3)
optname = self.bot.wait_for('message',check=check, timeout=20)
await optname.delete
optname = optname.content
optionlist.append(optname)
await ctx.send(optionlist)
Guys await optname.delete is not working
How to fix it?
bro call delete 💀
can i have a 2x2 of embed fields?
!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**...
idk what every function in dpy does
What should I do now?
cry
whats the code and error
It's not deleating message
@commands.command()
async def poll(self,ctx,options:int):
if options <= 10:
await ctx.send("Type the name of options accordingly",delete_after=3)
optionlist = []
option = 1
def check(msg):
return msg.author.id == ctx.author.id and msg.channel.id == ctx.channel.id
while option <= options:
option = option+1
await ctx.send("enter the name of option",delete_after=3)
optname = await self.bot.wait_for('message',check=check, timeout=20)
optname = optname.content
await asyncio.sleep(1)
await optname.delete()
optionlist.append(optname)
await ctx.send(optionlist)
So?
I don't think so. I'm using pillow to generate the images and caching them. After the image bugs out, I can send the same image from cache and it works fine.
Here's the EmbedProxy of a bugged image:
EmbedProxy(width=900, url='https://cdn.discordapp.com/attachments/959683740857151519/991955939743772712/track.png', proxy_url='https://media.discordapp.net/attachments/959683740857151519/991955939743772712/track.png', height=300)
``` the first URL gives me a GCP error and the other one is invalid
in ur on_message check the author or the role, and add reaction
Ok
Hi
👋
Get me a pfp
ew
Funny killerboss github
reminds me of tetris
I don't know what kind of shapes you got with tetris...
its the inverted T isnt it
you indeed do what
what is code jam
It's an event where you have to code something according to the theme
oo
2022's theme is "Websockets"
hey guys how i can create say command?
?
await ctx.send(text) ??
my brain ded
take the text as argument, and send it back
More like an echo command.
!say Hello world
Bot responds with "Hello world"
hi panda
👋
i mean he not u
I'm currently working with slash cooldowns, instead of buckets we got lambda functions... great.
thanks
Traceback (most recent call last):
File "bot.py", line 26, in <module>
bot.run(token)
File "/usr/local/lib/python3.8/dist-packages/discord/client.py", line 872, in run
asyncio.run(runner())
File "/usr/lib/python3.8/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_compl ete
return future.result()
File "/usr/local/lib/python3.8/dist-packages/discord/client.py", line 847, in runner
await self.start(token, reconnect=reconnect)
File "bot.py", line 16, in start
await self.load_extension('cogs.comand.control_panel')
File "/usr/local/lib/python3.8/dist-packages/discord/ext/commands/bot.py", lin e 995, in load_extension
await self._load_from_module_spec(spec, name)
File "/usr/local/lib/python3.8/dist-packages/discord/ext/commands/bot.py", lin e 920, in _load_from_module_spec
raise errors.ExtensionFailed(key, e) from e
discord.ext.commands.errors.ExtensionFailed: Extension 'cogs.comand.control_pane l' raised an error: UnicodeEncodeError: 'latin-1' codec can't encode character ' \u0441' in position 8: ordinal not in range(256)
Dear please tell me what could be wrong?
2022-06-30 08:37:36 WARNING discord.http We are being rate limited. Retrying in 3265.66 seconds. Handled under the bucket "855852976630923274:None:/channels/{channel_id}/messages/{message_id}/crosspost"
Stack (most recent call last):
What is rate limit exactly? Sometimes, some people can't use a command on my bot where some other people can, and that's for no reason at all x.x
there are ratelimits for sending messages...?
you have a bad character used in your cog probably
lmao yeah, gotta use something like key= lambda i: (i.user.id, i.guild_id) right
I might be wrong
if I run it locally, then everything works. therefore, I do not understand what could be the problem of running in hosting
but, it's a global rate limit or a one person rate limit?
probably some character format your hosting service doesnt accept
is it possible to fix it somehow?
that's what i do'nt understand, when there's a rate limit, some people can't use the command but some others can... :o
alrightie, thanks Ashley
I'm so sleepy otherwise I would have read it
I'm scared I'm helpless
It's clear. Nevertheless thank you
bruh
ryuga
u actually need help :p
Yeah I came up with this in the meantime ```py
from typing import Callable, TypeVar
from enum import Enum
from discord.app_commands import Cooldown
from discord.app_commands.checks import _create_cooldown_decorator
T = TypeVar('T')
class Btypes(Enum):
guild = lambda i: (i.guild_id, i.guild_id)
channel = lambda i: (i.guild_id, i.channel_id)
user = lambda i: (i.guild_id, i.user.id)
def koeldown(rate: float | int, per: float | int, btype: Btypes) -> Callable[[T], T]:
return _create_cooldown_decorator(btype, lambda interaction: Cooldown(rate, per))
It doesn't like it tough 
i am thinking of a way. something like making dictionary but its just thought
nice
How so?
Hi
The lambda function is just a little odd to have in a decorator imo
*for me* or idk what I'm seeing righy now
@lambda _:_() ftw
hi
It wants you to do this @cooldown(1, 30, key=lambda i: (i.guild_id, i.guild_id)) for per guild cooldowns.
i am working with low level of the discord.py and i need to make decorator to check if object == class. for dispatch
ops
I know 😔
It would have taken them little to no effort to clean that up by a bit.
3.8 doesn't allow lambda decos?
fr, like commands.cooldown be getting a nice BucketType class
Why wouldn't they?
Python 3.8.10 (default, Mar 15 2022, 12:22:08)
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> @lambda _:_()
File "<stdin>", line 1
@lambda _:_()
^
SyntaxError: invalid syntax
bro why does the date say Mar 15 💀 💀
Ur pc datetime
dw, even I thought that july is gonna end and august is gonna start
how do i handle the copyright of the discord.py code?
nah thats fine, its just wsl ig
Wsl?
lmao same
windows subsystem for linux
Oh 💀
that doesn't make any sense
its 3.8, maybe they didnt allow
idc, i dont use 3.8 anyways, it happened to be the default one on my wsl
By pc don't support above python 3.8.10 🥲
😔
my windows date say its 2:09am
GG 😢
Nice sleep
oh, i thought you meant the syntax, ya dont worry about it
can someone help me? i am trying to use copyrighted code discord.py
okay
what do you want to do with it?
create an if stm
from typing import Any
class hibot(Clients):
igonre = False
def dispatch(self, event_name: str, /, *args: Any, **kwargs: Any) -> None:
# super() will resolve to Client
super().dispatch(event_name, *args, **kwargs) # type: ignore
ev = 'on_' + event_name
for event in self.extra_events.get(ev, []):
if isinstance(object,__class__):
self._schedule_event(__class__.event, ev, *args, **kwargs) # type: ignore
else:
self._schedule_event(event, ev, *args, **kwargs) # type: ignore
i am going to use non-func object so i need to check the objects in extra_events (the place where events are saved)
Guys how we can keep value in a field of embed empty?
Just input this:
?
you can edit the code on your end, you dont have to get any sort of clearance for that
lol
Yeah or:
You mean to keep it empty?
You are not allowed to use that command here. Please use the #bot-commands channel instead.
😔
oh
lol sad
uh
just do _ _
** **
_ _
exploit markdown 💀
** **
\
Just add \
Ye
embes = discord.Embed(title=question,color=discord.Color.blue())
embes.add_field(name=list[0],value= , inline=False)
embes.add_field(name=list[1],value= , inline=False)
embes.add_field(name=list[2],value= , inline=False)
embes.add_field(name=list[3],value= , inline=False)
embes.add_field(name=list[4],value= , inline=False)
embes.add_field(name=list[5],value= , inline=False)
embes.add_field(name=list[6],value= , inline=False)
embes.add_field(name=list[7],value= , inline=False)
embes.add_field(name=list[8],value= , inline=False)
embes.add_field(name=list[9],value= , inline=False)
Is it fine?
O shi*
use a for loop
Ye
||w||
for x in list:
e.add_field(name=x,value="** **")
value= will just throw a syntax error
Yes
(╯°□°)╯︵ ┻━┻
┬─┬ ノ( ゜-゜ノ)
embes = discord.Embed(title=question,color=discord.Color.blue())
for i in range(10):
embes.add_field(name=list[i],value="** **", inline=False)
Why
lol
This better
fields must have a value tough.
uwu
No worries add ** **
fine..... yesn't
But I did ;-;
Not working
Anyway i did value="** **"
Ur code uses range
Me testing it now
is there no add_fields? 
It's there
There is?
embed.add_field
And?
!d discord.Embed.add_field
add_field(*, name, value, inline=True)```
Adds a field to the embed object.
This function returns the class instance to allow for fluent-style chaining. Can only be up to 25 fields.
!d discord.Embed.add_field
add_field(*, name, value, inline=True)```
Adds a field to the embed object.
This function returns the class instance to allow for fluent-style chaining. Can only be up to 25 fields.
ryuga
bro he said fields not field
Lame jokes
I did say fields
huh 
Troll 😔
same joke 💀
7. Keep discussions relevant to the channel topic. Each channel's description tells you the topic.
this channel is for helping with discord bots not import issues
rip
pycord has nothing to do with discord bots
it's for ffmpeg
hello
I wish i was home i also want that role 😔
lmao i thought it was the fork
!pip py-cord
ya got it
pycord with an uwu hyphen
i have little problem i don't know how _schedule_event works...
Ok
Why do you need that if I may ask?
I don't recommend using a protected object unless you have a valid reason.
thats called py-cord
pycord and py-cord are different
Could you send an error code or anything at all?
i need it for handling event cuz i want to give it to another class
pycord is an FFmpeg wrapper and py-cord is a discord API wrapper
¯_(ツ)_/¯
nvm what am I saying anymore
Another class? What do you mean exactly?
tried restarting the IDE?
run your code, dont depend on pylance for your errors
oof
Looks like pycharm did you install it trough the package manager or CMD?
that's vsc panda
pip install py-cord
^
aka the library that sucks
noooooooooooo
lmao +1

with the -? if yes then restart vsc and it works
ash calling us boomers and making a big deal out of a - lol
DUDE RUN UR CODE, VSC DOESNT KNOW THAT YOU INSTALLED IT OR NOT, PYTHON DOES 😔 😔
Windows version of py 😨
ryuga, I feel you
sad
