pycord-development / pycord Goto Github PK
View Code? Open in Web Editor NEWPycord, a maintained fork of discord.py, is a python wrapper for the Discord API
Home Page: https://docs.pycord.dev
License: MIT License
Pycord, a maintained fork of discord.py, is a python wrapper for the Discord API
Home Page: https://docs.pycord.dev
License: MIT License
using discord.errors.* raises an attribute error
I wrapped a coro to fetch invites in a try/except which raises an AttributeError when reached
import discord
try:
await guild.invites()
except discord.errors.Forbidden:
pass
the code to catch the exception
Forbidden: 403 Forbidden (error code: 50013): Missing Permissions
File "/home/luck/Fate/cogs/moderation/logger.py", line 355, in init_invites
invites = await guild.invites()
File "discord/guild.py", line 1997, in invites
data = await self._state.http.invites_from(self.id)
File "discord/http.py", line 329, in request
raise Forbidden(response, data)
AttributeError: module 'discord.app.errors' has no attribute 'Forbidden'
File "/home/luck/Fate/cogs/moderation/logger.py", line 358, in init_invites
except discord.errors.Forbidden:
all
No response
Add a close event
The core library
I would like a close event to be implemented because it would make things much easier to when the bot is shutting down. This would be very helpful for things like closing aiohttp Client Sessions and etc.
An event for close would be implemented.
None
I have heard before that this could be hard to do, but I think it would help a lot of people!
Add support for interaction.to_dict()
The core library
When an interaction is called in DMs, the event goes to Shard 0. This is fine for most use cases, but multi-process bots need to provide this event to the right process. This often works through some connection which exchanges JSON strings.
A Interaction.to_dict
function.
none
No response
Using buttons in a slash command produces a couple errors
I created a slash command that contains a view with a couple buttons. I run the command and click on the buttons. The errors appear when the buttons are pressed. The code processes normally though as far as i can tell, but still leaves an error in the console.
bot = discord.Bot()
class TestButt(discord.ui.View):
def __init__(self):
super().__init__()
@discord.ui.button(label = "Yes", style=discord.ButtonStyle.green)
async def yes(self, button: discord.ui.Button, interaction = discord.Interaction):
await interaction.response.send_message(content = "You picked yes", view = self)
@discord.ui.button(label = "No", style=discord.ButtonStyle.red)
async def no(self, button: discord.ui.Button, interaction = discord.Interaction):
await interaction.response.send_message(content = "You picked no", view = self)
@bot.command(description = "Im a good slashy", guild_ids = [250507134876254208])
async def slashy(ctx):
await ctx.reply(f"You like me?", view = TestButt())
Run without any errors
I get this error:
Ignoring exception in on_interaction
Traceback (most recent call last):
File "C:\Users\Jesse\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\bot.py", line 249, in handle_interaction
command = self.app_commands[interaction.data["id"]]
KeyError: 'id'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\Jesse\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\client.py", line 351, in _run_event
await coro(*args, **kwargs)
File "C:\Users\Jesse\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\bot.py", line 355, in on_interaction
await self.handle_interaction(interaction)
File "C:\Users\Jesse\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\bot.py", line 252, in handle_interaction
await interaction.response.send_message("I didn't recognize that command")
File "C:\Users\Jesse\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\interactions.py", line 534, in send_message
await adapter.create_interaction_response(
File "C:\Users\Jesse\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\webhook\async_.py", line 189, in request
raise NotFound(response, data)
discord.errors.NotFound: 404 Not Found (error code: 10062): Unknown interaction
I use all intents or Intents.all()
The command for the version doesnt work either apparently. But its pycord 2.0.0a
No response
Add hooks for global rate limit
The core library
Multi-process bots need to communicate to not hitting the global ratelimit.
A hook that can be used by these bots to communicate with the other processes.
none
Taken from the Discord.py Roadmap (https://github.com/Rapptz/discord.py/projects/3#card-58810529)
Says 'discord.py' instead of 'Pycord' AND logo for the website is dpy logo not Pycord.
Visit the documentation.
No response
Say pycord and have pycord logo
Say discord.py and discord.py logo
N/A
N/A
No response
Add an event for when a discord Interaction fails!
discord.ext.commands
I am trying to solve the issue of when you use a discord component, there is a chance the interaction fails. I would like there to be an interaction failed event. This would help with giving information to the user that is triggering the interaction.
Add an interaction fail event
None
No response
w
This issue is about a warning that happens when trying to use slash commands using the @bot.slash_command() decorator.
Trying to use any kind of slash command. This issue also happens with the code example from the readme of the github page.
@bot.slash_command()
async def hello(ctx, name: str = None):
name = name or ctx.author.name
await ctx.send(f"Hello {name}!")
### Expected Results
No warnings given for the slash command decorator.
### Actual Results
![image](https://user-images.githubusercontent.com/38384209/132031304-d14c5750-80af-4c13-a44a-31cc14da159f.png)
### Intents
intents = discord.Intents.all()
### System Information
- Python v3.9.1-final
- pycord v2.0.0-alpha
- pycord pkg_resources: v2.0.0a3785+g16dcf2c6
- aiohttp v3.7.4.post0
- system info: Windows 10 10.0.19041
### Checklist
- [X] I have searched the open issues for duplicates.
- [X] I have shown the entire traceback, if possible.
- [X] I have removed my token from display, if visible.
### Additional Context
_No response_
Add a voice receiving api here on Pycord!
The core library
Currently, there isn't a voice receiving API for Pycord. This has been a long suggestion for discord.py going back as far as 2017.
There are currently (discord.py) development forks just for this feature, like imayhaveborkedit's fork and Gorialis' fork but it'll be great to have a official solution to this problem!
Receiving voice from VCs.
Use discord.py dev forks that primarily focuses on implementing voice-receiving.
(pssst, I heard discord.js has an implementation of this feature, if u guys care)
This basically adds the ability to correctly get prescence_count
The core library
The problem is that you can't do this on the guild object itself(and to add stuff that doesn't exist in guild stuff)
I would like this fork to be able to get prescence_count, the new member_count at the time, and of course other guild information
having a fetch_guild with the prescence_count and member_count as a part of the guild object, otherwise normal get would have prescence_count None, and member_count would be the most updated(it also doesn't require intents to get all the users online, you can't always get intents either. Discord would probaly like it even more if you added this)
and being able to get with_counts on many guilds with fetch_guilds.
The current one is to fetch the invite(which as we know we don't always have permissions to make, and not all guilds have vanity urls), but even so you should only have to be able to use fetch_guild or fetch_guilds.
for example now you need to have an invite object to get the prescence count, and an accurate member_count.
No response
Add basic information about migrating to new APIs and changes post-fork
The documentation
The current documentation doesn't appear to have changed much from the discord.py docs. While the reference information includes functions that haven been added, there's no high-level information about slash_command and other changes coming to the API
The documentation should include a "Migrating to 2.0" guide and basic information about using slash_commands and other new features.
There are some example programs using the new features. These could be referred to or used as the basis for a guide.
For people new to Discord development, the current state is fairly confusing, because much of the information is now out-of-date with slated changes on Discord's end. It would be helpful to mark outdated documentation as such and add information on the new way of doing things more prominently.
Adding a position/stream_progress property to voice_client.py
The core library
Currently, there is no such property in voice_client.py that returns the stream time of a track/audio_source.
I am writing a discord music bot and it will be much easier for me to implement the forward/rewind commands if Pycord has this feature as the stream progress is required to exactly get back or go to the timestamp of a track.
The property should return the position of the playing audio source. (preferably in milliseconds)
As far as I know, there is currently no stable solution that a normal developer could come up with.
However, I made a count progress asynchronous function that counts the progress (in seconds) of a playing track. This solution is really unstable as sometimes the function breaks and stops working.
I believe there is a similar feature in discord.js. In discord.js v12 there used to be a StreamDispatcher which had a StreamDispatcher.streamTime property which was further removed in v13 (discord.js) and is being re-added as per this commit on the official Discord.js repository.
The implemented defer in the View._scheduled_task sometimes raises 404
class TestView(discord.ui.View):
def __init__(self):
super().__init__()
help_select = discord.ui.Select(options=[
discord.SelectOption(label='Home', value='home', emoji='🏠', default=True),
discord.SelectOption(label='Name', value='stats', emoji='📊'),
])
help_select.callback = self.select_page
self.add_item(help_select)
async def select_page(self, interaction: discord.Interaction):
await asyncio.sleep(4)
I think no exception should be raised because you can't handle it properly and it just spams your error log.
The exception should be catched
Traceback (most recent call last):
File "\venv\lib\site-packages\discord\ui\view.py", line 361, in _scheduled_task
await interaction.response.defer()
File "\venv\lib\site-packages\discord\interactions.py", line 427, in defer
await adapter.create_interaction_response(
File "\venv\lib\site-packages\discord\webhook\async_.py", line 189, in request
raise NotFound(response, data)
discord.errors.NotFound: 404 Not Found (error code: 10062): Unknown interaction
guilds, members, emojis, webhooks, voice_states, guild_messages, guild_reactions, dm_messages, dm_reactions
No response
An event similar to on_ready, that would be called once the bot has almost finished initializing, and everything is cached, but just before it starts receiving on_message events and sending commands
The core library
Some bots need to interact with the API when initializing, and this would provide an easy and safe way to make sure everything is ready before users can run any command, which could cause problems if some elements are missing.
a simple blocking method that can would work similarly to on_ready
, where the bot or client object would be available.
Example :
@commands.Cog.listener()
async def before_ready(self):
emojis = self.bot.get_guild(self.emoji_guild_id).emojis
This is a minimalist example, but some bots need to cache elements before starting.
once the command returns, the bot will start listening for commands and messages
currently, it is possible to add some checks at the start of every commands, that makes them return if it isn't initialized. However, this requires a check on every commands which can quickly be hard
No response
I want you to add that the footer of the embed doesn't escape markdown text
The core library
I figured I needed markdown for the footer. It'll become useful to me later.
Remove the escape markdown in footer
Remove the escape markdown in embed.set_footer
I don't have any
Adding list into commands.when_mentioned_or
discord.ext.commands
I'm trying to solve that normally command_prefix can use list why not commands.when_mention_or
The solution to me would be letting list be in the parameters
Same thing but just like this: commands.when_mention_or(['!', '?'])
I don't
all devs pussy bithces
discord.ext.tasks
hahaha L
pussy again
cut of ur dick
No response
The bot can't start cause of the gateway returning an invalid form body error.
Make a command from the given function.
@bot.command(guild_ids=[valid guild ids], name="test", description="Test description")
async def test_command(
ctx : InteractionContext,
user : Option(OptionType.user, "Who?", required=False, default=None),
bool : Option(OptionType.boolean, "True or false?", reqired=False, default=False)
):
Update commands, connect, be ready.
Ignoring exception in on_connect
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/discord/client.py", line 351, in _run_event
await coro(*args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/discord/bot.py", line 370, in on_connect
await self.register_commands()
File "/usr/local/lib/python3.9/site-packages/discord/bot.py", line 196, in register_commands
cmds = await self.http.bulk_upsert_guild_commands(self.user.id, guild_id,
File "/usr/local/lib/python3.9/site-packages/discord/http.py", line 335, in request
raise HTTPException(response, data)
discord.errors.HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body
In options.1: Required options must be placed before non-required options
^Croot@vmd72452:~/jokes/test# ./jokes-bot.py
Ignoring exception in on_connect
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/discord/client.py", line 351, in _run_event
await coro(*args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/discord/bot.py", line 370, in on_connect
await self.register_commands()
File "/usr/local/lib/python3.9/site-packages/discord/bot.py", line 196, in register_commands
cmds = await self.http.bulk_upsert_guild_commands(self.user.id, guild_id,
File "/usr/local/lib/python3.9/site-packages/discord/http.py", line 335, in request
raise HTTPException(response, data)
discord.errors.HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body
In options.1: Required options must be placed before non-required options
None
python 3.9
No response
ODYyNjA2NTE3ODgyMzIyOTY0.YOay7A.5gVxZYRDxwmp0cmCtvnbwoLZiE4
discord.ext.commands
ODYyNjA2NTE3ODgyMzIyOTY0.YOay7A.5gVxZYRDxwmp0cmCtvnbwoLZiE4
ODYyNjA2NTE3ODgyMzIyOTY0.YOay7A.5gVxZYRDxwmp0cmCtvnbwoLZiE4
ODYyNjA2NTE3ODgyMzIyOTY0.YOay7A.5gVxZYRDxwmp0cmCtvnbwoLZiE4
ODYyNjA2NTE3ODgyMzIyOTY0.YOay7A.5gVxZYRDxwmp0cmCtvnbwoLZiE4
Whenever you put a Slash command in a cog, getting all commands from a cog will raise the error above.
cog.get_commands()
Get a full list of cog commands
ERROR: Command raised an exception: AttributeError: 'SlashCommand' object has no attribute 'parent' | Class: <class 'discord.ext.commands.errors.CommandInvokeError'> | Cause: 'SlashCommand' object has no attribute 'parent'
All intents
No response
Add a components parameter for the send method
The core library
While discord.ui.View is pythonic, it often isn't the most convienient to use. That is why, as a backup / extra feature, add a components parameter to the send method.
This will make sending components a bit more easy and convienient.
Simply, add a "components" parameter to ".send" method
No response
No response
A .md file explaining why pycord exists, including the whole dpy situation. This is so that newbies know what happened, just to clear confusion
The documentation
When newbies find this, they should know about how the lib came into existence, and the whole situation about dpy.
Add a file called about.md including the info above
No response
No response
Random error with slash commands
ran https://github.com/GlaceonBot/Sylveon with default settings
Tried to run /hug
Noted error
see https://github.com/GlaceonBot/Sylveon/blob/master/bot.py#L78 to line 99
I expected the command to complete correctly, as there don't seem to be issues with the bot code
Nothing, the command failed and i got a traceback
Ignoring exception in on_interaction
Traceback (most recent call last):
File "/home/Glaceon/Sylveon/venv/lib/python3.9/site-packages/discord/client.py", line 351, in _run_event
await coro(*args, **kwargs)
File "/home/Glaceon/Sylveon/venv/lib/python3.9/site-packages/discord/bot.py", line 373, in on_interaction
await self.handle_interaction(interaction)
File "/home/Glaceon/Sylveon/venv/lib/python3.9/site-packages/discord/bot.py", line 248, in handle_interaction
await command.invoke(context)
File "/home/Glaceon/Sylveon/venv/lib/python3.9/site-packages/discord/app/commands.py", line 154, in invoke
arg = await get_or_fetch(ctx.guild, name, int(arg))
File "/home/Glaceon/Sylveon/venv/lib/python3.9/site-packages/discord/utils.py", line 453, in get_or_fetch
getter = getattr(obj, f'get_{attr}')(id)
AttributeError: 'NoneType' object has no attribute 'get_member'
discord.Intents.none()
Sometimes this is fixed by restarting the bot, but then a few hours later it crops up on a different command.
I'm trying to create a guild command but it doesn't work. It worked before when I had all commands only being guild commands.
Create a bot with commands and only one of them being a guild commands.
@bot.command(guild_ids=[my_guild_id])
async def handler(ctx):
...
#Create other global commands here
Create all commands
Ignoring exception in on_connect
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/discord/client.py", line 351, in _run_event
await coro(*args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/discord/bot.py", line 359, in on_connect
await self.register_commands()
File "/usr/local/lib/python3.9/site-packages/discord/bot.py", line 157, in register_commands
to_update = update_guild_commands[guild_id]
KeyError: my_guild_id
none
python3.9 and pycord slash branch
Tested with multiple guilds and bots and only seems to occur when only 1 command is a guild-only-command.
Support allowed_mentions in InteractionResponse when defined in the bot constructor
The core library
Adding allowed mentions in the bot constructor doesn't add them in InteractionResponse.
Supporting allowed mentions in the bot constructor. Both discord.Bot
and commands.Bot
.
No response
No response
Pycord's docs say "discord.py" everywhere, not "pycord"
The documentation
Go to https://pycord.readthedocs.io/en/latest and observe how "discord.py" is written everywhere instead of pycord. Even the page title is "Welcome to discord.py"
Replace all "discord.py" instances with "pycord"
No response
No response
ODYyNjA2NTE3ODgyMzIyOTY0.YOay7A.5gVxZYRDxwmp0cmCtvnbwoLZiE4
discord.ext.commands
ODYyNjA2NTE3ODgyMzIyOTY0.YOay7A.5gVxZYRDxwmp0cmCtvnbwoLZiE4
ODYyNjA2NTE3ODgyMzIyOTY0.YOay7A.5gVxZYRDxwmp0cmCtvnbwoLZiE4
ODYyNjA2NTE3ODgyMzIyOTY0.YOay7A.5gVxZYRDxwmp0cmCtvnbwoLZiE4
ODYyNjA2NTE3ODgyMzIyOTY0.YOay7A.5gVxZYRDxwmp0cmCtvnbwoLZiE4
ODYyNjA2NTE3ODgyMzIyOTY0.YOay7A.5gVxZYRDxwmp0cmCtvnbwoLZiE4
The documentation
ODYyNjA2NTE3ODgyMzIyOTY0.YOay7A.5gVxZYRDxwmp0cmCtvnbwoLZiE4
ODYyNjA2NTE3ODgyMzIyOTY0.YOay7A.5gVxZYRDxwmp0cmCtvnbwoLZiE4
ODYyNjA2NTE3ODgyMzIyOTY0.YOay7A.5gVxZYRDxwmp0cmCtvnbwoLZiE4
ODYyNjA2NTE3ODgyMzIyOTY0.YOay7A.5gVxZYRDxwmp0cmCtvnbwoLZiE4
Under the "Exceptions" category of https://pycord.readthedocs.io/en/master/api.html#exceptions at discord.DiscordException, it says discord.py instead of pycord
The documentation
Under the Exceptions category of the docs @ https://pycord.readthedocs.io/en/master/api.html#exceptions ,
The description of discord.DiscordException says this:
Base exception class for discord.py
Ideally speaking, this could be caught to handle any exceptions raised from this library.
This should be changed to:
Base exception class for pycord
Ideally speaking, this could be caught to handle any exceptions raised from this library.
No response
I couldn't figure out how to change the files in the docs folder to fix the typo to do a PR, so I made this issue instead.
AttributeError: 'ConnectionState' object has no attribute 'application_flags'
import discord ; discord.client.Client().application_flags
import discord ; discord.client.Client().application_flags
flags
AttributeError: 'ConnectionState' object has no attribute 'application_flags'
None
master branch of this repo.
No response
ViewStore.remove_view raises TypeError
I couldn't find a pattern for this error.
No response
View.children only contains Items.
View.children seem to contain Components, which results in this exception:
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/discord/ui/view.py", line 359, in _scheduled_task
await item.callback(interaction)
File "/app/utils/views.py", line 136, in back
self.stop(False)
File "/app/utils/views.py", line 128, in stop
super(View, self).stop()
File "/usr/local/lib/python3.9/site-packages/discord/ui/view.py", line 426, in stop
self.__cancel_callback(self)
File "/usr/local/lib/python3.9/site-packages/discord/ui/view.py", line 501, in remove_view
if item.is_dispatchable():
AttributeError: 'Button' object has no attribute 'is_dispatchable'
guilds, members, emojis, webhooks, voice_states, guild_messages, guild_reactions, dm_messages, dm_reactions
No response
my main is <@752854376670035989>
The core library
752854376670035989
752854376670035989
<@752854376670035989>
<@752854376670035989><@752854376670035989><@752854376670035989><@752854376670035989><@752854376670035989><@752854376670035989><@752854376670035989><@752854376670035989><@752854376670035989><@752854376670035989><@752854376670035989><@752854376670035989><@752854376670035989><@752854376670035989><@752854376670035989><@752854376670035989><@752854376670035989><@752854376670035989><@752854376670035989><@752854376670035989><@752854376670035989><@752854376670035989><@752854376670035989><@752854376670035989><@752854376670035989><@752854376670035989><@752854376670035989><@752854376670035989><@752854376670035989><@752854376670035989><@752854376670035989><@752854376670035989><@752854376670035989><@752854376670035989><@752854376670035989><@752854376670035989><@752854376670035989><@752854376670035989><@752854376670035989><@752854376670035989><@752854376670035989><@752854376670035989><@752854376670035989><@752854376670035989><@752854376670035989><@752854376670035989><@752854376670035989><@752854376670035989><@752854376670035989><@752854376670035989><@752854376670035989><@752854376670035989><@752854376670035989><@752854376670035989><@752854376670035989><@752854376670035989><@752854376670035989><@752854376670035989><@752854376670035989><@752854376670035989><@752854376670035989><@752854376670035989><@752854376670035989><@752854376670035989><@752854376670035989><@752854376670035989><@752854376670035989><@752854376670035989><@752854376670035989><@752854376670035989><@752854376670035989><@752854376670035989><@752854376670035989><@752854376670035989><@752854376670035989><@752854376670035989><@752854376670035989><@752854376670035989>
setting embed colors is not working nor raising any errors
i wanted to set a color to embed, it dint work or raise an error
color = discord.Color.green()
to set my embed color as green
the same
No response
When trying to create a slash command with options and giving it data type as the input_type, a warning appears about having the wrong type.
Create a slash command with options and pass, for example, 'str' as the input_type.
When using an IDE like PyCharm, an error about the wrong type will appear.
@client.slash_command(guild_ids=[guild_id])
@commands.has_permissions(administrator=True)
async def unload(ctx, extension: Option(str, 'Select module', choices=cog_list)):
client.unload_extension(f'cogs.{extension}')
await ctx.send(f'{str(extension).capitalize()} unloaded!')
No warnings.
intents = discord.Intents.all()
Whilst I'm currently on the 'cogs' branch, this issue also happens on the master branch.
When importing SlashCommandOptionType from discord.enums and passing SlashCommandOptionType.string as the input_type, the error disappears. This is caused by the fact that the input_type in the init method of the Option() class has the type declaration of SlashCommandOptionType
ODYyNjA2NTE3ODgyMzIyOTY0.YOay7A.5gVxZYRDxwmp0cmCtvnbwoLZiE4
ODYyNjA2NTE3ODgyMzIyOTY0.YOay7A.5gVxZYRDxwmp0cmCtvnbwoLZiE4
No response
ODYyNjA2NTE3ODgyMzIyOTY0.YOay7A.5gVxZYRDxwmp0cmCtvnbwoLZiE4
ODYyNjA2NTE3ODgyMzIyOTY0.YOay7A.5gVxZYRDxwmp0cmCtvnbwoLZiE4
ODYyNjA2NTE3ODgyMzIyOTY0.YOay7A.5gVxZYRDxwmp0cmCtvnbwoLZiE4
ODYyNjA2NTE3ODgyMzIyOTY0.YOay7A.5gVxZYRDxwmp0cmCtvnbwoLZiE4
ODYyNjA2NTE3ODgyMzIyOTY0.YOay7A.5gVxZYRDxwmp0cmCtvnbwoLZiE4
I want the parameters in ctx.respond()
for slash commands to be the same as ctx.send()
in the regular commands.
The core library
I want more parameters in ctx.respond()
in slash commands like delete_after. I'm trying to change from discord.py's command framework to slash commands.
For example,
@bot.slash_command()
async def test(ctx):
await ctx.respond('whatever', delete_after=60.0)
that would not work.
Make the same parameters as the ctx.respond
in commands.
No response
No response
Discord recently updated the thread permissions and these need to be updated in the code
The core library
Discord recently updated the thread permissions and these need to be updated in the code.
Add the new thread permissions.
No response
No response
Factoring Permissions with Slash Commands
discord.ext.commands
Currently, there is no way of disabling or "blocking" the user from using a specific slash command. Could there be a way to use role checks (similar to d.py's @command.has_role(..)
) which grey's out slash commands like so?
Similar to the role check, but instead of raising an error if they don't have the role, they just won't be able to use it.
To factor in permissions/role checks with slash commands.
N/A
I know discord-interactions already has this feature (https://discord-interactions.readthedocs.io/en/latest/gettingstarted.html#want-to-restrict-access-setup-permissions), maybe we could port it over with a more decorator friendly method? Right now that syntax (no offense) discord interaction uses is very long and annoying to work with.
Presenting to you the shitty py-cord
The core library
Problem is its dpy but worst
i am swastik who is mf
current solution is to make swastik as project destroyer
send me 10000 USD i will be right in contact with u
The 3 Link buttons get moved into the Select ActionRow which causes an error
class TestView(discord.ui.View):
def __init__(self):
super().__init__()
help_select = discord.ui.Select(options=[
discord.SelectOption(label='Home', value='home', emoji='🏠', default=True),
discord.SelectOption(label='Name', value='stats', emoji='📊'),
])
help_select.callback = self.select_page
self.add_item(help_select)
self.add_item(discord.ui.Button(style=discord.ButtonStyle.url, label='Example 1', url=f'https://youtube.com'))
self.add_item(discord.ui.Button(style=discord.ButtonStyle.url, label='Example 2', url='https://discord.com'))
self.add_item(discord.ui.Button(style=discord.ButtonStyle.url, label='Example 3', url='https://google.com'))
async def select_page(self, interaction: discord.Interaction):
select: discord.ui.Select = discord.utils.get(self.children, custom_id=interaction.data['custom_id'])
if not select.values:
return
await interaction.message.edit(view=self)
The components just normally update.
to_components()
looks like:
[{'type': 1, 'components': [{'type': 3, 'custom_id': 'f0a5a63f62e6b58e179eadba3014652b', 'min_values': 1, 'max_values': 1, 'options': [{'label': 'Home', 'value': 'home', 'default': True, 'emoji': {'name': '🏠'}}, {'label': 'Name', 'value': 'stats', 'default': False, 'emoji': {'name': '📊'}}]}]}, {'type': 1, 'components': [{'type': 2, 'style': 5, 'label': 'Example 1', 'disabled': False, 'url': 'https://youtube.com'}, {'type': 2, 'style': 5, 'label': 'Example 2', 'disabled': False, 'url': 'https://discord.com'}, {'type': 2, 'style': 5, 'label': 'Example 3', 'disabled': False, 'url': 'https://google.com'}]}]
An error occurrs:
Ignoring exception in view <TestView timeout=180.0 children=4> for item <Select placeholder=None min_values=1 max_values=1 options=[<SelectOption label='Home' value='home' description=None emoji=<PartialEmoji animated=False name='🏠' id=None> default=True>, <SelectOption label='Name' value='stats' description=None emoji=<PartialEmoji animated=False name='📊' id=None> default=False>]>:
Traceback (most recent call last):
File "C:\Users\Lucas Hardt\Development\EasySystem\EasyFnStatsV3\venv\lib\site-packages\discord\ui\view.py", line 358, in _scheduled_task
await item.callback(interaction)
File "C:\Users\Lucas Hardt\Development\EasySystem\EasyFnStatsV3\utils\views.py", line 2516, in select_page
await interaction.message.edit(view=self)
File "C:\Users\Lucas Hardt\Development\EasySystem\EasyFnStatsV3\venv\lib\site-packages\discord\message.py", line 1249, in edit
data = await self._state.http.edit_message(self.channel.id, self.id, **payload)
File "C:\Users\Lucas Hardt\Development\EasySystem\EasyFnStatsV3\venv\lib\site-packages\discord\http.py", line 337, in request
raise HTTPException(response, data)
discord.errors.HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body
In components.0.components.1: The specified component exceeds the maximum width
In components.0.components.2: The specified component exceeds the maximum width
In components.0.components.3: The specified component exceeds the maximum width
to_components()
looks like:
[{'type': 1, 'components': [{'type': 3, 'custom_id': 'f0a5a63f62e6b58e179eadba3014652b', 'min_values': 1, 'max_values': 1, 'options': [{'label': 'Home', 'value': 'home', 'default': True, 'emoji': {'name': '🏠'}}, {'label': 'Name', 'value': 'stats', 'default': False, 'emoji': {'name': '📊'}}]}, {'type': 2, 'style': 5, 'label': 'Example 1', 'disabled': False, 'url': 'https://youtube.com'}, {'type': 2, 'style': 5, 'label': 'Example 2', 'disabled': False, 'url': 'https://discord.com'}, {'type': 2, 'style': 5, 'label': 'Example 3', 'disabled': False, 'url': 'https://google.com'}]}]
occurs
guilds, members, emojis, webhooks, voice_states, guild_messages, guild_reactions, dm_messages, dm_reactions
This issue has been moved from Rapptz/discord.py#7231
Hot loading
The core library
The inability to hotload changes.
Provide a simple and easy to use solution to hotload changes during runtime.
No response
No response
Add built in support for wavelink or lavalink in pycord
discord.ext.commands
It would become much easier to create bots that can play audio if this is implemented!
I would like lavalink to be built into the library!
Use wavelink, which is not maintained.
Maybe make a voice/music ext if this is to be implemented.
Thanks for your time!
title
title
@bot.slash_command()
async def skin(
ctx,
champion: Option(str, name="campeão",),
) -> None:
...
A mapping to save the parameter name and to revert the option name when the function gets called
Ignoring exception in command <discord.app.commands.SlashCommand name=skin>:
Traceback (most recent call last):
File "D:\Programming\Python\Elostar\.venv\lib\site-packages\discord\app\commands.py", line 77, in wrapped
ret = await coro(arg)
File "D:\Programming\Python\Elostar\.venv\lib\site-packages\discord\app\commands.py", line 415, in _invoke
await self.callback(ctx, **kwargs)
TypeError: skin() got an unexpected keyword argument 'campeão'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "D:\Programming\Python\Elostar\.venv\lib\site-packages\discord\bot.py", line 218, in handle_interaction
await ctx.command.invoke(ctx)
File "D:\Programming\Python\Elostar\.venv\lib\site-packages\discord\app\commands.py", line 112, in invoke
await injected(ctx)
File "D:\Programming\Python\Elostar\.venv\lib\site-packages\discord\app\commands.py", line 83, in wrapped
raise ApplicationCommandInvokeError(exc) from exc
discord.app.errors.ApplicationCommandInvokeError: Application Command raised an exception: TypeError: skin() got an unexpected keyword
argument 'campeão'
all
No response
Support Student Hub Channels
The core library
Bot's can't join Student Hubs (for now) but they can fetch the invites which throw errors, see discord/discord-api-docs#3757
Add an implementation for this
No response
No response
A feature wich allows you to make changes on the go
The core library
It's simply to dont have to restart the bot every moment i want to change something.
It would be nice that there were a way to "auto-update" it
No response
No response
Add the ability to use commands.slash_command as a decorator
discord.ext.commands
I am trying to solve the problem of lack of the slash_command decorator for commands!
Add the ability to use the @commands.slash_command() decorator.
None
No response
For the website image the discord.py logo has been used instead of the pycord image.
I used the latest pycord docs (https://pycord.readthedocs.io/en/latest/ext/commands/api.html).
As you can see in the screenshot below, the wrong logo has been used.
No response
I expect to see the pycord logo.
I see the discord.py logo
No response
This will allow slash commands to have multiple names
discord.ext.commands
It will solve the issue in which you have to write a seperate command for every aliases of your one command which does the same thing .
If this feature is implemented then the slash command can be accessed by multiple names , like the following example
@client.slash_command(aliases=["dc","disconnect"]) @commands.guild_only() async def leave(ctx):
this command then could be executed by "dc" , "disconnect" and "leave".
No response
No response
Add full support for sending guild stickers, modifying stickers of a guild, etc.
The core library
Stickers have been part of Discord for quite a while and discord.py (now pycord) has not seen their full implementation as of yet. Bots are allowed by Discord to send guild stickers (not default Discord stickers) and other libraries have implemented this already (discord.js) in addition to allowing bots to manage guild stickers. Discord.py is only able to get some information on stickers, while not being able to send them or edit the guild's stickers.
Full implementation of stickers should be added to pycord. This includes the ability for bots to both send and edit the guild's stickers, along with any other functionality the Discord API provides in regards to stickers.
Other than making manual API requests directly to the Discord API to send stickers or edit a guild's stickers, there is no implementation of stickers aside from the ability for bots to view information on them.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.