Class: Issola::Bot
- Inherits:
-
Object
- Object
- Issola::Bot
- Defined in:
- lib/issola/bot.rb
Instance Method Summary collapse
-
#initialize(token:) ⇒ Bot
constructor
A new instance of Bot.
- #invite_url ⇒ Object
- #register(obj) ⇒ Object
- #run ⇒ Object
Constructor Details
#initialize(token:) ⇒ Bot
Returns a new instance of Bot.
5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/issola/bot.rb', line 5 def initialize(token:) @bot = Discordrb::Bot.new( token: token, ) @command_handler = Command::Handler.new @bot.(start_with: Config::Bot::COMMAND_PREFIX) do |event| @command_handler.handle(event) end end |
Instance Method Details
#invite_url ⇒ Object
17 18 19 |
# File 'lib/issola/bot.rb', line 17 def invite_url @bot.invite_url end |
#register(obj) ⇒ Object
21 22 23 |
# File 'lib/issola/bot.rb', line 21 def register(obj) obj.register(@command_handler) end |
#run ⇒ Object
25 26 27 |
# File 'lib/issola/bot.rb', line 25 def run @bot.run end |