Skip to content

Commit 5a859c6

Browse files
committed
add wiki command
1 parent f4be329 commit 5a859c6

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

intbot/core/bot/main.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,15 @@ async def source(ctx):
3030
)
3131

3232

33+
@bot.command()
34+
async def wiki(ctx):
35+
await ctx.send(
36+
"Please add it to the wiki: "
37+
"[ep2025-wiki.europython.eu](https://ep2025-wiki.europython.eu)",
38+
suppress_embeds=True,
39+
)
40+
41+
3342
@bot.command()
3443
async def version(ctx):
3544
app_version = settings.APP_VERSION

intbot/tests/test_bot.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
import pytest
88
from asgiref.sync import sync_to_async
9-
from core.bot.main import ping, poll_database, qlen, source, version
9+
from core.bot.main import ping, poll_database, qlen, source, version, wiki
1010
from core.models import DiscordMessage
1111
from django.utils import timezone
1212

@@ -84,6 +84,22 @@ async def test_ping_command():
8484
ctx.send.assert_called_once_with("Pong!")
8585

8686

87+
@pytest.mark.asyncio
88+
async def test_wiki_command():
89+
# Mock context
90+
ctx = AsyncMock()
91+
92+
# Call the command
93+
await wiki(ctx)
94+
95+
# Assert that the command sent the expected message
96+
ctx.send.assert_called_once_with(
97+
"Please add it to the wiki: "
98+
"[ep2025-wiki.europython.eu](https://ep2025-wiki.europython.eu)",
99+
suppress_embeds=True,
100+
)
101+
102+
87103
@pytest.mark.asyncio
88104
async def test_version_command():
89105
# Mock context

0 commit comments

Comments
 (0)