jon/bot.rb
2024-10-17 09:41:26 +03:00

41 lines
1.3 KiB
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.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!
**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```
**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.
```
**Miscellaneous**
```
;days <date in %d/%m/%Y format> - shows you the days until that date
```
")
event.message.delete
nil
end
# stolen from https://github.com/Suylo/Discord-Bot/blob/master/index.rb
systems = Dir["systems/*.rb"]
systems.each { |i| require_relative "#{i}" }
bot.include! QuoteSystem
bot.include! NetworkModule
bot.include! TriggerSystem
bot.include! StarboardSystem
bot.include! MiscModule
bot.run