-
-
Notifications
You must be signed in to change notification settings - Fork 465
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: ✨ Add MediaChannel
and fix ForumChannel
flags
#2641
base: master
Are you sure you want to change the base?
feat: ✨ Add MediaChannel
and fix ForumChannel
flags
#2641
Conversation
MediaChannel
MediaChannel
and fix ForumChannel
flags
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not entirely sure but afaik I the channel class you also have a model for the base type which has type: literal channel type blah. Is that perhaps missing?
@property
def type(self) -> ChannelType:
"""The channel's Discord type."""
return try_enum(ChannelType, self._type) |
It's redundant if the classes inherit from _TextChannel. |
0d73cf7
to
bb8bc7b
Compare
Undid it then |
discord/abc.py
Outdated
if options.get("flags") and not isinstance( | ||
options["flags"], int | ||
): # it shouldn't be an int but just in case | ||
options["flags"] = options["flags"].value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
options["flags"]
shouldn't ever be an integer
if options.get("flags") and not isinstance( | |
options["flags"], int | |
): # it shouldn't be an int but just in case | |
options["flags"] = options["flags"].value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where should it be made into an integer then ? I'm unsure. Because it needs to be sent as an integer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant that it can't be an int at this point but yes it should be converted. See other conversions below
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I should only remove the isinstance
check here ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated the code with a try-except block to match the other options, haven't tested.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll test tomorrow asap
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't have time to test :/ but will do asap
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does work, I replaced it with contextlib.suppress
but if you prefer try:
except: pass
I can revert the last commit.
6b274da
to
38b5f3e
Compare
Signed-off-by: Dorukyum <[email protected]>
c2a9853
to
0b3f756
Compare
|
||
@property | ||
def hides_media_download_options(self) -> bool: | ||
"""Whether media download options are be hidden in this media channel.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"""Whether media download options are be hidden in this media channel.""" | |
"""Whether media download options are hidden in this media channel.""" |
what
default_reaction_emoji: Optional[:class:`discord.GuildEmoji` | :class:`int` | :class:`str`] | ||
The default reaction emoji. | ||
Can be a unicode emoji or a custom emoji in the forms: | ||
:class:`GuildEmoji`, snowflake ID, string representation (eg. '<a:emoji_name:emoji_id>'). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:class:`GuildEmoji`, snowflake ID, string representation (eg. '<a:emoji_name:emoji_id>'). | |
:class:`GuildEmoji`, snowflake ID, string representation (e.g., '<a:emoji_name:emoji_id>'). |
Summary
Fix #2637
Fix #2640
Information
examples, ...).
Checklist
type: ignore
comments were used, a comment is also left explaining why.