24 lines
922 B
Ruby
24 lines
922 B
Ruby
require 'discordrb'
|
|
require 'dotenv'
|
|
require 'sqlite3'
|
|
|
|
Dotenv.load
|
|
|
|
bot = Discordrb::Commands::CommandBot.new token: ENV['TOKEN'], client_id: ENV['CLIENT_ID'], prefix: ENV['PREFIX']
|
|
|
|
bot.message do |event|
|
|
if ENV['FORBIDDEN_WORDS'].split(",").any? { |word| event.message.content.downcase.include?(word.downcase)}
|
|
event.author.pm("Garfield, watch your tone!")
|
|
end
|
|
end
|
|
|
|
bot.command :help do |event, *message|
|
|
event.author.pm("You've asked for help. In order not to flood the channel where you sent the command, I have sent the list of commands here, in your PMs. Enjoy! \n\n**Quote system**\n```;quote <category> - displays a quote from the category\n;addquote <category> <quote> - adds a quote into a category\n;quotecategories - shows all categories\n;showquote <id> - shows the quote with the id provided```")
|
|
event.message.delete
|
|
nil
|
|
end
|
|
|
|
require_relative 'systems/quote'
|
|
bot.include! QuoteSystem
|
|
bot.run
|