Skip to content

Refactor send_message() and send_error() #8

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

Merged
merged 1 commit into from
Jul 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions ModuBotDiscord/commands/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@

async def send_message(
interaction: Interaction,
msg: Optional[str] = None,
content: Optional[str] = None,
msg: Optional[str] = None,
*,
embed: Optional[Embed] = None,
embeds: Optional[List[Embed]] = None,
Expand All @@ -33,13 +33,15 @@ async def send_message(
delete_after: Optional[float] = None,
poll=None,
) -> None:
if content is None and msg is not None:
if msg is not None:
warnings.warn(
"`msg` is deprecated, use `content` instead",
DeprecationWarning,
stacklevel=2,
)
content = msg

if content is None:
content = msg

if not interaction.is_expired():
if not interaction.response.is_done():
Expand Down Expand Up @@ -80,9 +82,9 @@ async def send_message(

async def send_error(
interaction: Interaction,
msg: Optional[str] = None,
title: str = "⚠️ An error occurred",
description: Optional[str] = None,
msg: Optional[str] = None,
) -> None:
if msg is not None:
warnings.warn(
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "ModuBotDiscord"
version = "0.3.0"
version = "0.3.1"
description = "Modular Discord bot framework built on top of ModuBotCore"
authors = [{ name = "Endkind", email = "[email protected]" }]
readme = "README.md"
Expand Down
Loading