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

Issue:
applied_tags does not update when tags are changed on forum posts
### Summary

applied_tags does not update when tags are changed on forum posts

### Reproduction Steps

Start bot
fetch before.applied_tags
change tags on forum post
fetch after.applied_tags
before.applied_tags == after.applied_tags

### Minimal Reproducible Code

```python
@Cog.listener()
    async def on_thread_update(self, before, after):
        print(before.applied_tags == after.applied_tags)
```


### Expected Results

applied_tags to return the updated list of tags

### Actual Results

applied_tags returns the initial list of tags (collected at bot first run?)

### Intents

discord.Intents.default(), intents.members = True

### System Information

- Python v3.10.2-final
- py-cord v2.3.2-final
- aiohttp v3.8.3
- system info: Windows 10 10.0.19044

### 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:
**It is a bug probably.** In the meantime you could use the `on_raw_thread_update `event. You can use a database or just a simple json simple to store the initial values of the tags in a list then compare it with the value from the payload.

```
@Cog.listener()
async def on_raw_thread_update(payload):
    print(payload.data['applied_tags'])
```

Resolving patch:
diff --git a/discord/threads.py b/discord/threads.py
--- a/discord/threads.py
+++ b/discord/threads.py
@@ -247,6 +247,9 @@ def _update(self, data):
         except KeyError:
             pass
 
+        self._applied_tags: list[int] = [
+            int(tag_id) for tag_id in data.get("applied_tags", [])
+        ]
         self.flags: ChannelFlags = ChannelFlags._from_value(data.get("flags", 0))
         self.slowmode_delay = data.get("rate_limit_per_user", 0)
 


Test patch:
Repository: Pycord-Development/pycord

Issue:
Missing OptionChoice as one of the possible values in basic_autocomplete's typehint
### Summary

The basic_autocomplete util function has a typehint that only allows an iterable of strings or integers or floats (or a callable/coroutine that returns one of these) but the actual code allows for the OptionChoice class by getting the "name" attribute. Therefore the typehint should also allow an instance of this class to be used in the iterable passed into the "values" argument.

### Reproduction Steps

1. Pass an iterable of `OptionChoice` instances to the `basic_autocomplete` util function
2. Run any static type-checker over the code (E.g. mypy or Pycharm's inbuilt checker
3. The argument will show as an error: `Mypy: Argument 1 to "basic_autocomplete" has incompatible type [arg-type]`

### Minimal Reproducible Code

```python
from typing import Iterable

import discord

choices: Iterable[discord.OptionChoice] = [discord.OptionChoice(name="Choice 1", value="val1"), discord.OptionChoice(name="Choice 2", value="val2")]

discord.utils.basic_autocomplete(choices)
```


### Expected Results

Static type-checkers (like mypy or Pycharm's inbuilt checker) should not show any type error inspections for the `values` argument to `basic_autocoplete`

### Actual Results

Static type-checkers (like mypy or Pycharm's inbuilt checker) show type error inspections for the `values` argument to `basic_autocoplete`

### Intents

None

### System Information

- Python v3.11.3-final              
- py-cord v2.4.1-final              
- aiohttp v3.8.4                    
- system info: Windows 10 10.0.19045

### 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/utils.py b/discord/utils.py
--- a/discord/utils.py
+++ b/discord/utils.py
@@ -142,6 +142,7 @@ def __get__(self, instance, owner):
 
     from .abc import Snowflake
     from .commands.context import AutocompleteContext
+    from .commands.options import OptionChoice
     from .invite import Invite
     from .permissions import Permissions
     from .template import Template
@@ -156,6 +157,7 @@ class _RequestLike(Protocol):
 else:
     cached_property = _cached_property
     AutocompleteContext = Any
+    OptionChoice = Any
 
 
 T = TypeVar("T")
@@ -1298,7 +1300,7 @@ def generate_snowflake(dt: datetime.datetime | None = None) -> int:
     return int(dt.timestamp() * 1000 - DISCORD_EPOCH) << 22 | 0x3FFFFF
 
 
-V = Union[Iterable[str], Iterable[int], Iterable[float]]
+V = Union[Iterable[OptionChoice], Iterable[str], Iterable[int], Iterable[float]]
 AV = Awaitable[V]
 Values = Union[V, Callable[[AutocompleteContext], Union[V, AV]], AV]
 AutocompleteFunc = Callable[[AutocompleteContext], AV]


Test patch:
Repository: Pycord-Development/pycord

Issue:
Support for custom status
### Summary

https://github.com/discord/discord-api-docs/pull/6345

### What is the feature request for?

The core library

### The Problem

API change

### The Ideal Solution

Reflect the API

### The Current Solution

_No response_

### Additional Context

_No response_


Discussion:
It's important that custom status support is added somewhat like that:

```cs
	public DiscordActivity(string name, ActivityType type)
	{
		if (type == ActivityType.Custom)
		{
			this.Id = "custom";
			this.Name = "Custom Status";
			this.State = name;
		}
		else
			this.Name = name;

		this.ActivityType = type;
	}
```

Resolving patch:
diff --git a/discord/activity.py b/discord/activity.py
--- a/discord/activity.py
+++ b/discord/activity.py
@@ -160,7 +160,7 @@ class Activity(BaseActivity):
     type: :class:`ActivityType`
         The type of activity currently being done.
     state: Optional[:class:`str`]
-        The user's current state. For example, "In Game".
+        The user's current party status or text used for a custom status.
     details: Optional[:class:`str`]
         The detail of the user's current activity.
     timestamps: Dict[:class:`str`, :class:`int`]
@@ -229,7 +229,6 @@ def __init__(self, **kwargs):
         self.assets: ActivityAssets = kwargs.pop("assets", {})
         self.party: ActivityParty = kwargs.pop("party", {})
         self.application_id: int | None = _get_as_snowflake(kwargs, "application_id")
-        self.name: str | None = kwargs.pop("name", None)
         self.url: str | None = kwargs.pop("url", None)
         self.flags: int = kwargs.pop("flags", 0)
         self.sync_id: str | None = kwargs.pop("sync_id", None)
@@ -242,6 +241,9 @@ def __init__(self, **kwargs):
             if isinstance(activity_type, ActivityType)
             else try_enum(ActivityType, activity_type)
         )
+        self.name: str | None = kwargs.pop(
+            "name", "Custom Status" if self.type == ActivityType.custom else None
+        )
 
         emoji = kwargs.pop("emoji", None)
         self.emoji: PartialEmoji | None = (
@@ -252,6 +254,7 @@ def __repr__(self) -> str:
         attrs = (
             ("type", self.type),
             ("name", self.name),
+            ("state", self.state),
             ("url", self.url),
             ("details", self.details),
             ("application_id", self.application_id),
@@ -760,6 +763,8 @@ class CustomActivity(BaseActivity):
         The custom activity's name.
     emoji: Optional[:class:`PartialEmoji`]
         The emoji to pass to the activity, if any.
+    state: Optional[:class:`str`]
+        The text used for the custom activity.
     """
 
     __slots__ = ("name", "emoji", "state")
@@ -769,7 +774,7 @@ def __init__(
     ):
         super().__init__(**extra)
         self.name: str | None = name
-        self.state: str | None = extra.pop("state", None)
+        self.state: str | None = extra.pop("state", name)
         if self.name == "Custom Status":
             self.name = self.state
 


Test patch:
Repository: Pycord-Development/pycord

Issue:
After is set to id=0 even if you pass a value for after in https://docs.pycord.dev/en/stable/api/models.html#discord.Guild.audit_logs
### Summary

After is not updated to the value passed. This result in all audit log being fetch

### Reproduction Steps

1) Call audit_logs() with a value for after that is not the oldest entry id

### Minimal Reproducible Code

```python
object_id = discord.Object(id=any_audit_log_id)
async for entry in guild.audit_logs(after=object_id):
    pass
```


### Expected Results

Received only the entries after the value after

### Actual Results

Received all entry, even the ones before the value after specifed

### Intents

view_audit_log

### System Information

- Python v3.11.1-final
- py-cord-dev v2.5.None-candidate
    - py-cord-dev pkg_resources: v2.5.0rc5
- aiohttp v3.8.5
- system info: Windows 10 10.0.22631

### 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

Here is the inital question in discord help server: [inital question](https://discord.com/channels/881207955029110855/1132206148309749830/1186522479750029393)
Here is the problem in the code that I identified: [problem](https://discord.com/channels/881207955029110855/1132206148309749830/1186537206358229032)
Here is the potential solution: [solution](https://discord.com/channels/881207955029110855/1132206148309749830/1186541811683033168)


Discussion:
You could open a pull request directly if you found a solution already <3
> You could open a pull request directly if you found a solution already <3

~~But it's more github activity~~
I did not open a PR yet because I dont known yet the process of pycord (testing and all). Also it is late for me

Resolving patch:
diff --git a/discord/iterators.py b/discord/iterators.py
--- a/discord/iterators.py
+++ b/discord/iterators.py
@@ -430,7 +430,7 @@ def __init__(
         self.before = before
         self.user_id = user_id
         self.action_type = action_type
-        self.after = OLDEST_OBJECT
+        self.after = after or OLDEST_OBJECT
         self._users = {}
         self._state = guild._state
 


Test patch:
Repository: Pycord-Development/pycord

Issue:
AttributeError: 'Interaction' object has no attribute 'entitlements'
### Summary

The newest verision (2.4.1.dev241+g9683629e) crashes when executing slash commands

### Reproduction Steps

Start the bot code below and run the `hello` command


### Minimal Reproducible Code

```python
import discord

bot = discord.Bot()

@bot.slash_command()
async def hello(ctx):
    await ctx.respond("Hello!")

bot.run("")
```


### Expected Results

Bot responds with `Hello!`

### Actual Results

```
Traceback (most recent call last):
  File "C:\Users\Timo\Desktop\pythonProject\main.py", line 11, in <module>
    bot.run("...")
  File "C:\Users\Timo\AppData\Local\Programs\Python\Python312\Lib\site-packages\discord\client.py", line 766, in run
    return future.result()
           ^^^^^^^^^^^^^^^
  File "C:\Users\Timo\AppData\Local\Programs\Python\Python312\Lib\site-packages\discord\client.py", line 745, in runner
    await self.start(*args, **kwargs)
  File "C:\Users\Timo\AppData\Local\Programs\Python\Python312\Lib\site-packages\discord\client.py", line 709, in start
    await self.connect(reconnect=reconnect)
  File "C:\Users\Timo\AppData\Local\Programs\Python\Python312\Lib\site-packages\discord\client.py", line 601, in connect
    await self.ws.poll_event()
  File "C:\Users\Timo\AppData\Local\Programs\Python\Python312\Lib\site-packages\discord\gateway.py", line 604, in poll_event
    await self.received_message(msg.data)
  File "C:\Users\Timo\AppData\Local\Programs\Python\Python312\Lib\site-packages\discord\gateway.py", line 554, in received_message
    func(data)
  File "C:\Users\Timo\AppData\Local\Programs\Python\Python312\Lib\site-packages\discord\state.py", line 816, in parse_interaction_create
    interaction = Interaction(data=data, state=self)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Timo\AppData\Local\Programs\Python\Python312\Lib\site-packages\discord\interactions.py", line 170, in __init__
    self._from_data(data)
  File "C:\Users\Timo\AppData\Local\Programs\Python\Python312\Lib\site-packages\discord\interactions.py", line 187, in _from_data
    self.entitlements: list[Entitlement] = [
    ^^^^^^^^^^^^^^^^^
AttributeError: 'Interaction' object has no attribute 'entitlements'
```

### Intents

-

### System Information

- Python v3.10.9-final
- py-cord v2.4.1-final
- aiohttp v3.9.1
- system info: Windows 10 10.0.22631

### 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:
Cannot reproduce on 3.11.7, but reproducible on 3.12.1
Sounds fun, on it.

Resolving patch:
diff --git a/discord/interactions.py b/discord/interactions.py
--- a/discord/interactions.py
+++ b/discord/interactions.py
@@ -148,6 +148,7 @@ class Interaction:
         "token",
         "version",
         "custom_id",
+        "entitlements",
         "_channel_data",
         "_message_data",
         "_guild_data",


Test patch:
Repository: Pycord-Development/pycord

Issue:
Wrong Typehinting in ext/bridge/core.py
### Summary

Typehint is dict[str, bool] when it should just be bool

### Reproduction Steps

Look at [the code for has_permissions](https://github.com/Pycord-Development/pycord/blob/master/discord/ext/bridge/core.py#L528), realise the incorrect typehint

### Minimal Reproducible Code

_No response_

### Expected Results

It is typehinted as a bool

### Actual Results

It is typehinted as a dict[str, bool]

### Intents

all :)

### System Information

Every OS

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

URL: https://github.com/Pycord-Development/pycord/blob/master/discord/ext/bridge/core.py#L528


Discussion:
Note: This incorrect type is also referenced in the docs

Resolving patch:
diff --git a/discord/ext/bridge/core.py b/discord/ext/bridge/core.py
--- a/discord/ext/bridge/core.py
+++ b/discord/ext/bridge/core.py
@@ -525,7 +525,7 @@ def predicate(func: Callable | ApplicationCommand):
     return predicate
 
 
-def has_permissions(**perms: dict[str, bool]):
+def has_permissions(**perms: bool):
     r"""Intended to work with :class:`.SlashCommand` and :class:`BridgeCommand`, adds a
     :func:`~ext.commands.check` that locks the command to be run by people with certain
     permissions inside guilds, and also registers the command as locked behind said permissions.


Test patch:
Repository: Pycord-Development/pycord

Issue:
Voice Channel Status - Audit Logs
              We need the audit log events in another pull request to complete the voice channel status feature implementation

_Originally posted by @Lulalaby in https://github.com/Pycord-Development/pycord/issues/2368#issuecomment-1969255821_
            


Discussion:
@Pycord-Development/maintainers can someone work on this today <3 

Resolving patch:
diff --git a/discord/enums.py b/discord/enums.py
--- a/discord/enums.py
+++ b/discord/enums.py
@@ -439,6 +439,8 @@ class AuditLogAction(Enum):
     onboarding_update = 167
     server_guide_create = 190
     server_guide_update = 191
+    voice_channel_status_update = 192
+    voice_channel_status_delete = 193
 
     @property
     def category(self) -> AuditLogActionCategory | None:
@@ -506,6 +508,8 @@ def category(self) -> AuditLogActionCategory | None:
             AuditLogAction.onboarding_update: AuditLogActionCategory.update,
             AuditLogAction.server_guide_create: AuditLogActionCategory.create,
             AuditLogAction.server_guide_update: AuditLogActionCategory.update,
+            AuditLogAction.voice_channel_status_update: AuditLogActionCategory.update,
+            AuditLogAction.voice_channel_status_delete: AuditLogActionCategory.delete,
         }
         return lookup[self]
 
@@ -552,6 +556,8 @@ def target_type(self) -> str | None:
             return "onboarding"
         elif v < 192:
             return "server_guide"
+        elif v < 194:
+            return "voice_channel_status"
 
 
 class UserFlags(Enum):
diff --git a/discord/types/audit_log.py b/discord/types/audit_log.py
--- a/discord/types/audit_log.py
+++ b/discord/types/audit_log.py
@@ -112,6 +112,7 @@ class _AuditLogChange_Str(TypedDict):
         "deny",
         "permissions",
         "tags",
+        "status",
     ]
     new_value: str
     old_value: str
@@ -270,6 +271,8 @@ class AuditEntryInfo(TypedDict):
     application_id: Snowflake
     auto_moderation_rule_name: str
     auto_moderation_rule_trigger_type: str
+    # TODO: add integration_type
+    status: str
 
 
 class AuditLogEntry(TypedDict):


Test patch:
Repository: Pycord-Development/pycord

Issue:
Paginator author check
### Summary

Paginator.__init__() got an unexpected keyword argument 'user'

### Reproduction Steps

create a paginator, use the author_check function and edit the paginator

### Minimal Reproducible Code

```python
paginator = pages.Paginator(pages=pages, author_check=True, custom_view=View,  user=interaction.user​​ )​
await paginator.edit(interaction.message)
```


### Expected Results

It should just work as in the doc user is an attribute of pages.Paginator so we should be able to edit it like this because if we can't, author_check is useless, no user will never be able to interact since the user is the bot himself

### Actual Results

Paginator.__init__() got an unexpected keyword argument 'user'

### Intents

all

### System Information

- Python v3.11.4-final
- py-cord v2.5.None-final
- aiohttp v3.9.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:
You're misunderstanding; Paginator automatically assigns `self.user = ctx.author` from your first `paginator.send` or `respond` etc., so you don't need to define `user` - `author_check` will still work fine.
So you didnt understand something, if i add the paginator in the view and not at the biginning of a command, the ctx.author will be the bot and not the author of the command

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
@@ -29,6 +29,8 @@
 import discord
 from discord.ext.bridge import BridgeContext
 from discord.ext.commands import Context
+from discord.member import Member
+from discord.user import User
 
 __all__ = (
     "PaginatorButton",
@@ -1035,6 +1037,7 @@ async def edit(
         suppress: bool | None = None,
         allowed_mentions: discord.AllowedMentions | None = None,
         delete_after: float | None = None,
+        user: User | Member | None = None,
     ) -> discord.Message | None:
         """Edits an existing message to replace it with the paginator contents.
 
@@ -1060,6 +1063,8 @@ async def edit(
             are used instead.
         delete_after: Optional[:class:`float`]
             If set, deletes the paginator after the specified time.
+        user: Optional[Union[:class:`~discord.User`, :class:`~discord.Member`]]
+            If set, changes the user that this paginator belongs to.
 
         Returns
         -------
@@ -1079,7 +1084,7 @@ async def edit(
         if page_content.custom_view:
             self.update_custom_view(page_content.custom_view)
 
-        self.user = message.author
+        self.user = user or self.user
 
         try:
             self.message = await message.edit(


Test patch:
Repository: Pycord-Development/pycord

Issue:
Add event(once=True) to Cog.listener
### Summary

Adding the once variable to Cog listeners

### What is the feature request for?

discord.ext.commands

### The Problem

The `@commands.Cog.listen()` does not have the `once=True` variable to set.

### The Ideal Solution

Add the once variable to the decorator

### The Current Solution

_No response_

### Additional Context

This is tested on the latest github commit


Discussion:
The `_once` attribute is used for the normal event listeners but it can't be added to cog listeners because they're methods of a class. Once-listeners must be stored in some other way for this to be added.

Resolving patch:
diff --git a/discord/cog.py b/discord/cog.py
--- a/discord/cog.py
+++ b/discord/cog.py
@@ -379,7 +379,9 @@ def _get_overridden_method(cls, method: FuncT) -> FuncT | None:
         )
 
     @classmethod
-    def listener(cls, name: str = MISSING) -> Callable[[FuncT], FuncT]:
+    def listener(
+        cls, name: str = MISSING, once: bool = False
+    ) -> Callable[[FuncT], FuncT]:
         """A decorator that marks a function as a listener.
 
         This is the cog equivalent of :meth:`.Bot.listen`.
@@ -389,6 +391,9 @@ def listener(cls, name: str = MISSING) -> Callable[[FuncT], FuncT]:
         name: :class:`str`
             The name of the event being listened to. If not provided, it
             defaults to the function's name.
+        once: :class:`bool`
+            If this listener should only be called once after each cog load.
+            Defaults to false.
 
         Raises
         ------
@@ -411,6 +416,7 @@ def decorator(func: FuncT) -> FuncT:
                 raise TypeError("Listener function must be a coroutine function.")
             actual.__cog_listener__ = True
             to_assign = name or actual.__name__
+            actual._once = once
             try:
                 actual.__cog_listener_names__.append(to_assign)
             except AttributeError:


Test patch:
Repository: Pycord-Development/pycord

Issue:
Guild.search_members bug
              This shouldn't have been `Optional`, it doesn't support `None`.

_Originally posted by @Dorukyum in https://github.com/Pycord-Development/pycord/pull/2418#discussion_r1566871755_
            


Discussion:

Resolving patch:
diff --git a/discord/guild.py b/discord/guild.py
--- a/discord/guild.py
+++ b/discord/guild.py
@@ -2040,7 +2040,7 @@ async def search_members(self, query: str, *, limit: int = 1000) -> list[Member]
         ----------
         query: :class:`str`
             Searches for usernames and nicknames that start with this string, case-insensitive.
-        limit: Optional[:class:`int`]
+        limit: :class:`int`
             The maximum number of members to retrieve, up to 1000.
 
         Returns


Test patch: