Skip to content

Commit

Permalink
Update main.py
Browse files Browse the repository at this point in the history
  • Loading branch information
PlaceReporter99 committed Aug 14, 2024
1 parent 74ceec3 commit 4bfbea7
Showing 1 changed file with 24 additions and 23 deletions.
47 changes: 24 additions & 23 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,28 +330,29 @@ def msg(event):


if main_:
bot = sechat.Bot()
bot.login(os.environ["BOT_EMAIL"], os.environ["BOT_PASSWORD"])
[r, baso, ubot] = [1, 1, 1] # Temp, will be replaced once repeat() is run. I think.
def repeat():
[r, baso, ubot] = map(bot.joinRoom, [1, 146039, 154629])
for room in [r, baso, ubot]:
onn(room)
ubot.send(f"Wake up, it's antifreeze time!")
repeat()
app.run(host='0.0.0.0', port=5000)
try:
counter = 0
print("Startup Successful.")
while True:
print(f"Bot is running. Seconds since start: {counter}")
# st.write(f"Bot is running. Seconds since start: {counter}")
time.sleep(1)
counter += 1
if counter % 3600 == 0:
ubot.send(f"Wake up, it's antifreeze time!")
finally:
#r.send("Bot has stopped for updates.")
bot.leaveAllRooms()
def mainf():
bot = sechat.Bot()
bot.login(os.environ["BOT_EMAIL"], os.environ["BOT_PASSWORD"])
[r, baso, ubot] = [1, 1, 1] # Temp, will be replaced once repeat() is run. I think.
def repeat():
[r, baso, ubot] = map(bot.joinRoom, [1, 146039, 154629])
for room in [r, baso, ubot]:
onn(room)
ubot.send(f"Wake up, it's antifreeze time!")
repeat()
app.run(host='0.0.0.0', port=5000)
try:
counter = 0
print("Startup Successful.")
while True:
print(f"Bot is running. Seconds since start: {counter}")
# st.write(f"Bot is running. Seconds since start: {counter}")
time.sleep(1)
counter += 1
if counter % 3600 == 0:
ubot.send(f"Wake up, it's antifreeze time!")
finally:
#r.send("Bot has stopped for updates.")
bot.leaveAllRooms()
mainf()

0 comments on commit 4bfbea7

Please sign in to comment.