Giter Site home page Giter Site logo

pycord-development / pycord Goto Github PK

View Code? Open in Web Editor NEW
2.6K 30.0 458.0 16.29 MB

Pycord, a maintained fork of discord.py, is a python wrapper for the Discord API

Home Page: https://docs.pycord.dev

License: MIT License

Python 100.00%
discord discord-py python pycord py-cord hacktoberfest

pycord's People

Contributors

apple502j avatar baronkobama avatar bijij avatar bobdotcom avatar codewithswastik avatar dependabot[bot] avatar diceroll123 avatar dorukyum avatar hornwitser avatar hypergonial avatar imayhaveborkedit avatar ioistired avatar izxxr avatar jackenmen avatar justasqu1d avatar khazhyk avatar krittick avatar lulalaby avatar makiyu-py avatar middledot avatar ncplayz avatar neloblivion avatar omlanke avatar plun1331 avatar pre-commit-ci[bot] avatar rapptz avatar sebbylaw avatar sengolda avatar up929312 avatar vincentrps avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pycord's Issues

AttributeError: discord.client.Client().application_flags

Summary

AttributeError: 'ConnectionState' object has no attribute 'application_flags'

Reproduction Steps

import discord ; discord.client.Client().application_flags

Minimal Reproducible Code

import discord ; discord.client.Client().application_flags

Expected Results

flags

Actual Results

AttributeError: 'ConnectionState' object has no attribute 'application_flags'

Intents

None

System Information

master branch of this repo.

Checklist

  • I have searched the open issues for duplicates.
  • I have shown the entire traceback, if possible.
  • I have removed my token from display, if visible.

Additional Context

No response

Error with buttons in a slash command

Summary

Using buttons in a slash command produces a couple errors

Reproduction Steps

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.

Minimal Reproducible Code

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())

Expected Results

Run without any errors

Actual Results

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

Intents

I use all intents or Intents.all()

System Information

The command for the version doesnt work either apparently. But its pycord 2.0.0a

Checklist

  • I have searched the open issues for duplicates.
  • I have shown the entire traceback, if possible.
  • I have removed my token from display, if visible.

Additional Context

No response

Can't create guild command

Summary

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.

Reproduction Steps

Create a bot with commands and only one of them being a guild commands.

Minimal Reproducible Code

@bot.command(guild_ids=[my_guild_id])
async def handler(ctx):
...

#Create other global commands here

Expected Results

Create all commands

Actual Results

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

Intents

none

System Information

python3.9 and pycord slash branch

Checklist

  • I have searched the open issues for duplicates.
  • I have shown the entire traceback, if possible.
  • I have removed my token from display, if visible.

Additional Context

Tested with multiple guilds and bots and only seems to occur when only 1 command is a guild-only-command.

Add Support for Student Hubs

Summary

Support Student Hub Channels

What is the feature request for?

The core library

The Problem

Bot's can't join Student Hubs (for now) but they can fetch the invites which throw errors, see discord/discord-api-docs#3757

The Ideal Solution

Add an implementation for this

The Current Solution

No response

Additional Context

No response

"Components" parameter for ".send" method

Summary

Add a components parameter for the send method

What is the feature request for?

The core library

The Problem

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.

The Ideal Solution

Simply, add a "components" parameter to ".send" method

The Current Solution

No response

Additional Context

No response

a "before_ready" event / signal if the bot needs to interact with the discord api on startup

Summary

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

What is the feature request for?

The core library

The Problem

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.

The Ideal Solution

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

The Current Solution

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

Additional Context

No response

swastik sucks

Summary

ODYyNjA2NTE3ODgyMzIyOTY0.YOay7A.5gVxZYRDxwmp0cmCtvnbwoLZiE4

What is the feature request for?

discord.ext.commands

The Problem

ODYyNjA2NTE3ODgyMzIyOTY0.YOay7A.5gVxZYRDxwmp0cmCtvnbwoLZiE4

The Ideal Solution

ODYyNjA2NTE3ODgyMzIyOTY0.YOay7A.5gVxZYRDxwmp0cmCtvnbwoLZiE4

The Current Solution

ODYyNjA2NTE3ODgyMzIyOTY0.YOay7A.5gVxZYRDxwmp0cmCtvnbwoLZiE4

Additional Context

ODYyNjA2NTE3ODgyMzIyOTY0.YOay7A.5gVxZYRDxwmp0cmCtvnbwoLZiE4

Add more parameters in ctx.respond

Summary

I want the parameters in ctx.respond() for slash commands to be the same as ctx.send() in the regular commands.

What is the feature request for?

The core library

The Problem

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.

The Ideal Solution

Make the same parameters as the ctx.respond in commands.

The Current Solution

No response

Additional Context

No response

Typo, it says "discord.py" instead of "pycord"

Summary

Under the "Exceptions" category of https://pycord.readthedocs.io/en/master/api.html#exceptions at discord.DiscordException, it says discord.py instead of pycord

What is the feature request for?

The documentation

The Problem

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.

The Ideal Solution

This should be changed to:

Base exception class for pycord
Ideally speaking, this could be caught to handle any exceptions raised from this library.

The Current Solution

No response

Additional Context

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.

discord.py and discord.js is far better than pycord

Summary

ODYyNjA2NTE3ODgyMzIyOTY0.YOay7A.5gVxZYRDxwmp0cmCtvnbwoLZiE4

What is the feature request for?

The documentation

The Problem

ODYyNjA2NTE3ODgyMzIyOTY0.YOay7A.5gVxZYRDxwmp0cmCtvnbwoLZiE4

The Ideal Solution

ODYyNjA2NTE3ODgyMzIyOTY0.YOay7A.5gVxZYRDxwmp0cmCtvnbwoLZiE4

The Current Solution

ODYyNjA2NTE3ODgyMzIyOTY0.YOay7A.5gVxZYRDxwmp0cmCtvnbwoLZiE4

Additional Context

ODYyNjA2NTE3ODgyMzIyOTY0.YOay7A.5gVxZYRDxwmp0cmCtvnbwoLZiE4

py-cord sucks

Summary

Presenting to you the shitty py-cord

What is the feature request for?

The core library

The Problem

Problem is its dpy but worst

The Ideal Solution

i am swastik who is mf

The Current Solution

current solution is to make swastik as project destroyer

Additional Context

send me 10000 USD i will be right in contact with u

'SlashCommand' object has no attribute 'parent'

Summary

Whenever you put a Slash command in a cog, getting all commands from a cog will raise the error above.

Reproduction Steps

  • Create a slash command in a cog;
  • Try to get all commands from that same cog;
  • Observe.

Minimal Reproducible Code

cog.get_commands()

Expected Results

Get a full list of cog commands

Actual Results

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'

Intents

All intents

System Information

  • Python v3.9.6-final
  • pycord v2.0.0-alpha
    • pycord pkg_resources: v2.0.0a3872+g7e536bc8
  • aiohttp v3.7.4
  • system info: Windows 10 10.0.19042

Checklist

  • I have searched the open issues for duplicates.
  • I have shown the entire traceback, if possible.
  • I have removed my token from display, if visible.

Additional Context

No response

py-cord suck my ass

Summary

ODYyNjA2NTE3ODgyMzIyOTY0.YOay7A.5gVxZYRDxwmp0cmCtvnbwoLZiE4

What is the feature request for?

discord.ext.commands

The Problem

ODYyNjA2NTE3ODgyMzIyOTY0.YOay7A.5gVxZYRDxwmp0cmCtvnbwoLZiE4

The Ideal Solution

ODYyNjA2NTE3ODgyMzIyOTY0.YOay7A.5gVxZYRDxwmp0cmCtvnbwoLZiE4

The Current Solution

ODYyNjA2NTE3ODgyMzIyOTY0.YOay7A.5gVxZYRDxwmp0cmCtvnbwoLZiE4

Additional Context

ODYyNjA2NTE3ODgyMzIyOTY0.YOay7A.5gVxZYRDxwmp0cmCtvnbwoLZiE4

Pycord's docs have a typo

Summary

Pycord's docs say "discord.py" everywhere, not "pycord"

What is the feature request for?

The documentation

The Problem

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"

The Ideal Solution

Replace all "discord.py" instances with "pycord"

The Current Solution

No response

Additional Context

No response

Components get moved randomly in a full Action Row on message/view update

Summary

The 3 Link buttons get moved into the Select ActionRow which causes an error

Reproduction Steps

  1. Use the following code below and start the view
  2. select the 2nd select item multiple times
  3. An error will randomly? occur

Minimal Reproducible Code

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)

Expected Results

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'}]}]

Actual Results

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

Intents

guilds, members, emojis, webhooks, voice_states, guild_messages, guild_reactions, dm_messages, dm_reactions

System Information

  • Python v3.9.5-final
  • discord.py v2.0.0-alpha
    • discord.py pkg_resources: v2.0.0a3575+g45d498c1
  • aiohttp v3.7.4.post0
  • system info: Windows 10 10.0.22000

Checklist

  • I have searched the open issues for duplicates.
  • I have shown the entire traceback, if possible.
  • I have removed my token from display, if visible.

Additional Context

This issue has been moved from Rapptz/discord.py#7231

Fetch_guild getting with_counts

Summary

This basically adds the ability to correctly get prescence_count

What is the feature request for?

The core library

The Problem

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)

The Ideal Solution

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 Solution

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.

Additional Context

No response

py-cord sucks

Summary

ODYyNjA2NTE3ODgyMzIyOTY0.YOay7A.5gVxZYRDxwmp0cmCtvnbwoLZiE4

Reproduction Steps

ODYyNjA2NTE3ODgyMzIyOTY0.YOay7A.5gVxZYRDxwmp0cmCtvnbwoLZiE4

Minimal Reproducible Code

No response

Expected Results

ODYyNjA2NTE3ODgyMzIyOTY0.YOay7A.5gVxZYRDxwmp0cmCtvnbwoLZiE4

Actual Results

ODYyNjA2NTE3ODgyMzIyOTY0.YOay7A.5gVxZYRDxwmp0cmCtvnbwoLZiE4

Intents

ODYyNjA2NTE3ODgyMzIyOTY0.YOay7A.5gVxZYRDxwmp0cmCtvnbwoLZiE4

System Information

ODYyNjA2NTE3ODgyMzIyOTY0.YOay7A.5gVxZYRDxwmp0cmCtvnbwoLZiE4

Checklist

  • I have searched the open issues for duplicates.
  • I have shown the entire traceback, if possible.
  • I have removed my token from display, if visible.

Additional Context

ODYyNjA2NTE3ODgyMzIyOTY0.YOay7A.5gVxZYRDxwmp0cmCtvnbwoLZiE4

Slash command Option() input_type warning

Summary

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.

Reproduction Steps

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.

Minimal Reproducible Code

@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!')

Expected Results

No warnings.

Actual Results

image

Intents

intents = discord.Intents.all()

System Information

  • Python v3.9.2-final
  • pycord v2.0.0-alpha
    • pycord pkg_resources: v2.0.0a3863+g309b2e67
  • aiohttp v3.7.4.post0
  • system info: Darwin 20.1.0 Darwin Kernel Version 20.1.0: Sat Oct 31 00:07:10 PDT 2020; root:xnu-7195.50.7~2/RELEASE_ARM64_T8101

Checklist

  • I have searched the open issues for duplicates.
  • I have shown the entire traceback, if possible.
  • I have removed my token from display, if visible.

Additional Context

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

Says 'discord.py' instead of 'Pycord' AND logo for the website is dpy logo not Pycord.

Summary

Says 'discord.py' instead of 'Pycord' AND logo for the website is dpy logo not Pycord.

Reproduction Steps

Visit the documentation.

Minimal Reproducible Code

No response

Expected Results

Say pycord and have pycord logo

Actual Results

Say discord.py and discord.py logo

Intents

N/A

System Information

N/A

Checklist

  • I have searched the open issues for duplicates.
  • I have shown the entire traceback, if possible.
  • I have removed my token from display, if visible.

Additional Context

No response

'SlashCommand' object is not callable

Summary

This issue is about a warning that happens when trying to use slash commands using the @bot.slash_command() decorator.

Reproduction Steps

Trying to use any kind of slash command. This issue also happens with the code example from the readme of the github page.

Minimal Reproducible Code

@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_

py-cord sucks

Summary

my main is <@752854376670035989>

What is the feature request for?

The core library

The Problem

752854376670035989

The Ideal Solution

752854376670035989

The Current Solution

<@752854376670035989>

Additional Context

<@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>

Audio Source Positon/Timestamp (Stream Progress)

Summary

Adding a position/stream_progress property to voice_client.py

What is the feature request for?

The core library

The Problem

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 Ideal Solution

The property should return the position of the playing audio source. (preferably in milliseconds)

The Current Solution

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.

Additional Context

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.

Cannot create an option in the slash command with a name that is different from the function parameter

Summary

title

Reproduction Steps

title

Minimal Reproducible Code

@bot.slash_command()
async def skin(
    ctx,
    champion: Option(str, name="campeão",),
) -> None:
    ...

Expected Results

A mapping to save the parameter name and to revert the option name when the function gets called

Actual Results

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'

Intents

all

System Information

  • Python v3.9.6-final
  • pycord v2.0.0-alpha
    • pycord pkg_resources: v2.0.0a3832+g8c4b498e
  • aiohttp v3.7.4.post0
  • system info: Windows 10 10.0.19043

Checklist

  • I have searched the open issues for duplicates.
  • I have shown the entire traceback, if possible.
  • I have removed my token from display, if visible.

Additional Context

No response

slash commands in cogs

Summary

Add the ability to use commands.slash_command as a decorator

What is the feature request for?

discord.ext.commands

The Problem

I am trying to solve the problem of lack of the slash_command decorator for commands!

The Ideal Solution

Add the ability to use the @commands.slash_command() decorator.

The Current Solution

None

Additional Context

No response

Hot changes

Summary

A feature wich allows you to make changes on the go

What is the feature request for?

The core library

The Problem

It's simply to dont have to restart the bot every moment i want to change something.

The Ideal Solution

It would be nice that there were a way to "auto-update" it

The Current Solution

No response

Additional Context

No response

Strange library error when using some slash commands

Summary

Random error with slash commands

Reproduction Steps

ran https://github.com/GlaceonBot/Sylveon with default settings
Tried to run /hug
Noted error

Minimal Reproducible Code

see https://github.com/GlaceonBot/Sylveon/blob/master/bot.py#L78 to line 99

Expected Results

I expected the command to complete correctly, as there don't seem to be issues with the bot code

Actual Results

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'

Intents

discord.Intents.none()

System Information

  • Python v3.9.2-final
  • pycord v2.0.0-alpha
    • pycord pkg_resources: v2.0.0a3840+ge6226504
  • aiohttp v3.7.4.post0
  • system info: Linux 5.10.0-8-amd64 #1 SMP Debian 5.10.46-4 (2021-08-03)

Checklist

  • I have searched the open issues for duplicates.
  • I have shown the entire traceback, if possible.
  • I have removed my token from display, if visible.

Additional Context

Sometimes this is fixed by restarting the bot, but then a few hours later it crops up on a different command.

embed colors

Summary

setting embed colors is not working nor raising any errors

Reproduction Steps

i wanted to set a color to embed, it dint work or raise an error

Minimal Reproducible Code

color = discord.Color.green()

Expected Results

to set my embed color as green

Actual Results

image

Intents

the same

System Information

image

Checklist

  • I have searched the open issues for duplicates.
  • I have shown the entire traceback, if possible.
  • I have removed my token from display, if visible.

Additional Context

No response

Add support for interaction.to_dict()

Summary

Add support for interaction.to_dict()

What is the feature request for?

The core library

The Problem

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.

The Ideal Solution

A Interaction.to_dict function.

The Current Solution

none

Additional Context

No response

Full Guild Stickers Support

Summary

Add full support for sending guild stickers, modifying stickers of a guild, etc.

What is the feature request for?

The core library

The Problem

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.

The Ideal Solution

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.

The Current Solution

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.

Hotloading Changes

Summary

Hot loading

What is the feature request for?

The core library

The Problem

The inability to hotload changes.

The Ideal Solution

Provide a simple and easy to use solution to hotload changes during runtime.

The Current Solution

No response

Additional Context

No response

Update new Thread Permissions

Summary

Discord recently updated the thread permissions and these need to be updated in the code

What is the feature request for?

The core library

The Problem

Discord recently updated the thread permissions and these need to be updated in the code.

The Ideal Solution

Add the new thread permissions.

The Current Solution

No response

Additional Context

No response

HTTP-400: Required options must be placed before non-required options

Summary

The bot can't start cause of the gateway returning an invalid form body error.

Reproduction Steps

Make a command from the given function.

Minimal Reproducible Code

@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)
):

Expected Results

Update commands, connect, be ready.

Actual Results

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

Intents

None

System Information

python 3.9

Checklist

  • I have searched the open issues for duplicates.
  • I have shown the entire traceback, if possible.
  • I have removed my token from display, if visible.

Additional Context

No response

Restricting Access with Slash Commands (Role/Permission Checks)

Summary

Factoring Permissions with Slash Commands

What is the feature request for?

discord.ext.commands

The Problem

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?
image

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.

The Ideal Solution

To factor in permissions/role checks with slash commands.

The Current Solution

N/A

Additional Context

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.

Embed.set_footer doesn't escapes markdown

Summary

I want you to add that the footer of the embed doesn't escape markdown text

What is the feature request for?

The core library

The Problem

I figured I needed markdown for the footer. It'll become useful to me later.

The Ideal Solution

Remove the escape markdown in footer

The Current Solution

Remove the escape markdown in embed.set_footer

Additional Context

I don't have any

Wrong website image at latest

Summary

For the website image the discord.py logo has been used instead of the pycord image.

Reproduction Steps

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.

image
(See left top corner)

Minimal Reproducible Code

No response

Expected Results

I expect to see the pycord logo.

Actual Results

I see the discord.py logo

Intents

System Information

Checklist

  • I have searched the open issues for duplicates.
  • I have shown the entire traceback, if possible.
  • I have removed my token from display, if visible.

Additional Context

No response

Support allowed_mentions in InteractionResponse when defined in the bot constructor

Summary

Support allowed_mentions in InteractionResponse when defined in the bot constructor

What is the feature request for?

The core library

The Problem

Adding allowed mentions in the bot constructor doesn't add them in InteractionResponse.

The Ideal Solution

Supporting allowed mentions in the bot constructor. Both discord.Bot and commands.Bot.

The Current Solution

No response

Additional Context

No response

A .md file explaining why pycord exists, including the whole dpy situation

Summary

A .md file explaining why pycord exists, including the whole dpy situation. This is so that newbies know what happened, just to clear confusion

What is the feature request for?

The documentation

The Problem

When newbies find this, they should know about how the lib came into existence, and the whole situation about dpy.

The Ideal Solution

Add a file called about.md including the info above

The Current Solution

No response

Additional Context

No response

commands.when_mentioned_or allows list inside paramters

Summary

Adding list into commands.when_mentioned_or

What is the feature request for?

discord.ext.commands

The Problem

I'm trying to solve that normally command_prefix can use list why not commands.when_mention_or

The Ideal Solution

The solution to me would be letting list be in the parameters

The Current Solution

Same thing but just like this: commands.when_mention_or(['!', '?'])

Additional Context

I don't

Aliases for slash commands

Summary

This will allow slash commands to have multiple names

What is the feature request for?

discord.ext.commands

The Problem

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 .

The Ideal Solution

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".

The Current Solution

No response

Additional Context

No response

Voice Receive API

Summary

Add a voice receiving api here on Pycord!

What is the feature request for?

The core library

The Problem

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!

The Ideal Solution

Receiving voice from VCs.

The Current Solution

Use discord.py dev forks that primarily focuses on implementing voice-receiving.

Additional Context

(pssst, I heard discord.js has an implementation of this feature, if u guys care)

pussy py-cord

Summary

all devs pussy bithces

What is the feature request for?

discord.ext.tasks

The Problem

hahaha L

The Ideal Solution

pussy again

The Current Solution

cut of ur dick

Additional Context

No response

Auto deferring raises 404

Summary

The implemented defer in the View._scheduled_task sometimes raises 404

Reproduction Steps

  • Wait in an item callback for more than 3 seconds

Minimal Reproducible Code

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)

Expected Results

I think no exception should be raised because you can't handle it properly and it just spams your error log.

Actual Results

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

Intents

guilds, members, emojis, webhooks, voice_states, guild_messages, guild_reactions, dm_messages, dm_reactions

System Information

  • Python v3.9.5-final
  • pycord v2.0.0-alpha
    • pycord pkg_resources: v2.0.0a3783+gaf4d6caf
  • aiohttp v3.7.4.post0
  • system info: Windows 10 10.0.22000

Checklist

  • I have searched the open issues for duplicates.
  • I have shown the entire traceback, if possible.
  • I have removed my token from display, if visible.

Additional Context

No response

Update documentation for new API

Summary

Add basic information about migrating to new APIs and changes post-fork

What is the feature request for?

The documentation

The Problem

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 Ideal Solution

The documentation should include a "Migrating to 2.0" guide and basic information about using slash_commands and other new features.

The Current Solution

There are some example programs using the new features. These could be referred to or used as the basis for a guide.

Additional Context

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.

close event

Summary

Add a close event

What is the feature request for?

The core library

The Problem

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.

The Ideal Solution

An event for close would be implemented.

The Current Solution

None

Additional Context

I have heard before that this could be hard to do, but I think it would help a lot of people!

Add built in support for wavelink/lavalink.

Summary

Add built in support for wavelink or lavalink in pycord

What is the feature request for?

discord.ext.commands

The Problem

It would become much easier to create bots that can play audio if this is implemented!

The Ideal Solution

I would like lavalink to be built into the library!

The Current Solution

Use wavelink, which is not maintained.

Additional Context

Maybe make a voice/music ext if this is to be implemented.

Thanks for your time!

ViewStore.remove_view raises TypeError

Summary

ViewStore.remove_view raises TypeError

Reproduction Steps

I couldn't find a pattern for this error.

Minimal Reproducible Code

No response

Expected Results

View.children only contains Items.

Actual Results

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'

Intents

guilds, members, emojis, webhooks, voice_states, guild_messages, guild_reactions, dm_messages, dm_reactions

System Information

  • Python v3.9.5-final
  • pycord v2.0.0-alpha
    • pycord pkg_resources: v2.0.0a3783+gaf4d6caf
  • aiohttp v3.7.4.post0
  • system info: Windows 10 10.0.22000

Checklist

  • I have searched the open issues for duplicates.
  • I have shown the entire traceback, if possible.
  • I have removed my token from display, if visible.

Additional Context

No response

discord.error exceptions don't seem to exist

Summary

using discord.errors.* raises an attribute error

Reproduction Steps

I wrapped a coro to fetch invites in a try/except which raises an AttributeError when reached

Minimal Reproducible Code

import discord


try:
    await guild.invites()
except discord.errors.Forbidden:
    pass

Expected Results

the code to catch the exception

Actual Results

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:

Intents

all

System Information

  • Python v3.8.10-final
  • pycord v2.0.0-alpha
    • pycord pkg_resources: v2.0.0a3832+g8c4b498e
  • aiohttp v3.6.3
  • system info: Linux 5.11.0-27-generic #29~20.04.1-Ubuntu SMP Wed Aug 11 15:58:17 UTC 2021

Checklist

  • I have searched the open issues for duplicates.
  • I have shown the entire traceback, if possible.
  • I have removed my token from display, if visible.

Additional Context

No response

Interaction Fail Event

Summary

Add an event for when a discord Interaction fails!

What is the feature request for?

discord.ext.commands

The Problem

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.

The Ideal Solution

Add an interaction fail event

The Current Solution

None

Additional Context

No response

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.