Class: Elephrame::Bots::Command
- Defined in:
- lib/elephrame/streaming/bots.rb
Overview
A bot that responds to commands,
after creation make sure to call add_command or else your bot won’t know what to respond to! (See [Elephrame::Command] for more details
Constant Summary
Constants inherited from BaseBot
BaseBot::FNGabLink, BaseBot::NoBotRegex
Instance Attribute Summary
Attributes included from Command
#cmd_hash, #cmd_regex, #commands, #not_found, #prefix
Attributes included from Reply
Attributes included from Streaming
Attributes inherited from BaseBot
#client, #failed, #max_retries, #strip_html, #username
Instance Method Summary collapse
-
#initialize(prefix = '!', usage = nil) ⇒ Elephrame::Bots::Command
constructor
Create a new Command bot, sets
commands
andcmd_hash
to empty defaults.
Methods included from Command
#add_command, #if_not_found, #run_commands, #set_help, #set_prefix, #setup_command
Methods included from Reply
#reply, #reply_with_mentions, #run_reply
Methods included from Streaming
Methods inherited from BaseBot
backup_method, #fetch_account_id, #fetch_list_id, #find_ancestor, #no_bot?, #post
Constructor Details
#initialize(prefix = '!', usage = nil) ⇒ Elephrame::Bots::Command
Create a new Command bot, sets commands
and cmd_hash
to empty defaults
62 63 64 65 66 67 |
# File 'lib/elephrame/streaming/bots.rb', line 62 def initialize prefix = '!', usage = nil super() setup_streaming setup_command prefix, usage end |