-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnewbotlogic.py
More file actions
148 lines (127 loc) · 3.34 KB
/
newbotlogic.py
File metadata and controls
148 lines (127 loc) · 3.34 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
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
import random
import requests
from servers import server_list
import json
def switcher_func(string,ip):
string = string.lower()
phrase_list = string.split()
switcher = {
1: super_rando(phrase_list),
2: shmirator(phrase_list),
3: random_server(string),
4: bruh(phrase_list),
# 5: location(ip),
}
response = switcher.get(random.randint(1,4))
return response
snippets = [
'I think that',
'all is',
'seeing that',
'bark bark',
'sippin on',
'everything in life',
]
pronouns = ['I', 'me', 'We', 'us']
verbs1 = ['have',
'own',
'possess',
'lack',
'consist',
'involve',
'include',
'contain', ]
verbs2 = ['Love',
'Like',
'Dislike',
'Hate',
'Adore',
'Prefer',
'Care for',
'Mind',
'Want',
'Need',
'Desire',
'Wish',
'Hope',
'Appreciate',
'Value', ]
adejctives = [
'open',
'awake',
'temporary',
'handsomely',
'plant',
'languid',
'special',
'narrow',
'lumpy',
'awesome',
'valuable',
'is cancelled',
]
objects = ['toaster',
'shoes',
'burger',
'bike pump',
'happiness',
'balls',
'poop',
'doodooface', ]
def random_response(word):
words = ['poop', 'toot', 'boop', 'snoot']
words.append(word)
response = words[random.randint(0, len(words)-1)]
print(words)
return response
def super_rando(phrase_list):
# phrase_list = user_phrase.split()
comp = [snippets, pronouns, verbs1, verbs2, adejctives, objects, phrase_list]
amount_of_words = random.randint(2, 10)
structure = []
separator = ' '
for i in range(0, amount_of_words):
type_of_word = comp[random.randint(0, len(comp)-1)]
word = type_of_word[random.randint(0, len(type_of_word)-1)]
structure.append(word)
return (separator.join(structure))
def shmirator(phrase_list):
# phrase_list = user_phrase.split()
new_phrase = []
separator = ' '
vowels = ['a','e','i','o','u']
for word in phrase_list:
if len(word) <= 1 or word[0] in vowels:
shword = 'shm'+str(word)
else:
shword = 'shm'+(word[1:])
new_phrase.append(shword)
return (separator.join(new_phrase))
def random_server(string):
server = server_list[random.randint(0,len(server_list)-1)]
print(server+string)
r = requests.get(server+string).content
r = json.loads(r)
r = r["message"]+'courtesy of ' + server
return(r)
def bruh(phrase_list):
amount = len(phrase_list)
bruh = 'bruh '
response = bruh * amount
return response
def location(ip):
print(ip)
response = requests.get('http://ipinfo.io/json/'+str(ip))
print(response)
data = response.json()
print(data)
org=data['org']
city = data['city']
country=data['country']
region=data['region']
loc = data['loc']
phrase = f'it\s the first time someone from{city} talsk to me like that'
# print('Your IP detail\n ')
# print ('IP : {4} \nRegion : {1} \nCountry : {2} \nCity : {3} \nOrg : {0}'.format(org,region,country,city,IP))
return phrase
# print(bruh(['hello', 'there']))