diff options
| author | 2020-06-16 20:03:15 +0800 | |
|---|---|---|
| committer | 2020-06-16 20:03:15 +0800 | |
| commit | 2020df342d3aa43acdf7ead026d593f779264002 (patch) | |
| tree | af36b7d01d360210d9ac333eeecb0aab4e38b7ec | |
| parent | Help channels: revise inaccurate comment (diff) | |
Refactor nested if-statement
| -rw-r--r-- | bot/cogs/help_channels.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/bot/cogs/help_channels.py b/bot/cogs/help_channels.py index 86579e940..4c464a7d2 100644 --- a/bot/cogs/help_channels.py +++ b/bot/cogs/help_channels.py @@ -562,11 +562,10 @@ class HelpChannels(Scheduler, commands.Cog): self.bot.stats.timing("help.in_use_time", in_use_time) unanswered = await self.unanswered.get(channel.id) - if unanswered is not None: - if unanswered: - self.bot.stats.incr("help.sessions.unanswered") - else: - self.bot.stats.incr("help.sessions.answered") + if unanswered: + self.bot.stats.incr("help.sessions.unanswered") + elif unanswered is not None: + self.bot.stats.incr("help.sessions.answered") log.trace(f"Position of #{channel} ({channel.id}) is actually {channel.position}.") log.trace(f"Sending dormant message for #{channel} ({channel.id}).") |