require 'rbot/journal'
+module ::Irc
+class Bot
+ # this should return the journal if the managing plugin has been loaded.
+ def journal
+ if @plugins['journal']
+ @plugins['journal'].broker
+ end
+ end
+end
+end
+
class JournalModule < CoreBotModule
attr_reader :broker
name = @bot.config['journal.storage']
uri = @bot.config['journal.storage.uri']
if name
- storage = Storage.create(name, uri)
+ begin
+ storage = Storage.create(name, uri)
+ rescue
+ error 'journal storage initialization error!'
+ error $!
+ error $@.join("\n")
+ end
end
debug 'journal broker starting up...'
@broker = JournalBroker.new(storage: storage)