10000 Allow close command to be called in any channel (#20) · EuroPython/internal-bot@64bcafd · GitHub
[go: up one dir, main page]

Skip to content

Commit 64bcafd

Browse files
authored
Allow close command to be called in any channel (#20)
This also removed an unnecesary mock from the test
1 parent ab6e005 commit 64bcafd

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

intbot/core/bot/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@ async def wiki(ctx):
4141
@bot.command()
4242
async def close(ctx):
4343
channel = ctx.channel
44-
parent = channel.parent
4544
author = ctx.message.author
4645

4746
# Check if it's a public or private post (thread)
4847
if channel.type in (discord.ChannelType.public_thread, discord.ChannelType.private_thread):
48+
parent = channel.parent
4949

5050
# Check if the post (thread) was sent in a forum,
5151
# so we can add a tag

intbot/tests/test_bot/test_main.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ async def test_close_command_notworking():
123123
# Mock context
124124
ctx = AsyncMock()
125125
ctx.channel = AsyncMock()
126-
ctx.message.author = AsyncMock()
127126

128127
# Call the command
129128
await close(ctx)

0 commit comments

Comments
 (0)
0