cancel command

This commit is contained in:
klemek
2021-01-13 15:25:02 +01:00
parent e106ed4e41
commit e02516677a
4 changed files with 52 additions and 5 deletions
+8 -3
View File
@@ -6,7 +6,7 @@ import re
import discord
from utils import no_duplicate, get_intro, delta, deltas, mention, channel_mention
from logs import GuildLogs, ChannelLogs, MessageLog
from logs import GuildLogs, ChannelLogs, MessageLog, ALREADY_RUNNING, CANCELLED
class Scanner(ABC):
@@ -94,9 +94,14 @@ class Scanner(ABC):
total_msg, total_chan = await logs.load(
progress, self.channels, fast="fast" in args
)
if total_msg == -1:
if total_msg == CANCELLED:
await message.channel.send(
f"An analysis is already running on this server, please be patient.",
"Operation cancelled by user",
reference=message,
)
elif total_msg == ALREADY_RUNNING:
await message.channel.send(
"An analysis is already running on this server, please be patient.",
reference=message,
)
else: