Fixing pounce

This commit is contained in:
Monqui 2026-04-26 20:47:52 +00:00
parent 1594fcfb47
commit ec2aea67a5

View file

@ -179,7 +179,7 @@ bot = Cinch::Bot.new do
m.reply "https://33.media.tumblr.com/fe1446dc5f065b3685fe63c51121fc4f/tumblr_mhhadl964P1rgfo8qo1_r2_400.gif" m.reply "https://33.media.tumblr.com/fe1446dc5f065b3685fe63c51121fc4f/tumblr_mhhadl964P1rgfo8qo1_r2_400.gif"
end end
on :message, /.*trinity.*/i do |m| on :message, /^!trinity$/ do |m|
m.reply "https://tenor.com/view/trinity-taylor-drag-race-sip-cocktail-drama-gif-9086550" m.reply "https://tenor.com/view/trinity-taylor-drag-race-sip-cocktail-drama-gif-9086550"
end end
@ -188,7 +188,7 @@ bot = Cinch::Bot.new do
end end
on :channel, /^!pounce (\S*) (.*)$/ do |m, t, message| on :channel, /^!pounce (\S*) (.*)$/ do |m, t, message|
save_msg = {"source" => m.user.nick, "target" => t, "message" => '', 'time' => ''} save_msg = {"source" => m.user.nick, "target" => t.downcase, "message" => '', 'time' => ''}
if message.index("|") != nil then if message.index("|") != nil then
msg_parts = message.split(' | ') msg_parts = message.split(' | ')
@ -230,8 +230,8 @@ bot = Cinch::Bot.new do
out_msgs = {} out_msgs = {}
pounces.each do |p| pounces.each do |p|
if nick == p["target"] and now > p["time"] then if nick.downcase == p["target"] and now > p["time"] then
out_msgs[nick] = p["source"] + " says " + p["message"] + "| " + out_msgs[nick].to_s out_msgs[m.user.nick] = p["source"] + " says " + p["message"] + " | " + out_msgs[nick].to_s
else else
remaining_pounces.push p remaining_pounces.push p
end end