-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtasks.py
More file actions
34 lines (29 loc) Β· 1.51 KB
/
Copy pathtasks.py
File metadata and controls
34 lines (29 loc) Β· 1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
from twilio.rest import Client
from invoke import task
import os
@task
def lunch_reminder(ctx):
client = Client(os.environ['TWILIO_ACCOUNT_SID'], os.environ['TWILIO_AUTH_TOKEN'])
client.messages.create(to=os.environ['MAX_PHONE'], from_="ZigguratBot", body="π Bring your lunch to work. It's in the fridge.")
@task
def compliment(ctx):
client = Client(os.environ['TWILIO_ACCOUNT_SID'], os.environ['TWILIO_AUTH_TOKEN'])
client.messages.create(to=os.environ['MAX_PHONE'], from_="ZigguratBot", body="Beep boop. Also you are nice. β¨")
@task
def rubbish_reminder(ctx, recycling=False):
client = Client(os.environ['TWILIO_ACCOUNT_SID'], os.environ['TWILIO_AUTH_TOKEN'])
if recycling:
message = "β»οΈ! Recycling and general rubbish needs to go out tonight."
client.messages.create(to=os.environ['HOUSE_PHONES'], from_="ZigguratBot", body=message)
else:
message = "ποΈποΈποΈ The rubbish bin needs to go out tonight. No recycling this week."
client.messages.create(to=os.environ['HOUSE_PHONES'], from_="ZigguratBot", body=message)
@task
def test(ctx, unicorns=False):
client = Client(os.environ['TWILIO_ACCOUNT_SID'], os.environ['TWILIO_AUTH_TOKEN'])
if unicorns:
message = "OMG unicorns! π¦π¦π¦"
client.messages.create(to=os.environ['LILLY_PHONE'], from_="ZigguratBot", body=message)
else:
message = "The unicorn escaped. π«π¦"
client.messages.create(to=os.environ['LILLY_PHONE'], from_="ZigguratBot", body=message)