various fixes

This commit is contained in:
Emily 2021-08-24 11:53:25 +02:00
parent 6312a525f3
commit 4e12a02bc0
2 changed files with 4 additions and 4 deletions

View file

@ -17,7 +17,7 @@ bot.ready do |event|
chan = bot.channel CHANNEL
last_message = chan.history(1)[0].id
i = 1
for iter in 0..FETCH_COUNT do
for iter in 1..FETCH_COUNT do
chan.history(FETCH_AMOUNT, last_message).each do |msg|
print "Fetching messages (#{i}/#{FETCH_COUNT * FETCH_AMOUNT}) ...\r"
$stdout.flush
@ -25,12 +25,12 @@ bot.ready do |event|
if msg.id < last_message then
last_message = msg.id
end
sleep(0.072) # ratelimit
sleep(0.064) # ratelimit
i += 1
end
end
print "Fetching messages (#{i}/#{FETCH_COUNT * FETCH_AMOUNT}) ...\n"
print "Fetching messages (#{i - 1}/#{FETCH_COUNT * FETCH_AMOUNT}) ...\n"
puts "Done! Shutting down..."
save_db
bot.stop

View file

@ -11,7 +11,7 @@ $messages = Set.new
bot.ready do |event|
chan = bot.channel CHANNEL
bot.online
bot.watching "Messages in #" + chan.name
bot.watching = "Messages in #" + chan.name
end
bot.message(in: CHANNEL) do |event|