add notify.py for discord status notifications

This commit is contained in:
kageru 2019-07-08 12:40:45 +02:00 committed by Max Niewisch
commit ad3dcc2fdd

15
notify.py Executable file

@ -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:]))