better logic, more funny

This commit is contained in:
stryan 2022-02-04 19:22:06 -05:00
parent afbb41ec43
commit a15ff0dbcd
2 changed files with 20 additions and 12 deletions

View File

@ -11,8 +11,17 @@ class Folder
end
def curse(user)
@steves.delete(user.id)
@fallen.append(user.id)
if @steves.include?(user.id)
@steves.delete(user.id)
@fallen.append(user.id)
end
end
def bless(user)
if @fallen.include?(user.id)
@steves.append(user.id)
@fallen.delete(user.id)
end
end
def steve?(user)
@ -35,21 +44,17 @@ class Folder
end
message = @submissions.sample
i = 0
#until message.sender != target or i == 5 do
# message = @submissions.sample
# i = i + 1
#end
until message.sender != target or i == 5 do
message = @submissions.sample
i = i + 1
end
if i == 5
return nil
end
@submissions.delete(message)
if File.exist?(message.content)
if message.local and not File.exist?(message.content)
return nil
end
if message.local
File.delete(message.content) if File.exist?(message.content)
end
return target,message
end
end

View File

@ -99,7 +99,9 @@ loop do
logger.info("sleeping for #{timer} seconds")
sleep timer
t = Time.new
if t.hour < 9 or t.hour > 2
if t.hour < 9 and t.hour > 2
puts t.hour
logger.info("skipping send cuz it's late")
next
end
sid,msg = folder.harass_steve()
@ -111,6 +113,7 @@ loop do
logger.info("sending submission #{msg.id}")
if msg.local
steve.send_file(File.open(msg.content,'r'))
File.delete(msg.content)
else
steve.pm(msg.content)
end