From c214512206314edc29c5280b24f7fb2c8fd87b40 Mon Sep 17 00:00:00 2001 From: Endkind Date: Wed, 2 Jul 2025 11:41:40 +0200 Subject: [PATCH] fix: replaced `None` with `MISSING` from `discord.utils` --- ModuBotDiscord/commands/__init__.py | 17 +++++++++-------- pyproject.toml | 2 +- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/ModuBotDiscord/commands/__init__.py b/ModuBotDiscord/commands/__init__.py index bda4ae3..b3415cc 100644 --- a/ModuBotDiscord/commands/__init__.py +++ b/ModuBotDiscord/commands/__init__.py @@ -2,10 +2,11 @@ import logging import warnings from abc import ABC, abstractmethod -from typing import Awaitable, Callable, List, Optional, TypeVar +from typing import Awaitable, Callable, List, Optional, TypeVar, Union import discord from discord import Embed, Interaction +from discord.utils import MISSING, _MissingSentinel from ModuBotDiscord.config import DiscordConfig from ..enums import PermissionEnum @@ -20,18 +21,18 @@ async def send_message( content: Optional[str] = None, msg: Optional[str] = None, *, - embed: Optional[Embed] = None, - embeds: Optional[List[Embed]] = None, - file: Optional[discord.File] = None, - files: Optional[List[discord.File]] = None, - view: Optional[discord.ui.View] = None, + embed: Union[Embed, _MissingSentinel] = MISSING, + embeds: Union[List[Embed], _MissingSentinel] = MISSING, + file: Union[discord.File, _MissingSentinel] = MISSING, + files: Union[List[discord.File], _MissingSentinel] = MISSING, + view: Union[discord.ui.View, _MissingSentinel] = MISSING, tts: bool = False, ephemeral: bool = False, - allowed_mentions: Optional[discord.AllowedMentions] = None, + allowed_mentions: Union[discord.AllowedMentions, _MissingSentinel] = MISSING, suppress_embeds: bool = False, silent: bool = False, delete_after: Optional[float] = None, - poll=None, + poll: Union[discord.Poll, _MissingSentinel] = MISSING, ) -> None: if msg is not None: warnings.warn( diff --git a/pyproject.toml b/pyproject.toml index e752539..86779d1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "ModuBotDiscord" -version = "0.3.1" +version = "0.3.2" description = "Modular Discord bot framework built on top of ModuBotCore" authors = [{ name = "Endkind", email = "endkind.ender@endkind.net" }] readme = "README.md"