forked from bougyman/BougyBot
-
Notifications
You must be signed in to change notification settings - Fork 1
/
bot.rb
37 lines (33 loc) · 949 Bytes
/
bot.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env ruby
# frozen_string_literal: true
require 'sequel'
require 'thread'
require 'pry-remote'
puts "Loading library"
require_relative './lib/bougy_bot'
puts "Loading db"
require_relative './db/init'
puts "Loading cinch"
BougyBot::L 'cinch'
def clever(h = {})
BougyBot.options.nick = nil
channels = h[:channels] || BougyBot.options.channels
b = BougyBot::Cinch.new((h[:server] || BougyBot.options.server), channels)
b.bot.loggers << ::Cinch::Logger::FormattedLogger.new(File.open('clever.log', 'w'))
b.bot.loggers = b.bot.loggers.last
b
end
def useful(h = {})
channels = h[:channels] || BougyBot.options.channels
b = BougyBot::Cinch.new((h[:server] || BougyBot.options.server), channels)
b.bot.loggers << ::Cinch::Logger::FormattedLogger.new($stdout)
b.bot.loggers = b.bot.loggers.last
b
end
if $PROGRAM_NAME == __FILE__
require 'pry'
puts "Setting up bot"
u = useful
puts "Starting up bot"
u.start
end