Skip to content

Commit 9bc81dd

Browse files
authored
Merge branch 'main' into FixLoggerWarn
2 parents 8fcd488 + 2a955d1 commit 9bc81dd

6 files changed

Lines changed: 22 additions & 181 deletions

File tree

default.env

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
POSTGRES_DB_NAME=
22
POSTGRES_DB_PASSWORD=
33
POSTGRES_DB_USER=
4-
DEBUG=
4+
DEBUG=0
5+
CONFIG_YML=./config.yml

techsupport_bot/bot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class TechSupportBot(commands.Bot):
4747
FUNCTIONS_DIR (str):The list of all files in the FUNCTIONS_DIR_NAME folder
4848
"""
4949

50-
CONFIG_PATH: str = "./config.yml"
50+
CONFIG_PATH: str = os.environ.get("CONFIG_YML", "./config.yml")
5151
EXTENSIONS_DIR_NAME: str = "commands"
5252
EXTENSIONS_DIR: str = (
5353
f"{os.path.join(os.path.dirname(__file__))}/{EXTENSIONS_DIR_NAME}"

techsupport_bot/commands/burn.py

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,27 +83,40 @@ async def burn_command(
8383
ctx (commands.Context): The context in which the command was run
8484
user_to_match (discord.Member): The user in which to burn
8585
"""
86-
prefix = await self.bot.get_prefix(ctx.message)
87-
message = await auxiliary.search_channel_for_message(
88-
channel=ctx.channel, prefix=prefix, member_to_match=user_to_match
89-
)
86+
if ctx.message.reference is None:
87+
prefix = await self.bot.get_prefix(ctx.message)
88+
message = await auxiliary.search_channel_for_message(
89+
channel=ctx.channel, prefix=prefix, member_to_match=user_to_match
90+
)
91+
else:
92+
message = ctx.message.reference.resolved
9093

9194
await self.handle_burn(ctx, user_to_match, message)
9295

9396
@auxiliary.with_typing
9497
@commands.guild_only()
9598
@commands.command(
9699
brief="Declares a BURN!",
97-
description="Declares the user's last message as a BURN!",
100+
description="Declares mentioned user's message as a BURN!",
98101
usage="@user",
99102
)
100103
async def burn(
101-
self: Self, ctx: commands.Context, user_to_match: discord.Member
104+
self: Self, ctx: commands.Context, user_to_match: discord.Member = None
102105
) -> None:
103106
"""The only purpose of this function is to accept input from discord
104107
105108
Args:
106109
ctx (commands.Context): The context in which the command was run
107110
user_to_match (discord.Member): The user in which to burn
108111
"""
112+
if user_to_match is None:
113+
if ctx.message.reference is None:
114+
await auxiliary.send_deny_embed(
115+
message="You need to mention someone to declare a burn.",
116+
channel=ctx.channel,
117+
)
118+
return
119+
120+
user_to_match = ctx.message.reference.resolved.author
121+
109122
await self.burn_command(ctx, user_to_match)

techsupport_bot/commands/htd.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,6 @@ def custom_embed_generation(raw_input: str, val_to_convert: int) -> discord.Embe
235235
inline=False,
236236
)
237237

238-
print(embed.fields[0].name)
239238
return embed
240239

241240

techsupport_bot/commands/modmail.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,6 @@ async def on_message_edit(
153153
isinstance(before.channel, discord.DMChannel)
154154
and before.author.id in active_threads
155155
):
156-
157156
if await Ts_client.models.ModmailBan.query.where(
158157
Ts_client.models.ModmailBan.user_id == str(before.author.id)
159158
).gino.first():
@@ -452,7 +451,6 @@ async def create_thread(
452451
if not thread.name.startswith("[OPEN]") and thread.name.split("|")[
453452
-1
454453
].strip() == str(user.id):
455-
456454
past_thread_count += 1
457455

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

11991197
case ui.ConfirmResponse.CONFIRMED:
1200-
12011198
# Makes sure the user can reply if they were timed out from creating threads
12021199
if user.id in delayed_people:
12031200
del delayed_people[user.id]
@@ -1207,7 +1204,6 @@ async def contact(self: Self, ctx: commands.Context, user: discord.User) -> None
12071204
user=user,
12081205
source_channel=ctx.channel,
12091206
):
1210-
12111207
await auxiliary.send_confirm_embed(
12121208
message="Thread successfully created!", channel=ctx.channel
12131209
)
@@ -1259,7 +1255,6 @@ async def selfcontact(self: Self, ctx: commands.Context) -> None:
12591255
)
12601256

12611257
case ui.ConfirmResponse.CONFIRMED:
1262-
12631258
# Makes sure the user can reply if they were timed out from creating threads
12641259
if ctx.author in delayed_people:
12651260
del delayed_people[ctx.author.id]
@@ -1269,7 +1264,6 @@ async def selfcontact(self: Self, ctx: commands.Context) -> None:
12691264
user=ctx.author,
12701265
source_channel=ctx.channel,
12711266
):
1272-
12731267
await auxiliary.send_confirm_embed(
12741268
message="Thread successfully created!", channel=ctx.channel
12751269
)

techsupport_bot/tests/commands_tests/test_extensions_burn.py

Lines changed: 0 additions & 166 deletions
This file was deleted.

0 commit comments

Comments
 (0)