questbook thread
This commit is contained in:
parent
7a0ab0b7ec
commit
fb8d93111a
16
bot.rb
16
bot.rb
|
@ -97,4 +97,20 @@ bot = Cinch::Bot.new do
|
||||||
end
|
end
|
||||||
bot.loggers.level = :info
|
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
|
bot.start
|
||||||
|
|
|
@ -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
|
class QuestBook
|
||||||
include Cinch::Plugin
|
include Cinch::Plugin
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue