class Tourmaline::CommandFilter

Overview

Filters messages that include a specific command or commands.

Options:

Note: It's only recommended to use #admin_only in smaller bots. It makes a call to getChatAdministrators every time. For more popular bots it is recommended to implement your own admin caching.

Context additions:

Example:

filter = CommandFilter.new("echo")

Defined in:

Constant Summary

DEFAULT_PREFIXES = ["/"]

Constructors

Instance Method Summary

Instance methods inherited from class Tourmaline::Filter

&(other : Filter | FilterGroup) &, exec(client : Client, update : Update) : Bool exec, |(other : Filter | FilterGroup) |

Constructor Detail

def self.new(commands : String | Array(String), prefix = nil, private_only = false, group_only = false, admin_only = false) #

Instance Method Detail

def admin_only : Bool #

def admin_only=(admin_only : Bool) #

def commands : Array(String) #

def commands=(commands : Array(String)) #

def exec(client : Client, update : Update) : Bool #

def group_only : Bool #

def group_only=(group_only : Bool) #

def prefixes : Array(String) #

def prefixes=(prefixes : Array(String)) #

def private_only : Bool #

def private_only=(private_only : Bool) #