Skip to content

Abfangen und Fehler anzeigen, wenn Kategorie voll

In einer Kategorie können (derzeit) maximal 50 Channel sein. Auch wenn das in Zukunft hoffentlich nicht mehr passiert, sollte Boty dennoch eine Rückmeldung geben, anstatt dass die Interaction fehlschlägt.

Ignoring exception in on_button_click
Traceback (most recent call last):
  File "/home/fernuni-bot/fernuni-bot/venv/lib/python3.10/site-packages/disnake/client.py", line 612, in _run_event
    await coro(*args, **kwargs)
  File "/home/fernuni-bot/fernuni-bot/cogs/learninggroups.py", line 83, in on_button_click
    await self.on_group_request(True, button, interaction)
  File "/home/fernuni-bot/fernuni-bot/cogs/learninggroups.py", line 981, in on_group_request
    await self.add_requested_group_channel(message, direct=False)
  File "/home/fernuni-bot/fernuni-bot/cogs/learninggroups.py", line 326, in add_requested_group_channel
    channel = await category.create_text_channel(full_channel_name)
  File "/home/fernuni-bot/fernuni-bot/venv/lib/python3.10/site-packages/disnake/channel.py", line 2123, in create_text_channel
    return await self.guild.create_text_channel(name, category=self, **options)
  File "/home/fernuni-bot/fernuni-bot/venv/lib/python3.10/site-packages/disnake/guild.py", line 1304, in create_text_channel
    data = await self._create_channel(
  File "/home/fernuni-bot/fernuni-bot/venv/lib/python3.10/site-packages/disnake/http.py", line 442, in request
    raise HTTPException(response, data)
disnake.errors.HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body
In parent_id: Maximum number of channels in category reached (50)