-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.py
67 lines (53 loc) · 1.91 KB
/
app.py
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import os
import json
from urllib.parse import urlencode
from urllib.request import Request, urlopen
from flask import Flask, request
app = Flask(__name__)
"""
Things to add
- Something
"""
@app.route('/', methods=['POST'])
def webhook():
data = request.get_json()
if data['name'] != "Easton":
if data['name'] == 'Colin Walton':
if "left nut" in data['text']:
msg = "Suck my right nut"
send_message(msg)
elif data['created_at']%14 == 0:
msg = 'Shut up Colin'
send_message(msg)
if "Hi Easton" in data['text']:
if data['name'] == "Christian Walton" or data['name'] == "Colin Walton" or data['name'] == 'Dane':
msg = "Wadddup uncle"
send_message(msg)
elif data['name'] == "Jennifer Webb Walton":
msg = "Hi Grandmaaaa!!"
send_message(msg)
elif data['name'] == "Steven Walton":
msg = "Hey Gramps!"
send_message(msg)
elif data['name'] == "Devin Walton":
msg = "Hi Mom :)"
send_message(msg)
elif data['name'] == "Itz Ya Boi T Chainz":
msg = "Sup Papa Post"
send_message(msg)
if "Easton" in data['text']:
if data['created at']%2 == 0:
msg = "Hey hi thats me I'm cute as shit"
send_message(msg)
if "droppin" in data['text'] or "dropping" in data['text']:
msg = "I only drop Tilted Titties because Papa Post and Mum didn't raise no bitch"
send_message(msg)
return "ok", 200
def send_message(msg):
url = 'https://api.groupme.com/v3/bots/post'
data = {
'bot_id' : os.getenv('GROUPME_BOT_ID'),
'text' : msg,
}
request = Request(url, urlencode(data).encode())
json = urlopen(request).read().decode()