logging & avatar fix
This commit is contained in:
parent
d2b740f21d
commit
808156f016
1 changed files with 3 additions and 1 deletions
4
bot.py
4
bot.py
|
@ -60,7 +60,7 @@ async def send_message(text):
|
|||
"text": text,
|
||||
"format": "html",
|
||||
"displayName": "PUBLIC INFORMATION STREAMS & SERVICES",
|
||||
"avatarUrl": "http://i.imgur.com/IDOBtEJ.png"
|
||||
"avatarUrl": config.AVATAR_URL
|
||||
})
|
||||
|
||||
|
||||
|
@ -84,10 +84,12 @@ async def main():
|
|||
|
||||
for event in future_events:
|
||||
if event.name not in state.notified and event.begin.shift(days=-2) < arrow.now():
|
||||
logging.info(f"Sending description of {event.name}")
|
||||
await send_message(process_event(event, config.EVENT_TEMPLATE))
|
||||
state.notified.append(event.name)
|
||||
|
||||
if event.name not in state.notified_soon and event.begin.shift(hours=-2) < arrow.now():
|
||||
logging.info(f"Notifying of {event.name}")
|
||||
await send_message(process_event(event, config.SOON_TEMPLATE))
|
||||
state.notified_soon.append(event.name)
|
||||
|
||||
|
|
Loading…
Reference in a new issue