From ad3dcc2fddbce6516afe4e98ba03e8caf54f4727 Mon Sep 17 00:00:00 2001 From: kageru Date: Mon, 8 Jul 2019 12:40:45 +0200 Subject: [PATCH] add notify.py for discord status notifications --- notify.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 notify.py diff --git a/notify.py b/notify.py new file mode 100755 index 0000000..b1fe6e2 --- /dev/null +++ b/notify.py @@ -0,0 +1,15 @@ +#!/usr/bin/python +from discord import Client +from sys import argv +import asyncio + +async def main(target, message): + client = Client() + await client.login('your token') + user = await client.fetch_user(target) + await user.send(message) + await client.logout() + await client.close() + +if __name__ == '__main__': + loop = asyncio.get_event_loop().run_until_complete(main(*argv[1:]))