aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeLines
...
| | | | | | * | | Constants: add a channel constant for help channel notificationsGravatar MarkKoz2020-03-22-6/+11
| | | | | | | | |
| | | | | | * | | Constants: rename HelpChannels.notify_helpers to notifyGravatar MarkKoz2020-03-22-4/+4
| | | | | | | | |
| | | | | | * | | HelpChannels: adjust the helper notification messageGravatar MarkKoz2020-03-22-3/+3
| | | | | | | | |
| | | | | | * | | HelpChannels: add a minimum interval between helper notificationsGravatar MarkKoz2020-03-22-9/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add configurable constant for minimum interval * Move helper notifications to a separate function
| | | | | | * | | HelpChannels: log previous position when getting alphabetical positionGravatar MarkKoz2020-03-22-1/+5
| | | | | | | | |
| | | | | | * | | HelpChannels: notify helpers if out of channelsGravatar MarkKoz2020-03-22-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.
| | | | | | * | | HelpChannels: add a function to get a channel's alphabetical positionGravatar MarkKoz2020-03-22-4/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Log a warning if a channel lacks the expected help channel prefix * Log the old and new channel positions
| | | | | | * | | HelpChannels: add a warning if more than 50 channels existGravatar MarkKoz2020-03-22-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.
| | | | | | * | | HelpChannels: sort dormant channels alphabeticallyGravatar MarkKoz2020-03-22-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The channels are easier to find when sorted alphabetically. * Merge some trace and info logs
| | | | | | * | | HelpChannels: warn if too many help channels will be possibleGravatar MarkKoz2020-03-22-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`
| | | | | | * | | HelpChannels: return elements as a truncated dict of namesGravatar MarkKoz2020-03-22-5/+7
| | | | | | | | |
| | | | | | * | | HelpChannels: move reading of element names to a functionGravatar MarkKoz2020-03-22-6/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Makes it easier to test.
| | | | | | * | | Constants: add constant for max total help channelsGravatar MarkKoz2020-03-22-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Represents the total number of help channels across all 3 categories.
| | | | | | * | | Resources: map element names to alphabetic indicesGravatar MarkKoz2020-03-22-120/+120
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The indices will be used to sort the elements alphabetically in the dormant category.
| | | | | | * | | HelpChannels: use more specific type hints for queuesGravatar MarkKoz2020-03-22-2/+2
| | | | | | | | |
| | | | | | * | | HelpChannels: limit channels to a total of 50Gravatar MarkKoz2020-03-22-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.
| | | | | | * | | HelpChannels: explain the system in the cog docstringGravatar MarkKoz2020-03-22-1/+30
| | | | | | | | |
| | | | | | * | | HelpChannels: cancel the task in _scheduled_taskGravatar MarkKoz2020-03-22-0/+2
| | | | | | | | |
| | | | | | * | | HelpChannels: use >= instead of > to determine if timed outGravatar MarkKoz2020-03-22-1/+1
| | | | | | | | |
| | | | | | * | | HelpChannels: compare contents to confirm message is a dormant messageGravatar MarkKoz2020-03-22-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add a new function to check if a message is a dormant message
| | | | | | * | | HelpChannels: add a function to send or edit the available messageGravatar MarkKoz2020-03-22-5/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Edits the dormant message or sends a new message if the dormant one cannot be found.
| | | | | | * | | HelpChannels: add a function to get the last message in a channelGravatar MarkKoz2020-03-22-5/+15
| | | | | | | | |
| | | | | | * | | HelpChannels: put channels in the queue when they go dormantGravatar MarkKoz2020-03-22-0/+3
| | | | | | | | |
| | | | | | * | | HelpChannels: add missing units of time in messagesGravatar MarkKoz2020-03-22-3/+3
| | | | | | | | |
| | | | | | * | | HelpChannels: fix acquisition of the on_message lockGravatar MarkKoz2020-03-22-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Use async_with * Don't call acquire()
| | | | | | * | | HelpChannels: ignore messages sent by botsGravatar MarkKoz2020-03-22-0/+3
| | | | | | | | |
| | | | | | * | | Resources: make all element names lower casedGravatar MarkKoz2020-03-22-118/+118
| | | | | | | | |
| | | | | | * | | HelpChannels: fix creation of the init_cog taskGravatar MarkKoz2020-03-22-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.
| | | | | | * | | Remove the free extensionGravatar MarkKoz2020-03-22-104/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Obsolete due to the new help channel system.
| | | | | | * | | Bot: load the help channels extensionGravatar MarkKoz2020-03-22-0/+1
| | | | | | | | |
| | | | | | * | | HelpChannels: add loggingGravatar MarkKoz2020-03-22-6/+83
| | | | | | | | |
| | | | | | * | | HelpChannels: use a lock to prevent a channel from being processed twiceGravatar MarkKoz2020-03-22-5/+9
| | | | | | | | |
| | | | | | * | | HelpChannels: wait for cog to be initialised before processing messagesGravatar MarkKoz2020-03-22-0/+2
| | | | | | | | |
| | | | | | * | | HelpChannels: implement _scheduled_taskGravatar MarkKoz2020-03-22-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make a channel dormant after specified timeout or reschedule if it's still active.
| | | | | | * | | HelpChannels: cancel an existing task before scheduling a new oneGravatar MarkKoz2020-03-22-1/+9
| | | | | | | | |
| | | | | | * | | HelpChannels: cancel scheduled tasks when the cog unloadsGravatar MarkKoz2020-03-22-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Make cog_unload a regular method instead of a coroutine
| | | | | | * | | HelpChannels: implement the on_message listenerGravatar MarkKoz2020-03-22-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It handles making channels in-use and replacing them with new available channels.
| | | | | | * | | HelpChannels: add a function to make channels in-useGravatar MarkKoz2020-03-22-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It handles moving the channel to the category and scheduling it to be made dormant.
| | | | | | * | | HelpChannels: implement the !dormant commandGravatar MarkKoz2020-03-22-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Basically a wrapper around move_to_dormant which ensures the current channel is in use. If it's not in-use, from the invoker's perspective, the command silently fails (it does at least log). InChannelCheckFailure was considered but it seemed like it'd be too spammy, especially if there'd be a long list of allowed channels.
| | | | | | * | | HelpChannels: implement move_to_dormantGravatar MarkKoz2020-03-22-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Moves a channel to the Dormant category. Permissions will be synced with the new category.
| | | | | | * | | HelpChannels: implement move_to_availableGravatar MarkKoz2020-03-22-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Moves a channel to the Available category. Permissions will be synced with the new category. * Add stubs for channel topic constants
| | | | | | * | | HelpChannels: implement get_available_candidateGravatar MarkKoz2020-03-22-1/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Return a dormant channel to turn into an available channel, waiting indefinitely until one becomes available in the queue.
| | | | | | * | | HelpChannels: implement create_dormantGravatar MarkKoz2020-03-22-2/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Create and return a new channel in the Dormant category or return None if no names remain. The overwrites get synced with the category if none are explicitly specified for the channel.
| | | | | | * | | HelpChannels: implement get_idle_timeGravatar MarkKoz2020-03-22-3/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A design change was made to account for a channel being empty i.e. no messages ever sent. In such case, the function will return None. * Move a channel to the Dormant category if the channel has no messages
| | | | | | * | | HelpChannels: make move_idle_channels only handle a single channelGravatar MarkKoz2020-03-22-10/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This function will get re-used in _scheduled_task, but it will only need to move a single channel. Therefore, to promote code re-use, this change was made. The init_cog will instead do a loop to call this on all channels in the in-use category.
| | | | | | * | | HelpChannels: fix creation of queues in init_cogGravatar MarkKoz2020-03-22-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Remove await from create_channel_queue * Call the correct function to create the name queue
| | | | | | * | | HelpChannels: implement move_idle_channelsGravatar MarkKoz2020-03-22-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make all in-use channels dormant if idle or schedule the move if still active. This is intended to clean up the in-use channels when the bot restarts and has lost the tasks it had scheduled in another life.
| | | | | | * | | Constants: add a named tuple for scheduled task dataGravatar MarkKoz2020-03-22-2/+9
| | | | | | | | |
| | | | | | * | | Constants: implement init_availableGravatar MarkKoz2020-03-22-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Initialises the Available category with channels if any are missing.
| | | | | | * | | Constants: add a help channel name prefix constantGravatar MarkKoz2020-03-22-1/+5
| | | | | | | | |