im so fucking retarded for thinking that every reaction was an array. oops!

This commit is contained in:
fzorb 2024-10-06 17:51:17 +03:00
parent 6da8b6bf10
commit ffb94db5fe

View File

@ -6,16 +6,16 @@ module StarboardSystem
extend Discordrb::EventContainer extend Discordrb::EventContainer
reaction_add do |event| reaction_add do |event|
reactions = 0 reactions = 0
for reaction in event.message.reactions do for reaction in event.message.reactions
if reaction.name == "" if reaction.name == ""
reactions = reactions + 1 reactions = reaction.count
end end
end end
attachments = "" attachments = ""
for attachment in event.message.attachments do for attachment in event.message.attachments do
attachments += " #{attachment.url}" attachments += " #{attachment.url}"
end end
if reactions == ENV['MINSTARS'].to_i if reactions >= ENV['MINSTARS'].to_i
message = event.message.content.sub!("@", "[at]") message = event.message.content.sub!("@", "[at]")
if message == nil if message == nil
message = event.message.content message = event.message.content