discord-bot/CompatBot/Commands/Attributes
2020-04-02 20:41:24 +05:00
..
CheckBaseAttributeWithReactions.cs log channel for emoji text and user for permission attributes 2019-08-19 16:45:34 +05:00
LimitedToHelpChannel.cs you can mark command for deletion now with the new . command prefix 2019-02-25 02:05:29 +05:00
LimitedToSpamChannel.cs you can mark command for deletion now with the new . command prefix 2019-02-25 02:05:29 +05:00
readme.md code documentation, part 2 2019-08-26 20:24:06 +05:00
RequiresBotModRole.cs moved some stuff around to better reflect the code organization, hopefully 2018-07-20 09:22:28 +02:00
RequiresBotSudoerRole.cs sync mod members to bot sudoers 2020-04-02 20:41:24 +05:00
RequiresDm.cs use RecyclableMemoryStream to reduce GC pressure 2019-12-06 16:04:47 +05:00
RequiresNotMedia.cs fix RequiresNotMedia implementation 2019-04-15 01:53:58 +05:00
RequiresSupporterRole.cs allow any supporter to use !describe command 2020-03-08 22:53:54 +05:00
RequiresWhitelistedRole.cs !report message 2018-09-10 16:56:52 +02:00
TriggersTyping.cs use emojis instead of TriggerTyping() 2019-01-08 19:25:39 +05:00

Command Attributes

This folder contains various custom attributes that could be used with command groups (classes) and commands themselves (functions).

They're intended for easier management of said commands, such as implementing access rights management and spam reduction policies.

CheckBaseAttributeWithReactions

This is a base class that implements an ability to create Discord reactions in case the check has passed or failed, and also logs the check itself for audit purposes.

LimitedToXyzChannel, RequiresDm, RequiresNotMedia

These attributes are intended to limit potential impact of command usage outside of specific channels. There are some allowances for users with "trusted" roles sometimes, but in general it's an easy way to make sure bot won't reply when it is not needed.

RequiresXyzRole

Similarly implement command access rights management to prevent their use by regular users. As a bonus, every user will only get the list of commands that they can actually use when using !help.

TriggersTyping

This is a legacy attribute that will trigger Typing... message at the bottom of the chat window. It was used to indicate that the bot is working on the command, but it has several issues that prevents it from being very useful (you can't control how long it will be shown, and it eats up an API call).

Generally speaking bot replies too fast to have any special indicator for most commands. Whenever it is needed, it is better to create a reaction, or post and then update an explicit message.