add aliases
This commit is contained in:
parent
40b87f9d5d
commit
f6747b03b3
8
bot.rb
8
bot.rb
@ -11,10 +11,10 @@ bot.command :help do |event, *message|
|
||||
|
||||
**Quote system**
|
||||
```
|
||||
;quote <category (optional)> - displays a quote from the category
|
||||
;addquote <category> <quote> - adds a quote into a category
|
||||
;quotecategories - shows all categories
|
||||
;showquote <id> - shows the quote with the id provided```
|
||||
;quote, ;q <category (optional)> - displays a quote from the category
|
||||
;quoteadd, ;qa <category> <quote> - adds a quote into a category
|
||||
;quotecategories ;qc - shows all categories
|
||||
;quoteshow ;qs <id> - shows the quote with the id provided```
|
||||
**Networking related commands**
|
||||
```
|
||||
;ip <ips> - 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.
|
||||
|
@ -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")
|
||||
|
Loading…
Reference in New Issue
Block a user