internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: Pycord-Development/pycord

Issue:
Bug with `max_concurrency` and `slash_command`
### Summary

max_concurrency does not work propper.

### Reproduction Steps

create a slash command with `max_concrrency`, execute it. Second time it will raise `MaxConcurrencyReached`

### Minimal Reproducible Code

```python
@slash_command(description = "test cmd")
@commands.max_concurrency(1, per=BucketType.channel)
async def test(self, ctx):
        await ctx.channel.send("test")
```


### Expected Results

First use: print "test"
Sec use: print "test"

### Actual Results

First use: print "test"
Sec use: Raise `MaxConcurrencyReached`

### Intents

all

### System Information

- Python v3.9.5-final
- py-cord v2.0.0-alpha
    - py-cord pkg_resources: v2.0.0a4744+g9aafd033
- aiohttp v3.7.3

### 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_
Bug with `max_concurrency` and `slash_command`
### Summary

max_concurrency does not work propper.

### Reproduction Steps

create a slash command with `max_concrrency`, execute it. Second time it will raise `MaxConcurrencyReached`

### Minimal Reproducible Code

```python
@slash_command(description = "test cmd")
@commands.max_concurrency(1, per=BucketType.channel)
async def test(self, ctx):
        await ctx.channel.send("test")
```


### Expected Results

First use: print "test"
Sec use: print "test"

### Actual Results

First use: print "test"
Sec use: Raise `MaxConcurrencyReached`

### Intents

all

### System Information

- Python v3.9.5-final
- py-cord v2.0.0-alpha
    - py-cord pkg_resources: v2.0.0a4744+g9aafd033
- aiohttp v3.7.3

### 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_


Discussion:

Resolving patch:
diff --git a/discord/commands/commands.py b/discord/commands/commands.py
--- a/discord/commands/commands.py
+++ b/discord/commands/commands.py
@@ -102,6 +102,8 @@ async def wrapped(arg):
         except Exception as exc:
             raise ApplicationCommandInvokeError(exc) from exc
         finally:
+            if command._max_concurrency is not None:
+                await command._max_concurrency.release(ctx)
             await command.call_after_hooks(ctx)
         return ret
     return wrapped


Test patch:
Repository: Pycord-Development/pycord

Issue:
discord.ext.pages.Paginator does not update current_page attribute when page is changed using Paginator.goto()
### Summary

When you do paginator.goto(<pagenum>), the value of current_page still stays the same. If it is not changed manually, then it will stay as 0, which is what it starts out as when the Paginator object is created.

### Reproduction Steps

To reproduce this issue, create a Paginator object, create the callback, and remove the buttons. I used a Select (menu) to change the page, and based on what the user clicked, I used paginator.goto(<pagenum>) to go to the corresponding page. After that line of code, if you check what the value of current_page is, it will still be 0, whether or not you are actually on page 0.

### Minimal Reproducible Code

```python
async def select_callback(interaction):
    await p.goto(<pagenum>)
    print(p.current_page) # Expected result: <pagenum>, actual result: 0
p = Paginator(pages=<list of pages>, custom_view=<view with Select>, use_default_buttons=False, show_indicator=False)
await p.send(ctx)
```


### Expected Results

I expected to see that the value of paginator.current_page was the index of the page I had set the paginator to before, with goto().

### Actual Results

The actual result was that current_page was 0.

### Intents

default, members

### System Information

- Python v3.10.0-final
- py-cord v2.0.0-alpha
    - py-cord pkg_resources: v2.0.0a4757+g02e346db
- aiohttp v3.7.4.post0
- system info: Windows 10 10.0.19043

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


Discussion:

Resolving patch:
diff --git a/discord/ext/pages/pagination.py b/discord/ext/pages/pagination.py
--- a/discord/ext/pages/pagination.py
+++ b/discord/ext/pages/pagination.py
@@ -380,6 +380,12 @@ async def goto_page(self, page_number=0) -> discord.Message:
             The message associated with the paginator.
         """
         self.update_buttons()
+        self.current_page = page_number
+        if self.show_indicator:
+            self.buttons["page_indicator"][
+                "object"
+            ].label = f"{self.current_page + 1}/{self.page_count + 1}"
+
         page = self.pages[page_number]
         page = self.get_page_content(page)
 


Test patch:
Repository: Pycord-Development/pycord

Issue:
Setting embed.description to None instead sets it to "None"
### Summary

Setting embed.description to None instead sets it to "None"

### Reproduction Steps

embed.description = None

### Minimal Reproducible Code

```python
embed = discord.Embed()
embed.description = None
```


### Expected Results

Remove the embed description

### Actual Results

Change the embed description to "None"

### Intents

discord.Intents.all()

### System Information

- Python v3.9.7-final
- py-cord v2.0.0-alpha
    - py-cord pkg_resources: v2.0.0a4757+g02e346db
- aiohttp v3.7.4.post0
- system info: Windows 10 10.0.22000

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


Discussion:

Resolving patch:
diff --git a/discord/embeds.py b/discord/embeds.py
--- a/discord/embeds.py
+++ b/discord/embeds.py
@@ -193,13 +193,13 @@ def __init__(
         self.url = url
         self.description = description
 
-        if self.title is not EmptyEmbed:
+        if self.title is not EmptyEmbed and self.title is not None:
             self.title = str(self.title)
 
-        if self.description is not EmptyEmbed:
+        if self.description is not EmptyEmbed and self.description is not None:
             self.description = str(self.description)
 
-        if self.url is not EmptyEmbed:
+        if self.url is not EmptyEmbed and self.url is not None:
             self.url = str(self.url)
 
         if timestamp:


Test patch:
Repository: Pycord-Development/pycord

Issue:
Attribute Error
### Summary

Failure in adding `commands.group()`

### Reproduction Steps

This is core bug at: https://github.com/Pycord-Development/pycord/blob/c3265c24c0fadf8209c52b064b2656aea645a3aa/discord/ext/commands/core.py#L1174-L1177

For now revert: #817 

### Minimal Reproducible Code

```python
@commands.group()
async def group(ctx: Context):
    pass
```


### Expected Results

Successful command register 

### Actual Results

```py
   File "/app/.heroku/python/lib/python3.9/site-packages/discord/cog.py", line 184, in __new__
     new_cls.__cog_commands__ = tuple(c._update_copy(cmd_attrs) for c in new_cls.__cog_commands__)  # type: ignore
   File "/app/.heroku/python/lib/python3.9/site-packages/discord/cog.py", line 184, in <genexpr>
     new_cls.__cog_commands__ = tuple(c._update_copy(cmd_attrs) for c in new_cls.__cog_commands__)  # type: ignore
   File "/app/.heroku/python/lib/python3.9/site-packages/discord/ext/commands/core.py", line 525, in _update_copy
     return self.copy()
   File "/app/.heroku/python/lib/python3.9/site-packages/discord/ext/commands/core.py", line 1453, in copy
     for cmd in self.commands:
   File "/app/.heroku/python/lib/python3.9/site-packages/discord/ext/commands/core.py", line 1182, in commands
     return set(self.all_commands.values())
   File "/app/.heroku/python/lib/python3.9/site-packages/discord/ext/commands/core.py", line 1177, in all_commands
     return {**self._application_commands, **self.prefixed_commands}
AttributeError: 'Group' object has no attribute '_application_commands'
```

### Intents

Member, Message

### System Information

- Python v3.9.9-final
- py-cord v2.0.0-alpha
    - py-cord pkg_resources: v2.0.0a4822+g9feb8c16
- aiohttp v3.8.1
- system info: Linux 4.4.0-1097-aws 

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


Discussion:

Resolving patch:
diff --git a/discord/ext/commands/core.py b/discord/ext/commands/core.py
--- a/discord/ext/commands/core.py
+++ b/discord/ext/commands/core.py
@@ -1174,8 +1174,10 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
     @property
     def all_commands(self):
         # merge app and prefixed commands
-        return {**self._application_commands, **self.prefixed_commands}
-        
+        if hasattr(self, "_application_commands"):
+            return {**self._application_commands, **self.prefixed_commands}
+        return self.prefixed_commands
+
     @property
     def commands(self) -> Set[Command[CogT, Any, Any]]:
         """Set[:class:`.Command`]: A unique set of commands without aliases that are registered."""


Test patch:
Repository: Pycord-Development/pycord

Issue:
Set pagination's current page before pagination is sent or responded
### Summary

The ability to set the inital current page index before sending a pagination message.

### What is the feature request for?

discord.ext.pages

### The Problem

I'll give an example use case:

Say I have a school schedule system in my discord bot. Using a command I can view each day of the week and my classes for that day (See screenshot).  Page 1 is Monday all the way to page 7 being Sunday.

![image](https://user-images.githubusercontent.com/34781348/151098747-ef3b8fa2-5f88-4cab-8fa0-b28f06e3e7ca.png)

Now, say I want the initial page shown to be the current day of the week. Meaning, by default this command displays my current day, and can still navigate through the week.  If today is Tuesday, the page would be `2/7`.  Unfortunately, there is no way to set the current page index before sending the pagination.

### The Ideal Solution

Ideally, either goto_page() could be called before the pagination is responded (`pagination.respond()`) or sent (`pagination.send()`) (currently it throws an error if this is the case) or another method like set_initial_page() could be added.

### The Current Solution

Right now, the best way to do this is to `pagination.send()` or `pagination.respond()` and immediately after call `pagination.goto_page(desired_index)`. However, this gives a displeasing glitch as it quickly switches from page 1 to `desired_index` when sent. 

Another way, but just a work-around, is to make your `pages` list start with your desired page's message (or embed). So if today is Tuesday, my pages list would look like `[tue, wed, thu, fri, sat, sun, mon]`. But this is not great as I want Tuesday to be `2/7` and not `1/7`.

### Additional Context

_No response_


Discussion:

Resolving patch:
diff --git a/discord/ext/pages/pagination.py b/discord/ext/pages/pagination.py
--- a/discord/ext/pages/pagination.py
+++ b/discord/ext/pages/pagination.py
@@ -604,7 +604,7 @@ async def send(
             raise TypeError(f"expected abc.Messageable not {target.__class__!r}")
 
         self.update_buttons()
-        page = self.pages[0]
+        page = self.pages[self.current_page]
         page = self.get_page_content(page)
 
         self.user = ctx.author
@@ -657,7 +657,7 @@ async def respond(
 
         self.update_buttons()
 
-        page = self.pages[0]
+        page = self.pages[self.current_page]
         page = self.get_page_content(page)
 
         self.user = interaction.user


Test patch:
Repository: Pycord-Development/pycord

Issue:
case_insensitive not working properly in 2.0.0b1
### Summary

Commands will only be accepted if they are full lowercase

### Reproduction Steps

Implement command with not only lowercase letters
Add case_insensitive=True
Command is only accessible with full lowercase 

Tested the same setup in 2.0.0b1 and 1.7.3
1.7.3 accepted all inputs as Command, 2.0.0b1 only accepts lowercase commands

### Minimal Reproducible Code

```python
from discord.ext import commands

comand_prefix = "-"
bot_token = open("Bot_Token.txt").readline()

bot = commands.Bot(command_prefix=comand_prefix, case_insensitive=True)

class a(commands.Cog, name="Cog Name"):

    @commands.command()
    async def Test(self, ctx):
        print("test")

bot.add_cog(a(bot))
bot.run(bot_token)

# -> Accepts "-test" but not "-Test"
```


### Expected Results

Accept commands case insensitive

### Actual Results

Accepts commands only when lowercase, otherwise CommandNotFound error

### Intents

None

### System Information

- Python v3.10.0-final
- py-cord v2.0.0-beta
    - py-cord pkg_resources: v2.0.0b1
- aiohttp v3.7.4.post0
- system info: Windows 10 10.0.19043



Discussion:
> https://discord.com/channels/881207955029110855/881224361015672863/934131768938876958

I saw that coming...

Probably this is causing the issues:

https://github.com/Pycord-Development/pycord/blob/master/discord/ext/commands/core.py#L1174-L1179


Resolving patch:
diff --git a/discord/ext/commands/bot.py b/discord/ext/commands/bot.py
--- a/discord/ext/commands/bot.py
+++ b/discord/ext/commands/bot.py
@@ -314,7 +314,7 @@ class be provided, it must be similar enough to :class:`.Context`\'s
         ctx.invoked_with = invoker
         # type-checker fails to narrow invoked_prefix type.
         ctx.prefix = invoked_prefix  # type: ignore
-        ctx.command = self.all_commands.get(invoker)
+        ctx.command = self.prefixed_commands.get(invoker)
         return ctx
 
     async def invoke(self, ctx: Context) -> None:


Test patch:
Repository: Pycord-Development/pycord

Issue:
link fix


### This link
![image](https://user-images.githubusercontent.com/73550760/155858568-cb766752-d19d-4def-a695-cefe013760c6.png)

### The link leads here:
![image](https://user-images.githubusercontent.com/73550760/155858609-b289802e-3039-4129-878e-3d78295076fa.png)

I think you just need to replace this link with this one
```
https://github.com/Pycord-Development/pycord/tree/master/examples
```

on this page:
https://docs.pycord.dev/en/master/index.html


Discussion:

Resolving patch:
diff --git a/docs/conf.py b/docs/conf.py
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -100,7 +100,7 @@
 release = version
 
 # This assumes a tag is available for final releases
-branch = "master" if version.endswith("a") or version.endswith("b") else f"v{version}"
+branch = "master" if "a" in version or "b" in version else f"v{version}"
 
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.


Test patch:
Repository: Pycord-Development/pycord

Issue:
Optional Modal InputText fields with existing values do not accept empty strings
### Summary

Submitted Empty InputText fields revert to stored value

### Reproduction Steps

1. Create a Modal with an `InputText` that is both `required=False` and has a `value`
2. Delete the text in the Modal and submit
3. Inspect the Modal's children in the callback.

### Minimal Reproducible Code

_No response_

### Expected Results

Expected: The incoming field (e.g. `self.children[0].value`) should be empty

### Actual Results

Actual: The field retains its previous/existing `value` instead of being overwritten by the empty string.

### Intents

members

### System Information

Python 3.9
Pycord 2.0.0b4

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

I did verify through logging that the Modal does indeed submit the empty value, but I was unable to find where in the code this was handled.
Optional Modal InputText fields with existing values do not accept empty strings
### Summary

Submitted Empty InputText fields revert to stored value

### Reproduction Steps

1. Create a Modal with an `InputText` that is both `required=False` and has a `value`
2. Delete the text in the Modal and submit
3. Inspect the Modal's children in the callback.

### Minimal Reproducible Code

_No response_

### Expected Results

Expected: The incoming field (e.g. `self.children[0].value`) should be empty

### Actual Results

Actual: The field retains its previous/existing `value` instead of being overwritten by the empty string.

### Intents

members

### System Information

Python 3.9
Pycord 2.0.0b4

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

I did verify through logging that the Modal does indeed submit the empty value, but I was unable to find where in the code this was handled.


Discussion:
Confirmed bug, working on a fix.
Confirmed bug, working on a fix.

Resolving patch:
diff --git a/discord/ui/input_text.py b/discord/ui/input_text.py
--- a/discord/ui/input_text.py
+++ b/discord/ui/input_text.py
@@ -76,7 +76,7 @@ def __init__(
             required=required,
             value=value,
         )
-        self._input_value = None
+        self._input_value = False
         self.row = row
         self._rendered_row: Optional[int] = None
 
@@ -164,7 +164,10 @@ def required(self, value: Optional[bool]):
     @property
     def value(self) -> Optional[str]:
         """Optional[:class:`str`]: The value entered in the text field."""
-        return self._input_value or self._underlying.value
+        if self._input_value is not False:
+            # only False on init, otherwise the value was either set or cleared
+            return self._input_value  # type: ignore
+        return self._underlying.value
 
     @value.setter
     def value(self, value: Optional[str]):


Test patch:
Repository: Pycord-Development/pycord

Issue:
Member.kick() does not provide reason
### Summary

No reason given with a kick

### Reproduction Steps

Basically, have a kick command like this example and try to kick user with a nice reason
![](https://i.alexflipnote.dev/2SLXVDj.png)

### Minimal Reproducible Code

```python
Look above
```


### Expected Results

User would be kicked successfully **and** the reason would be provided to audit logs.

### Actual Results

![](https://i.alexflipnote.dev/6zbfX3U.png)
![](https://i.alexflipnote.dev/2SLXVDj.png)
![](https://i.alexflipnote.dev/3q3cQ9r.png)

### Intents

guilds, members, messages, bans, emojis, voice_states, reactions, message_content

### System Information

## Local Windows machine
```
- Python v3.10.2-final
- py-cord v2.0.0-beta
    - py-cord pkg_resources: v2.0.0b4
- aiohttp v3.8.1
- system info: Windows 10 10.0.22000
```

## Server which the bot runs on 
```
- Python v3.10.2-final
- py-cord v2.0.0-beta
    - py-cord pkg_resources: v2.0.0b4
- aiohttp v3.8.1
- system info: Linux 4.19.0-14-amd64 #1 SMP Debian 4.19.171-2 (2021-01-30)
```

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


Discussion:
Potentially related to some issues I uncovered while implementing #1067. Will dig into this and see. 

Resolving patch:
diff --git a/discord/http.py b/discord/http.py
--- a/discord/http.py
+++ b/discord/http.py
@@ -833,11 +833,7 @@ def kick(self, user_id: Snowflake, guild_id: Snowflake, reason: Optional[str] =
             guild_id=guild_id,
             user_id=user_id,
         )
-        if reason:
-            # thanks aiohttp
-            r.url = f"{r.url}?reason={_uriquote(reason)}"
-
-        return self.request(r)
+        return self.request(r, reason=reason)
 
     def ban(
         self,


Test patch:
Repository: Pycord-Development/pycord

Issue:
Add `bot.invoke_application_command`
### Summary

Add a `bot.invoke_application_command` or make `bot.invoke` dynamically work for both commands and application commands.

### What is the feature request for?

The core library

### The Problem

Currently there is no `bot.invoke` for application commands. I used the `invoke` method to set the locale for the command.

### The Ideal Solution

Either add a `bot.invoke_application_command` or (even better) make `bot.invoke` work for both types.

### The Current Solution

_No response_

### Additional Context

Already talked with @BobDotCom here https://discord.com/channels/881207955029110855/881224361015672863/949387798073454643


Discussion:

Resolving patch:
diff --git a/discord/bot.py b/discord/bot.py
--- a/discord/bot.py
+++ b/discord/bot.py
@@ -749,16 +749,7 @@ async def process_application_commands(self, interaction: Interaction, auto_sync
 
         ctx = await self.get_application_context(interaction)
         ctx.command = command
-        self.dispatch("application_command", ctx)
-        try:
-            if await self.can_run(ctx, call_once=True):
-                await ctx.command.invoke(ctx)
-            else:
-                raise CheckFailure("The global check once functions failed.")
-        except DiscordException as exc:
-            await ctx.command.dispatch_error(ctx, exc)
-        else:
-            self.dispatch("application_command_completion", ctx)
+        await self.invoke_application_command(ctx)
 
     def slash_command(self, **kwargs):
         """A shortcut decorator that invokes :func:`.ApplicationCommandMixin.command` and adds it to
@@ -986,6 +977,28 @@ class be provided, it must be similar enough to
             cls = AutocompleteContext
         return cls(self, interaction)
 
+    async def invoke_application_command(self, ctx: ApplicationContext) -> None:
+        """|coro|
+
+        Invokes the application command given under the invocation
+        context and handles all the internal event dispatch mechanisms.
+
+        Parameters
+        -----------
+        ctx: :class:`.ApplicationCommand`
+            The invocation context to invoke.
+        """
+        self.dispatch("application_command", ctx)
+        try:
+            if await self.can_run(ctx, call_once=True):
+                await ctx.command.invoke(ctx)
+            else:
+                raise CheckFailure("The global check once functions failed.")
+        except DiscordException as exc:
+            await ctx.command.dispatch_error(ctx, exc)
+        else:
+            self.dispatch("application_command_completion", ctx)
+
 
 class BotBase(ApplicationCommandMixin, CogMixin):
     _supports_prefixed_commands = False


Test patch: