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

View File

@ -99,7 +99,9 @@ loop do
logger.info("sleeping for #{timer} seconds") logger.info("sleeping for #{timer} seconds")
sleep timer sleep timer
t = Time.new 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 next
end end
sid,msg = folder.harass_steve() sid,msg = folder.harass_steve()
@ -111,6 +113,7 @@ loop do
logger.info("sending submission #{msg.id}") logger.info("sending submission #{msg.id}")
if msg.local if msg.local
steve.send_file(File.open(msg.content,'r')) steve.send_file(File.open(msg.content,'r'))
File.delete(msg.content)
else else
steve.pm(msg.content) steve.pm(msg.content)
end end