joann-pupper-bot/src/joann-pupper-bot.cr

19 lines
433 B
Crystal
Raw Normal View History

2018-03-20 16:31:49 -07:00
require "./joann-pupper-bot/*"
2020-04-25 19:34:12 -07:00
require "option_parser"
2018-03-20 16:31:49 -07:00
2020-04-25 19:34:12 -07:00
config_file = "./config.yaml"
2019-04-14 22:22:49 -07:00
2020-04-25 19:34:12 -07:00
OptionParser.parse do |parser|
parser.banner = "Usage: joann-pupper-bot [arguments]"
parser.on("-c", "--config=CONFIG", "Select config file") do |c|
config_file = c
2019-04-14 22:22:49 -07:00
end
2020-04-25 19:34:12 -07:00
parser.on("-h", "--help", "Show this message") do
puts parser
exit
2019-04-14 22:22:49 -07:00
end
2018-03-20 16:31:49 -07:00
end
2020-04-25 19:34:12 -07:00
botc = PupperBot.new(BotConfiguration.from_yaml(File.open(config_file)))
2019-04-14 22:22:49 -07:00
sleep