feat(bot): ✨ Shut down directly on p.shutdown 0.
This commit is contained in:
@@ -245,6 +245,7 @@ class Mods(base.Cog):
|
|||||||
|
|
||||||
self.bot.scheduled_shutdown.value = True
|
self.bot.scheduled_shutdown.value = True
|
||||||
|
|
||||||
|
if seconds > 0:
|
||||||
oncall_channel_ids = list(
|
oncall_channel_ids = list(
|
||||||
await self.bot.redis.smembers(constants.CHANNELS_ONCALL_SET)
|
await self.bot.redis.smembers(constants.CHANNELS_ONCALL_SET)
|
||||||
)
|
)
|
||||||
@@ -256,7 +257,9 @@ class Mods(base.Cog):
|
|||||||
int(c) for c in searching_channel_ids
|
int(c) for c in searching_channel_ids
|
||||||
]
|
]
|
||||||
|
|
||||||
await ctx.send(f"⚡ Notifying `{len(channel_ids)}` channels of the shutdown.")
|
await ctx.send(
|
||||||
|
f"⚡ Notifying `{len(channel_ids)}` channels of the shutdown."
|
||||||
|
)
|
||||||
|
|
||||||
for channel_id in channel_ids:
|
for channel_id in channel_ids:
|
||||||
try:
|
try:
|
||||||
@@ -302,7 +305,7 @@ class Mods(base.Cog):
|
|||||||
|
|
||||||
await self.bot.change_presence(
|
await self.bot.change_presence(
|
||||||
activity=discord.CustomActivity(name="Payphone is restarting."),
|
activity=discord.CustomActivity(name="Payphone is restarting."),
|
||||||
status=discord.Status.do_not_disturb
|
status=discord.Status.do_not_disturb,
|
||||||
)
|
)
|
||||||
|
|
||||||
await self.bot.redis.delete(constants.CHANNELS_ONCALL_SET)
|
await self.bot.redis.delete(constants.CHANNELS_ONCALL_SET)
|
||||||
|
|||||||
Reference in New Issue
Block a user