-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbotngu1.py
130 lines (104 loc) · 3.73 KB
/
botngu1.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
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
import discord
import requests
import json
import random
import db
intents = discord.Intents.default()
intents.message_content = True
client = discord.Client(intents=intents)
sad_words = ("buồn", "depressed", "unhappy", "chán", "sad")
name = ("nam","Nam",
"Hiệp","Hiep", "hiep", "hiệp",
"Hải", "hai","Hai","Hải","hải",
"Hà", "ha","hà","Ha",
"thái","thai","Thái",
"tùng","Tùng","tung",
"chử","Chử","chu",
"hoang","hoàng","Hoàng",
"huy","Huy",
"Tú","tú","Tu",
"Vinh","vinh",
"tùng","Tùng")
name1 = ("thịnh","thinh","Thịnh")
starter_encouragements = (
"kệ mẹ mày.",
"buồn con mẹ mày",
"đéo quan tâm"
)
chuichetmemay = ("ăn cứt",
"óc con chó",
"con mẹ mày loz to",
"là 1 con súc vật",
"cả nhà ăn cứt",
"cả nhà chết sạch"
)
nice=("Đẹp zai","Khoai to","Cu bự")
# if "responding" not in db.keys():
# db["responding"] = True
def get_quote():
response = requests.get("https://zenquotes.io/api/random")
json_data = json.loads(response.text)
quote = json_data[0]["q"] + " -" + json_data[0]["a"]
return(quote)
# def update_encouragements(encouraging_message):
# if "encouragements" in db.keys():
# encouragements = db["encouragements"]
# encouragements.append(encouraging_message)
# db["encouragements"] = encouragements
# else:
# db["encouragements"] = [encouraging_message]
# def delete_encouragment(index):
# encouragements = db["encouragements"]
# if len(encouragements) > index:
# del encouragements[index]
# db["encouragements"] = encouragements
@client.event
async def on_ready():
print("We have logged in as {0.user}".format(client))
@client.event
async def on_message(message):
if message.author == client.user:
return
msg = message.content
if msg.startswith("đạo lý"):
quote = get_quote()
await message.channel.send(quote)
if msg.startswith (sad_words):
await message.channel.send(random.choice(starter_encouragements))
if msg.startswith (name):
await message.channel.send(msg + " "+ random.choice(chuichetmemay))
if msg.startswith (name1):
await message.channel.send(msg +" " + random.choice(nice))
# if msg in sad_words:
# await message.channel.send(random.choice(starter_encouragements))
# if db["responding"]:
# options = starter_encouragements
# if "encouragements" in db.keys():
# options = options + db["encouragements"]
# if msg.startswith (sad_words):
# await message.channel.send(random.choice(starter_encouragements))
# if msg.startswith("$new"):
# encouraging_message = msg.split("$new ",1)[1]
# update_encouragements(encouraging_message)
# await message.channel.send("New encouraging message added.")
# if msg.startswith("$del"):
# encouragements = []
# if "encouragements" in db.keys():
# index = int(msg.split("$del",1)[1])
# delete_encouragment(index)
# encouragements = db["encouragements"]
# await message.channel.send(encouragements)
# if msg.startswith("$list"):
# encouragements = []
# if "encouragements" in db.keys():
# encouragements = db["encouragements"]
# await message.channel.send(encouragements)
# if msg.startswith("$responding"):
# value = msg.split("$responding ",1)[1]
# if value.lower() == "true":
# db["responding"] = True
# await message.channel.send("Responding is on.")
# else:
# db["responding"] = False
# await message.channel.send("Responding is off.")
client.run("MTAxNDA2OTg0NzI3MDg4NzQyNA.GWf_AO.Er9k_jBEXXp8Tbux5D0UQ77BBArbW_fY3PVcXA")