Skip to content

Commit 1069417

Browse files
authored
Merge pull request #9 from EnderModuBot/bug/send_message-dont-work-end
fix: replaced `None` with `MISSING` from `discord.utils`
2 parents 9c252b3 + c214512 commit 1069417

2 files changed

Lines changed: 10 additions & 9 deletions

File tree

ModuBotDiscord/commands/__init__.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22
import logging
33
import warnings
44
from abc import ABC, abstractmethod
5-
from typing import Awaitable, Callable, List, Optional, TypeVar
5+
from typing import Awaitable, Callable, List, Optional, TypeVar, Union
66

77
import discord
88
from discord import Embed, Interaction
9+
from discord.utils import MISSING, _MissingSentinel
910
from ModuBotDiscord.config import DiscordConfig
1011

1112
from ..enums import PermissionEnum
@@ -20,18 +21,18 @@ async def send_message(
2021
content: Optional[str] = None,
2122
msg: Optional[str] = None,
2223
*,
23-
embed: Optional[Embed] = None,
24-
embeds: Optional[List[Embed]] = None,
25-
file: Optional[discord.File] = None,
26-
files: Optional[List[discord.File]] = None,
27-
view: Optional[discord.ui.View] = None,
24+
embed: Union[Embed, _MissingSentinel] = MISSING,
25+
embeds: Union[List[Embed], _MissingSentinel] = MISSING,
26+
file: Union[discord.File, _MissingSentinel] = MISSING,
27+
files: Union[List[discord.File], _MissingSentinel] = MISSING,
28+
view: Union[discord.ui.View, _MissingSentinel] = MISSING,
2829
tts: bool = False,
2930
ephemeral: bool = False,
30-
allowed_mentions: Optional[discord.AllowedMentions] = None,
31+
allowed_mentions: Union[discord.AllowedMentions, _MissingSentinel] = MISSING,
3132
suppress_embeds: bool = False,
3233
silent: bool = False,
3334
delete_after: Optional[float] = None,
34-
poll=None,
35+
poll: Union[discord.Poll, _MissingSentinel] = MISSING,
3536
) -> None:
3637
if msg is not None:
3738
warnings.warn(

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "ModuBotDiscord"
3-
version = "0.3.1"
3+
version = "0.3.2"
44
description = "Modular Discord bot framework built on top of ModuBotCore"
55
authors = [{ name = "Endkind", email = "endkind.ender@endkind.net" }]
66
readme = "README.md"

0 commit comments

Comments
 (0)