diff --git a/bot.rb b/bot.rb index 38ea8a7..0d75787 100644 --- a/bot.rb +++ b/bot.rb @@ -11,10 +11,10 @@ bot.command :help do |event, *message| **Quote system** ``` -;quote - displays a quote from the category -;addquote - adds a quote into a category -;quotecategories - shows all categories -;showquote - shows the quote with the id provided``` +;quote, ;q - displays a quote from the category +;quoteadd, ;qa - adds a quote into a category +;quotecategories ;qc - shows all categories +;quoteshow ;qs - shows the quote with the id provided``` **Networking related commands** ``` ;ip - Display basic information about an IP address. You can input multiple IPs. We are required to state that the information provided by this command comes from the IP2Location database. diff --git a/systems/quote.rb b/systems/quote.rb index 2b7bf28..b417735 100644 --- a/systems/quote.rb +++ b/systems/quote.rb @@ -7,7 +7,7 @@ Dotenv.load("#{__dir__}/../.env") module QuoteSystem extend Discordrb::Commands::CommandContainer db = SQLite3::Database.new("jon.sqlite") - command :addquote do |event, *message| + command(:quoteadd, aliases: [:addquote, :qa]) do |event, *message| if message[0] == nil event.channel.send_message("You haven't specified a category for your quote.") return @@ -23,7 +23,7 @@ module QuoteSystem nil end - command :quote do |event, *message| + command(:quote, aliases: [:q]) do |event, *message| category = message[0] if category == nil quotes = db.execute("SELECT * FROM quotes") @@ -42,13 +42,13 @@ module QuoteSystem nil end - command :quotecategories do |event, *message| + command(:quotecategories, aliases: [:qc]) do |event, *message| categories = db.execute("SELECT DISTINCT category FROM quotes") event.channel.send_message("**Categories**: #{categories[0..].join(' ')}") nil end - command :showquote do |event, *message| + command(:showquote, aliases: [:sq, :quoteshow]) do |event, *message| quote = db.execute("SELECT * FROM quotes WHERE id = ?", [message[0]]) if quote == nil event.channel.send_message("Quote doesn't exist") @@ -69,4 +69,4 @@ module QuoteSystem event.channel.send_message("Job complete.") nil end -end \ No newline at end of file +end