#!/usr/bin/env ruby require 'discordrb' require 'tmpdir' token = File.read("token.txt") bot = Discordrb::Bot.new token: "#{token}" bang = '!' def loadCommands(bot, bang) File.foreach("modules/modules.txt", chop: true) { |line| mod = "./modules/" + line + "/main.rb" code = "defined? #{line.delete("\n")}_initialize" if eval(code) == nil load mod.delete("\n") send("#{line.delete("\n")}_initialize", bot, bang) else load mod.delete("\n") end } end $queue = {} loadCommands(bot, bang) #require './pingcommand.rb' #main(bot) #tomlTest() bot.run