questbook thread

This commit is contained in:
Alexander Yakovlev 2018-06-04 14:30:59 +07:00
parent 7a0ab0b7ec
commit fb8d93111a
2 changed files with 16 additions and 12 deletions

16
bot.rb
View File

@ -97,4 +97,20 @@ bot = Cinch::Bot.new do
end
bot.loggers.level = :info
class QuestBookChat
def initialize(bot)
@bot = bot
end
def start
while true
sleep 5
@bot.handlers.dispatch(:questbook)
end
end
end
Thread.new {
QuestBookChat.new(bot).start
}
bot.start

View File

@ -1,15 +1,3 @@
class QuestBookChat
def initialize(bot)
@bot = bot
end
def start
while true
sleep 5
@bot.handlers.dispatch(:questbook)
end
end
end
class QuestBook
include Cinch::Plugin