Skip to content
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
25 changes: 19 additions & 6 deletions techsupport_bot/commands/burn.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,27 +83,40 @@ async def burn_command(
ctx (commands.Context): The context in which the command was run
user_to_match (discord.Member): The user in which to burn
"""
prefix = await self.bot.get_prefix(ctx.message)
message = await auxiliary.search_channel_for_message(
channel=ctx.channel, prefix=prefix, member_to_match=user_to_match
)
if ctx.message.reference is None:
prefix = await self.bot.get_prefix(ctx.message)
message = await auxiliary.search_channel_for_message(
channel=ctx.channel, prefix=prefix, member_to_match=user_to_match
)
else:
message = ctx.message.reference.resolved

await self.handle_burn(ctx, user_to_match, message)

@auxiliary.with_typing
@commands.guild_only()
@commands.command(
brief="Declares a BURN!",
description="Declares the user's last message as a BURN!",
description="Declares mentioned user's message as a BURN!",
usage="@user",
)
async def burn(
self: Self, ctx: commands.Context, user_to_match: discord.Member
self: Self, ctx: commands.Context, user_to_match: discord.Member = None
) -> None:
"""The only purpose of this function is to accept input from discord

Args:
ctx (commands.Context): The context in which the command was run
user_to_match (discord.Member): The user in which to burn
"""
if user_to_match is None:
if ctx.message.reference is None:
await auxiliary.send_deny_embed(
message="You need to mention someone to declare a burn.",
channel=ctx.channel,
)
return

user_to_match = ctx.message.reference.resolved.author

await self.burn_command(ctx, user_to_match)
6 changes: 0 additions & 6 deletions techsupport_bot/commands/modmail.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ async def on_message_edit(
isinstance(before.channel, discord.DMChannel)
and before.author.id in active_threads
):

if await Ts_client.models.ModmailBan.query.where(
Ts_client.models.ModmailBan.user_id == str(before.author.id)
).gino.first():
Expand Down Expand Up @@ -452,7 +451,6 @@ async def create_thread(
if not thread.name.startswith("[OPEN]") and thread.name.split("|")[
-1
].strip() == str(user.id):

past_thread_count += 1

if past_thread_count == 0:
Expand Down Expand Up @@ -1197,7 +1195,6 @@ async def contact(self: Self, ctx: commands.Context, user: discord.User) -> None
)

case ui.ConfirmResponse.CONFIRMED:

# Makes sure the user can reply if they were timed out from creating threads
if user.id in delayed_people:
del delayed_people[user.id]
Expand All @@ -1207,7 +1204,6 @@ async def contact(self: Self, ctx: commands.Context, user: discord.User) -> None
user=user,
source_channel=ctx.channel,
):

await auxiliary.send_confirm_embed(
message="Thread successfully created!", channel=ctx.channel
)
Expand Down Expand Up @@ -1259,7 +1255,6 @@ async def selfcontact(self: Self, ctx: commands.Context) -> None:
)

case ui.ConfirmResponse.CONFIRMED:

# Makes sure the user can reply if they were timed out from creating threads
if ctx.author in delayed_people:
del delayed_people[ctx.author.id]
Expand All @@ -1269,7 +1264,6 @@ async def selfcontact(self: Self, ctx: commands.Context) -> None:
user=ctx.author,
source_channel=ctx.channel,
):

await auxiliary.send_confirm_embed(
message="Thread successfully created!", channel=ctx.channel
)
Expand Down
166 changes: 0 additions & 166 deletions techsupport_bot/tests/commands_tests/test_extensions_burn.py

This file was deleted.

Loading