jon/systems/misc.rb

14 lines
367 B
Ruby
Raw Permalink Normal View History

2024-10-09 10:51:54 +03:00
require 'discordrb'
require 'date'
module MiscModule
extend Discordrb::Commands::CommandContainer
command :days do |event, *message|
puts message[0]
providedDate = Date.strptime(message[0], '%d/%m/%Y')
dateToday = Date.today
days = (providedDate - dateToday).to_i
event.channel.send_message("#{days} days left until #{message[0]}")
end
end