Delete unused file

This commit is contained in:
Bill Rossi 2025-08-29 17:16:15 -04:00
parent f2870ae4f6
commit 86415ef0e1

View File

@ -1,72 +0,0 @@
require_relative "drill"
class DrillPlugin
COMMANDS = %w[
help
]
attr_reader :bot, :drills
def initialize(bot)
@bot = bot
@drills = Hash.new { Drill.new }
end
def handle_message(message)
puts "[#{self.class.name}] Handling \"#{message.content}\" from #{message.author.display_name}"
command = strip_prefix(message.content).split.first
p command
if command.nil? || command == "" || command == "help" || command == "!drill"
handle_help message
elsif COMMANDS.include? command
drill = drills[message.channel.id]
send("handle_#{command}", message, drill)
else
drill = drills[message.channel.id]
drill.handle_message(message)
end
end
def handle_init(message, drill)
if drill.exists?
message.respond "You've already got a drill running in this channel"
else
drills[message.channel.id] = Drill.new message.channel
message.respond "New drill created!"
end
end
def handle_start(message, drill)
if drill.started?
message.respond "This drill has already started!"
elsif drill.exists?
drill.start!
message.respond "Drill started!"
else
message.respond "You have to `!drill init` before you can start the drill"
end
end
def handle_end(message, drill)
if !drill.exists?
message.respond "There's no drill to end"
elsif drill.started?
drills.delete message.channel.id
message.respond "Ending the drill now!"
else
message.respond "You have to `!drill start` before you can end the drill"
end
end
def handle_help(message)
message.respond "Insert help message here"
end
def strip_prefix(content)
if content.start_with? "!drill"
content.sub("!drill ", "")
else
content
end
end
end