Repository: Pycord-Development/pycord

Issue:
Paginator is replaced by second paginator upon using commands consecutively
### Summary

Essentially, if you use a command with a paginator utilizing page groups once, then use the same command with a different option after to produce a different paginator, the second paginator will replace the first in the first commnad.

### Reproduction Steps

**This bug does not occur if you defer before sending the paginator.**

For this to work, you need a command utilizing page groups, and the command needs to have an argument that produces a different paginator depending on the option selected. 

To reproduce, simply use the command twice consecutively, the first time with the first option, and the second time with the second option. 

After doing this, two scenarios are possible, depending on whether or not the second paginator's page groups are named differently than the first.

**Scenario 1, the page groups for the second command are named differently:**
In this case, attempting to use the select menu on the first command will fail silently with "this interaction failed". If you then use the first command's buttons (not select menu), they will function properly,  but the embeds will be updated as if you were using the second command. Furthermore, the select menu will now be updated to reflect the page group names of the second command, and it will no longer silently fail. The content and view of the first command is now entirely overwritten and identical to the second command.
**Scenario 2, the page groups for the second command are named the same:**
In this case, the select menu will never silently fail like in the first scenario,  but everything else will be the same as scenario 1. The first command's pages will have been completely replaced by the second command's pages.

See the following video for scenario 1 in action:
https://user-images.githubusercontent.com/56235026/163677172-a7b2a0f3-462d-4c37-9e9c-7326d67080a6.mp4


### Minimal Reproducible Code

```python
import discord
from discord.ext import pages
bot = discord.Bot()


@bot.slash_command()
async def testing(ctx, option: bool):
    page_groups_option_1 = [
        pages.PageGroup(label="Group 1", pages=[discord.Embed(title="A"), discord.Embed(title="B")], description=""),
        pages.PageGroup(label="Group 2", pages=[discord.Embed(title="C"), discord.Embed(title="D")], description="")
    ]
    page_groups_option_2 = [
        pages.PageGroup(label="Group 3", pages=[discord.Embed(title="E"), discord.Embed(title="F")], description=""),
        pages.PageGroup(label="Group 4", pages=[discord.Embed(title="G"), discord.Embed(title="H")], description="")
    ]

    if option:
        paginator = pages.Paginator(pages=page_groups_option_1, show_menu=True)
    else:
        paginator = pages.Paginator(pages=page_groups_option_2, show_menu=True)

    await paginator.respond(ctx.interaction)

bot.run("TOKEN")
```


### Expected Results

The command instances are totally independent of each other, and they do not overwrite each other.

### Actual Results

The second command's paginator overwrites the first command's paginator. 

### Intents

None

### System Information

- Python v3.10.1-final
- py-cord v2.0.0-beta
    - py-cord pkg_resources: v2.0.0b7
- aiohttp v3.8.1
- 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_
Paginator is replaced by second paginator upon using commands consecutively
### Summary

Essentially, if you use a command with a paginator utilizing page groups once, then use the same command with a different option after to produce a different paginator, the second paginator will replace the first in the first commnad.

### Reproduction Steps

**This bug does not occur if you defer before sending the paginator.**

For this to work, you need a command utilizing page groups, and the command needs to have an argument that produces a different paginator depending on the option selected. 

To reproduce, simply use the command twice consecutively, the first time with the first option, and the second time with the second option. 

After doing this, two scenarios are possible, depending on whether or not the second paginator's page groups are named differently than the first.

**Scenario 1, the page groups for the second command are named differently:**
In this case, attempting to use the select menu on the first command will fail silently with "this interaction failed". If you then use the first command's buttons (not select menu), they will function properly,  but the embeds will be updated as if you were using the second command. Furthermore, the select menu will now be updated to reflect the page group names of the second command, and it will no longer silently fail. The content and view of the first command is now entirely overwritten and identical to the second command.
**Scenario 2, the page groups for the second command are named the same:**
In this case, the select menu will never silently fail like in the first scenario,  but everything else will be the same as scenario 1. The first command's pages will have been completely replaced by the second command's pages.

See the following video for scenario 1 in action:
https://user-images.githubusercontent.com/56235026/163677172-a7b2a0f3-462d-4c37-9e9c-7326d67080a6.mp4


### Minimal Reproducible Code

```python
import discord
from discord.ext import pages
bot = discord.Bot()


@bot.slash_command()
async def testing(ctx, option: bool):
    page_groups_option_1 = [
        pages.PageGroup(label="Group 1", pages=[discord.Embed(title="A"), discord.Embed(title="B")], description=""),
        pages.PageGroup(label="Group 2", pages=[discord.Embed(title="C"), discord.Embed(title="D")], description="")
    ]
    page_groups_option_2 = [
        pages.PageGroup(label="Group 3", pages=[discord.Embed(title="E"), discord.Embed(title="F")], description=""),
        pages.PageGroup(label="Group 4", pages=[discord.Embed(title="G"), discord.Embed(title="H")], description="")
    ]

    if option:
        paginator = pages.Paginator(pages=page_groups_option_1, show_menu=True)
    else:
        paginator = pages.Paginator(pages=page_groups_option_2, show_menu=True)

    await paginator.respond(ctx.interaction)

bot.run("TOKEN")
```


### Expected Results

The command instances are totally independent of each other, and they do not overwrite each other.

### Actual Results

The second command's paginator overwrites the first command's paginator. 

### Intents

None

### System Information

- Python v3.10.1-final
- py-cord v2.0.0-beta
    - py-cord pkg_resources: v2.0.0b7
- aiohttp v3.8.1
- 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:

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
@@ -578,7 +578,7 @@ async def interaction_check(self, interaction: discord.Interaction) -> bool:
 
     def add_menu(self):
         """Adds the default :class:`PaginatorMenu` instance to the paginator."""
-        self.menu = PaginatorMenu(self.page_groups, placeholder=self.menu_placeholder, custom_id="pages_group_menu")
+        self.menu = PaginatorMenu(self.page_groups, placeholder=self.menu_placeholder)
         self.menu.paginator = self
         self.add_item(self.menu)
 


Test patch: