Skip to content

ForumTag cannot be created without setting an emoji #3244

@Paillat-dev

Description

@Paillat-dev

Summary

ForumTag cannot be created without setting an emoji even though this is allowed by the API.

Reproduction Steps

  1. Run discord.ForumTag(name="foo", emoji=None)
  2. See the error.

Minimal Reproducible Code

import discord

discord.ForumTag(name="foo", emoji=None)

Expected Results

The code should exist normally.

Actual Results

Traceback (most recent call last):
  File "<python-input-1>", line 1, in <module>
    discord.ForumTag(name="foo", emoji=None)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\jerem\Documents\pycord\pycord\discord\channel.py", line 169, in __init__
    raise TypeError(
    ...<2 lines>...
    )
TypeError: emoji must be a GuildEmoji, PartialEmoji, or str and not <class 'NoneType'>

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

The discord docs mention:

At most one of emoji_id and emoji_name may be set to a non-null value.

https://docs.discord.com/developers/resources/channel#forum-tag-object

This does not mean however that either of them should always be set. Both should be allowed to be null.

Metadata

Metadata

Assignees

No one assigned

    Labels

    unconfirmed bugA bug report that needs triaging

    Type

    No fields configured for Bug.

    Projects

    Status
    In Progress

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions