This repository has been archived by the owner on Dec 4, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
run.rb
44 lines (37 loc) · 1.56 KB
/
run.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
38
39
40
41
42
43
44
#Load configs first before we do anything
require_relative './configloader'
#Load discordrb and create the bot instance
require 'discordrb'
#Patching
Dir.glob("./patching/*.rb") { |mod|
puts "Patching with ./#{mod}"
require_relative "./#{mod}"
}
AF_FIVE_NUL = "\0"*5
$bot = Discordrb::Commands::CommandBot.new token: $credentials["token"], client_id: $credentials["client_id"],
prefix: $libconfig["prefix"], fancy_log: $libconfig["fancy_log"], ignore_bots: $libconfig["ignore_bots"],
webhook_commands: $libconfig["webhook_commands"],
spaces_allowed: true, parse_self: true, help_command: false, command_doesnt_exist_message: false,
#I don't want anything but "quote_start" and "quote_end" but it glitches out with empty strings
advanced_functionality: true, previous: "#{AF_FIVE_NUL}~", chain_delimiter: "#{AF_FIVE_NUL}>",
chain_args_delim: "#{AF_FIVE_NUL}:", sub_chain_start: "#{AF_FIVE_NUL}[", sub_chain_end: "#{AF_FIVE_NUL}]"
#Now that that's done, let's load our modules
require_relative './modloader'
require_relative './root'
puts "This bot's invite URL is #{$bot.invite_url}."
puts 'Click on it to invite it to your server.'
#LETS RUN THIS SHIT
$bot.run
# GLOBAL VARIABLES
## $bot [Discordrb::Commands::CommandBot]
## Controls our connection to Discord, as well as handles commands
##
## $config [Hash]
## Bot config, with stuff like the owner ID as well as where to load
## modules and stored data from.
##
## $libconfig [Hash]
## Configuration for $bot
##
## $modconfig [Hash]
## Configuration for modules