From 7830dd616588fa8b0f833ee1b96776e84050c90c Mon Sep 17 00:00:00 2001 From: grey-cat-1908 Date: Sun, 5 Jun 2022 21:01:53 +0300 Subject: [PATCH] feat(interactions): add ApplicationCommandTypes enum --- melisa/models/guild/guild.py | 1 + melisa/models/guild/member.py | 6 +++++- melisa/models/interactions/__init__.py | 9 +++++++++ melisa/models/interactions/commands.py | 27 ++++++++++++++++++++++++++ 4 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 melisa/models/interactions/__init__.py create mode 100644 melisa/models/interactions/commands.py diff --git a/melisa/models/guild/guild.py b/melisa/models/guild/guild.py index e9d3fdf..f0af6c3 100644 --- a/melisa/models/guild/guild.py +++ b/melisa/models/guild/guild.py @@ -622,6 +622,7 @@ class Guild(APIModelBase): await self._client.rest.remove_guild_ban(self.id, user_id, reason=reason) + @dataclass(repr=False) class UnavailableGuild(APIModelBase): """A partial guild object. diff --git a/melisa/models/guild/member.py b/melisa/models/guild/member.py index 07a15c6..6b0e68e 100644 --- a/melisa/models/guild/member.py +++ b/melisa/models/guild/member.py @@ -316,5 +316,9 @@ class GuildMember(APIModelBase): return self.user.avatar_url() return self._client.rest.cdn.guild_member_avatar_url( - self.guild_id, self.user.id, self.guild_avatar, size=size, image_format=image_format + self.guild_id, + self.user.id, + self.guild_avatar, + size=size, + image_format=image_format, ) diff --git a/melisa/models/interactions/__init__.py b/melisa/models/interactions/__init__.py new file mode 100644 index 0000000..75a0c0e --- /dev/null +++ b/melisa/models/interactions/__init__.py @@ -0,0 +1,9 @@ +# Copyright MelisaDev 2022 - Present +# Full MIT License can be found in `LICENSE.txt` at the project root. + +from .commands import ApplicationCommandTypes + + +__all__ = ( + "ApplicationCommandTypes" +) diff --git a/melisa/models/interactions/commands.py b/melisa/models/interactions/commands.py new file mode 100644 index 0000000..bc7742e --- /dev/null +++ b/melisa/models/interactions/commands.py @@ -0,0 +1,27 @@ +# Copyright MelisaDev 2022 - Present +# Full MIT License can be found in `LICENSE.txt` at the project root. + +from __future__ import annotations + +from enum import IntEnum + + +class ApplicationCommandTypes(IntEnum): + """Application Command Types + + Attributes + ---------- + CHAT_INPUT: + Slash commands; a text-based command that shows up when a user types / + USER: + A UI-based command that shows up when you right click or tap on a user + MESSAGE: + A UI-based command that shows up when you right click or tap on a message + """ + + CHAT_INPUT = 1 + USER = 2 + MESSAGE = 3 + + def __int__(self): + return self.value