Skip to content

Commit e33181e

Browse files
Fix poll time keeping
1 parent f9eee8b commit e33181e

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

plugins/plugin_poll.py

+8-3
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class Poll():
3737

3838
time_zone = 'US/Eastern'
3939

40-
message_history_limit = 200
40+
message_history_limit = 100
4141

4242
post_channel = 'polls-and-suggestions'
4343
# post_channel = 'bot-commands'
@@ -134,7 +134,12 @@ async def check_poll_embed(self, msg, embed):
134134
now = datetime.now()
135135
now = usest.localize(now)
136136

137-
message_hist_sec = (now - msg_time).seconds
137+
message_hist_sec = (now - msg_time).total_seconds()
138+
139+
# print('Message time: ' + str(msg_time))
140+
# print('Current time: ' + str(now))
141+
# print('Elapsed time: ' + str(message_hist_sec))
142+
# print('Seconds left: ' + str(self.poll_time_limit - message_hist_sec))
138143

139144
await self.update_poll_embed(msg, embed, self.poll_time_limit - message_hist_sec)
140145

@@ -143,7 +148,7 @@ async def check_poll_embed(self, msg, embed):
143148
print('Found open Poll that needs to be closed: ' + str(message_hist_sec))
144149
await self.close_poll_embed(msg, embed)
145150

146-
@loop(seconds = 5)
151+
@loop(seconds = 30)
147152
async def loop_func(self):
148153
if self.looping:
149154
post_channel = None

users.txt

+1
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ trisp3ar#7694:trisp3ar
44
Exzed#1817:TUBICINO
55
jmort#5552:Jaimort
66
WillStunForFood#8607:Phantom_Revived
7+
melzie_bee#5717:Melz554877

0 commit comments

Comments
 (0)