all rooms will get the same image every time now
This commit is contained in:
parent
6f2cb5d19c
commit
5a37583596
1 changed files with 11 additions and 9 deletions
12
garfeef.py
12
garfeef.py
|
@ -27,13 +27,13 @@ def get_garfeed():
|
|||
return url
|
||||
|
||||
|
||||
def sendmsg(bot):
|
||||
for room in bot.rooms:
|
||||
print(type(room))
|
||||
def sendmsgs(bot):
|
||||
get_garfeed()
|
||||
|
||||
url = None
|
||||
with open("save.png", "rb") as file:
|
||||
url = bot.client.upload(file, "image/png")
|
||||
if url is not None:
|
||||
for room in bot.rooms:
|
||||
room.send_image(url, "garfeeld.png")
|
||||
|
||||
def main():
|
||||
|
@ -42,8 +42,10 @@ def main():
|
|||
bot.client.api.upload_keys()
|
||||
|
||||
print(f"up and running as {USERNAME}")
|
||||
|
||||
while True:
|
||||
sendmsg(bot)
|
||||
sendmsgs(bot)
|
||||
|
||||
timenext = random.randint(60, 60*60)
|
||||
print(f"next in {timenext} seconds")
|
||||
time.sleep(timenext)
|
||||
|
|
Loading…
Reference in a new issue