Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help System: Move dormant faster if help channel is empty #956

Merged
merged 9 commits into from May 24, 2020
Merged

Help System: Move dormant faster if help channel is empty #956

merged 9 commits into from May 24, 2020

Conversation

ks129
Copy link
Member

@ks129 ks129 commented May 21, 2020

Closes #939

  • Implemented on_message_delete, that reschedule a task, when is_empty return True and channel is inside help in-use category.
  • move_idle_channel check, is channel empty and when it is, this uses correct (shorter) idle_seconds.
  • is_empty request last message and then check, is this bot available message.

ks129 added 2 commits May 21, 2020 11:47
This show how much minutes should this wait before making channel
dormant when no messages in channel (original message deleted).
- Created function `is_empty` that check is there any message in channel
after bot own available message.
- `on_message_delete` that reschedule task when message is on correct
channel and is empty.
- In `move_idle_channel` function, implemented choosing right cooldown,
based on is channel empty or not.
@ks129 ks129 requested a review from a team as a code owner May 21, 2020 09:32
@ks129 ks129 requested review from ikuyarihS and scragly and removed request for a team May 21, 2020 09:32
@MarkKoz MarkKoz added a: help channels Related to the help channel system p: 1 - high High Priority t: feature New feature or request labels May 21, 2020
bot/cogs/help_channels.py Outdated Show resolved Hide resolved
bot/cogs/help_channels.py Outdated Show resolved Hide resolved
bot/cogs/help_channels.py Outdated Show resolved Hide resolved
bot/cogs/help_channels.py Show resolved Hide resolved
@MarkKoz MarkKoz added the s: waiting for author Waiting for author to address a review or respond to a comment label May 21, 2020
ks129 and others added 6 commits May 22, 2020 08:12
Co-authored-by: Mark <kozlovmark@gmail.com>
- Created function `embed_description_match`.
- Implemented this to `is_empty`
- Implemented this to `is_dormant_message`
It was being done repeatedly outside the function so let's move it in
to reduce redundancy.
At this point, it's just a thin wrapper to call another function. It's
redundant.
Copy link
Member

@MarkKoz MarkKoz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed missing awaits and also did some refactoring. Tested it locally and it works.

Copy link
Member

@SebastiaanZ SebastiaanZ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally and it works.

@SebastiaanZ SebastiaanZ merged commit b256195 into python-discord:master May 24, 2020
@Xithrius Xithrius removed the s: waiting for author Waiting for author to address a review or respond to a comment label May 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a: help channels Related to the help channel system p: 1 - high High Priority t: feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Shorten time till dormant after claimer deletes their message(s)
4 participants