| Commit message (Collapse) | Author | Lines | ||
|---|---|---|---|---|
| 2020-03-22 | Scheduler: fix dict size changing while cancelling all tasks | -5/+10 | ||
| * Make a copy of the dict * Add a `ignore_missing` param to `cancel_task` to suppress the warning for a task not being found | ||||
| 2020-03-22 | HelpChannels: fix last notification time not being set | -1/+3 | ||
| 2020-03-22 | HelpChannels: fix task cancelling itself | -2/+0 | ||
| 2020-03-22 | Scheduler: fix incorrect task id in error log | -1/+1 | ||
| 2020-03-22 | HelpChannels: cancel existing task in the dormant command | -0/+1 | ||
| 2020-03-22 | HelpChannels: fix candidate channel not being returned after waiting | -1/+1 | ||
| 2020-03-22 | HelpChannels: remove loop arg from schedule_task calls | -2/+2 | ||
| 2020-03-22 | HelpChannels: explicitly specify if a task should be cancelled | -4/+5 | ||
| When rescheduling an idle channel, the task will only be cancelled if the function was told the channel should currently have a task scheduled. This means warnings for missing tasks will appear when they should. The previous approach of checking if a task exists was flawed because it had no way to tell whether a task *should* exist. It assumed nothing is wrong if a task doesn't exist. Currently, the only case when a task shouldn't exist is when the cog is initialised and channels from the bot's previous life are being scheduled. | ||||
| 2020-03-22 | Scheduler: add a method to cancel all tasks | -4/+9 | ||
| The dictionary which was iterated to cancel tasks is now "private". Therefore, the scheduler should provide a public API for cancelling tasks. * Delete the task before cancelling it to prevent the done callback, however unlikely it may be, from deleting the task first | ||||
| 2020-03-22 | HelpChannels: rename elements dict to name_positions | -3/+3 | ||
| 2020-03-22 | HelpChannels: prefix channel names after reading from file | -15/+19 | ||
| Prefixing them early on means subsequent code doesn't have to deal with stripping the prefix from channel names in order to get their positions. * Remove `count` parameter from `get_names`; define it in the body | ||||
| 2020-03-22 | HelpChannels: cancel channel queue tasks on cog unload | -1/+22 | ||
| * Store queue get() tasks in a list * Create a separate function to wait for a channel from the queue * Add comments for the various groups of attributes defined in __init__ | ||||
| 2020-03-22 | HelpChannels: add trace logging for notifications | -0/+5 | ||
| 2020-03-22 | HelpChannels: move newest in-use channel to the top | -0/+1 | ||
| This gives the newest questions the most visibility. | ||||
| 2020-03-22 | BotCog: determine if a help channel by checking its category | -10/+7 | ||
| Initialising the dictionary with help channel IDs doesn't work anymore since help channels are now dynamic. | ||||
| 2020-03-22 | Constants: remove old help channel constants | -18/+0 | ||
| 2020-03-22 | HelpChannels: handle potential notification exceptions locally | -1/+7 | ||
| The notification feature is not critical for the functionality of the help channel system. Therefore, the exception should not be allowed to propagate and halt the system in some way. | ||||
| 2020-03-22 | HelpChannels: notify configured list of roles instead of helpers only | -7/+12 | ||
| * Rename function `notify_helpers` -> `notify` * Use bullet-point list for config options in the docstring | ||||
| 2020-03-22 | Constants: add a roles list constant for help channel notifications | -1/+5 | ||
| 2020-03-22 | Constants: add a channel constant for help channel notifications | -6/+11 | ||
| 2020-03-22 | Constants: rename HelpChannels.notify_helpers to notify | -4/+4 | ||
| 2020-03-22 | HelpChannels: adjust the helper notification message | -3/+3 | ||
| 2020-03-22 | HelpChannels: add a minimum interval between helper notifications | -9/+32 | ||
| * Add configurable constant for minimum interval * Move helper notifications to a separate function | ||||
| 2020-03-22 | HelpChannels: log previous position when getting alphabetical position | -1/+5 | ||
| 2020-03-22 | HelpChannels: notify helpers if out of channels | -0/+13 | ||
| Send a message in the #helpers channel pinging the @helpers role to notify them of a lack of help channels. Can be toggled off in the config. | ||||
| 2020-03-22 | HelpChannels: add a function to get a channel's alphabetical position | -4/+23 | ||
| * Log a warning if a channel lacks the expected help channel prefix * Log the old and new channel positions | ||||
| 2020-03-22 | HelpChannels: add a warning if more than 50 channels exist | -0/+6 | ||
| Discord only supports 50 channels per category. The help system will eventually error out trying to move channels if more than 50 exist. | ||||
| 2020-03-22 | HelpChannels: sort dormant channels alphabetically | -4/+6 | ||
| The channels are easier to find when sorted alphabetically. * Merge some trace and info logs | ||||
| 2020-03-22 | HelpChannels: warn if too many help channels will be possible | -0/+9 | ||
| Discord only supports 50 channels per category. * Add a constant for the maximum number of channels per category * Add trace logging to `get_names` | ||||
| 2020-03-22 | HelpChannels: return elements as a truncated dict of names | -5/+7 | ||
| 2020-03-22 | HelpChannels: move reading of element names to a function | -6/+11 | ||
| Makes it easier to test. | ||||
| 2020-03-22 | Constants: add constant for max total help channels | -0/+5 | ||
| Represents the total number of help channels across all 3 categories. | ||||
| 2020-03-22 | Resources: map element names to alphabetic indices | -120/+120 | ||
| The indices will be used to sort the elements alphabetically in the dormant category. | ||||
| 2020-03-22 | HelpChannels: use more specific type hints for queues | -2/+2 | ||
| 2020-03-22 | HelpChannels: limit channels to a total of 50 | -1/+3 | ||
| Discord has a hard limit of 50 channels per category. It was decided 50 is plenty for now so no work will be done to support more than 50. | ||||
| 2020-03-22 | HelpChannels: explain the system in the cog docstring | -1/+30 | ||
| 2020-03-22 | HelpChannels: cancel the task in _scheduled_task | -0/+2 | ||
| 2020-03-22 | HelpChannels: use >= instead of > to determine if timed out | -1/+1 | ||
| 2020-03-22 | HelpChannels: compare contents to confirm message is a dormant message | -1/+10 | ||
| * Add a new function to check if a message is a dormant message | ||||
| 2020-03-22 | HelpChannels: add a function to send or edit the available message | -5/+16 | ||
| Edits the dormant message or sends a new message if the dormant one cannot be found. | ||||
| 2020-03-22 | HelpChannels: add a function to get the last message in a channel | -5/+15 | ||
| 2020-03-22 | HelpChannels: put channels in the queue when they go dormant | -0/+3 | ||
| 2020-03-22 | HelpChannels: add missing units of time in messages | -3/+3 | ||
| 2020-03-22 | HelpChannels: fix acquisition of the on_message lock | -1/+1 | ||
| * Use async_with * Don't call acquire() | ||||
| 2020-03-22 | HelpChannels: ignore messages sent by bots | -0/+3 | ||
| 2020-03-22 | Resources: make all element names lower cased | -118/+118 | ||
| 2020-03-22 | HelpChannels: fix creation of the init_cog task | -1/+1 | ||
| The task has to be created on a specific loop because when the cog is instantiated, the event loop is not yet running. | ||||
| 2020-03-22 | Remove the free extension | -104/+0 | ||
| Obsolete due to the new help channel system. | ||||
| 2020-03-22 | Bot: load the help channels extension | -0/+1 | ||
| 2020-03-22 | HelpChannels: add logging | -6/+83 | ||