feat(bot): ✨ Move background tasks to separate image.

This commit is contained in:
Nyeki.py
2024-11-01 01:52:53 -03:00
parent cd578e43bd
commit 3c7d9e193c
11 changed files with 71 additions and 32 deletions
-20
View File
@@ -238,11 +238,6 @@ class Calls(base.Cog):
f"**TIP**: {secrets.choice(constants.TIPS).replace("{prefix}", ctx.clean_prefix)}\n"
f"☎️ {secrets.choice(constants.MSGS_PHONE_CALLING)}\n"
)
+ (
"⚠️ The phone will be hung up soon due to a scheduled restart.\n"
if self.bot.scheduled_shutdown.value
else ""
)
+ msg_phone_answered
)
@@ -254,11 +249,6 @@ class Calls(base.Cog):
f"**TIP**: {secrets.choice(constants.TIPS).replace("{prefix}", ctx.clean_prefix)}\n"
f"☎️ {secrets.choice(constants.MSGS_PHONE_CALLING)}\n"
)
+ (
"⚠️ The phone will be hung up soon due to a scheduled restart.\n"
if self.bot.scheduled_shutdown.value
else ""
)
)
@commands.command(aliases=["s"])
@@ -436,11 +426,6 @@ class Calls(base.Cog):
f"**TIP**: {secrets.choice(constants.TIPS).replace("{prefix}", ctx.clean_prefix)}\n"
f"☎️ You skipped the call.\n"
)
+ (
"⚠️ The phone will be hung up soon due to a scheduled restart.\n"
if self.bot.scheduled_shutdown.value
else ""
)
+ (
msg_phone_answered
if msg_phone_answered
@@ -460,11 +445,6 @@ class Calls(base.Cog):
f"☎️ You skipped the call.\n"
f"☎️ {secrets.choice(constants.MSGS_PHONE_CALLING)}\n"
)
+ (
"⚠️ The phone will be hung up soon due to a scheduled restart.\n"
if self.bot.scheduled_shutdown.value
else ""
)
)
@commands.command(aliases=["hang", "h"], extras={"help_name": "Hang Up"})
+1 -5
View File
@@ -242,8 +242,6 @@ class Mods(base.Cog):
- `[<reason>]`: The reason of the shutdown.
"""
self.bot.scheduled_shutdown.value = True
if seconds > 0:
oncall_channel_ids = list(
await self.bot.redis.smembers(constants.CHANNELS_ONCALL_SET)
@@ -321,9 +319,7 @@ class Mods(base.Cog):
await flush_messages.flush()
await ctx.send("⚡ Messages were flushed, payphone will shut down.")
self.bot.shutdown.value = True
await ctx.send("⚡ Messages were flushed, payphone is ready to shut down.")
@commands.command()
@commands.is_owner()
+1 -1
View File
@@ -35,6 +35,6 @@ TORTOISE_ORM = {
},
}
SUGGESTIONS_CHANNEL_ID = int(os.getenv("SUGGESTIONS_CHANNEL_ID"))
SUGGESTIONS_CHANNEL_ID = int(os.getenv("SUGGESTIONS_CHANNEL_ID", "0"))
SERVER_INVITE = os.getenv("SERVER_INVITE")