From 40fa4f71bcd4946e5578beabedd30e308d1e1cdd Mon Sep 17 00:00:00 2001 From: James Lu Date: Tue, 28 Mar 2017 22:39:11 -0700 Subject: [PATCH] corecommands: add a 'clearqueue' command to force clear queue muckups (#441) --- coremods/corecommands.py | 8 ++++++++ docs/permissions-reference.md | 1 + 2 files changed, 9 insertions(+) diff --git a/coremods/corecommands.py b/coremods/corecommands.py index bead746..08e618b 100644 --- a/coremods/corecommands.py +++ b/coremods/corecommands.py @@ -201,3 +201,11 @@ def rehash(irc, source, args): return else: irc.reply("Done.") + +@utils.add_cmd +def clearqueue(irc, source, args): + """takes no arguments. + + Clears the outgoing text queue for the current connection.""" + permissions.checkPermissions(irc, source, ['core.clearqueue']) + irc.queue.clear() diff --git a/docs/permissions-reference.md b/docs/permissions-reference.md index 0513e88..5ad9b23 100644 --- a/docs/permissions-reference.md +++ b/docs/permissions-reference.md @@ -3,6 +3,7 @@ Below is a list of all the permissions defined by PyLink and its official plugins. For instructions on how to fine-tune permissions, see [example-permissions.yml](../example-permissions.yml). ## PyLink Core +- `core.clearqueue` - Allows access to the `clearqueue` command. - `core.shutdown` - Allows access to the `shutdown` command. - `core.load` - Allows access to the `load` command. - `core.unload` - Allows access to the `unload` command.