-
Notifications
You must be signed in to change notification settings - Fork 0
/
shopee.py
138 lines (128 loc) · 2.41 KB
/
shopee.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
131
132
133
134
135
136
137
138
# This example requires the 'message_content' intent.
import os, re, random
import discord
intents = discord.Intents.default()
intents.message_content = True
client = discord.Client(intents=intents)
words = [
"เหงา",
"ส่วนลด",
"คิดมุขก่อน",
]
words_re = re.compile("|".join(words) ,re.IGNORECASE)
CODES = [
"SSIS-440",
"PRED-403",
"IPX-258",
"SHKD-772",
"FSDSS-115",
"STARS-157",
"MEYD-540",
"PPPD-807",
"SSIS-195",
"MEYD-605",
"SSIS-260",
"FSDSS-092",
"IPX-750",
"SW-331",
"SCOP-707",
"SSNI-984",
"FSDSS-099",
"IPX-597",
"MIDE-715",
"GENM-069",
"IPX-293",
"STARS-304",
"YMDD-177",
"SDAB-154",
"IPX-581",
"FSDSS-077",
"GENM-060",
"ATID-410",
"MIAA-253",
"MIFD-108",
"SSNI-734",
"SHN-018",
"IPX-494",
"SDJS-095",
"FSDSS-079",
"UMD-763",
"SNIS-939",
"SSNI-733",
"MIDE-850",
"SSNI-799",
"IPX-091",
"MIDE-570",
"MEYD-642",
"XVSR-060",
"CSCT-004",
"IMO-010",
"SSNI-546",
"ABW-023",
"KMHRS-018",
"FSDSS-014",
"SDDE-606",
"SSNI-569",
"IPX-484",
"HND-893",
"SSNI-749",
"CSCT-002",
"JUFD-660",
"IPX-451",
"SDJS-098",
"WAAA-013",
"GENM-047",
"FSDSS-019",
"IPX-414",
"CAWD-120",
"SSNI-674",
"MDTM-741",
"IPX-586",
"GENM-033",
"DOCP-211",
"MKMP-320",
"SHKD-897",
"FSDSS-026",
"IPX-469",
"CAWD-065",
"SIM-067",
"BF-605",
"MEYD-583",
"IPX-455",
"MIDE-083",
"ADN-243",
"SSNI-751",
"SHKD-898",
"ABP-889",
"SHKD-811",
"RKI-605",
"SSNI-746",
"SHKD-836",
"ABP-210",
"MIDV-206",
"MIAA-041",
"SDJS-101",
"BF-576",
"HND-723",
"ABW-295",
"IPX-518",
"REBDB-660",
"MIMK-070",
"PPPD-807",
"MIDV-161",
"ROYD-107",
]
@client.event
async def on_ready():
print(f'We have logged in as {client.user}')
@client.event
async def on_message(message):
# bot
if message.author == client.user:
return
# detected
elif words_re.search(message.content):
mention = message.author.mention
code = random.choice(CODES)
await message.channel.send("{} คุณได้รับโค้ดส่วนลดจากช้อปปี้ `{}`".format(mention, code))
client.run(os.getenv('DISCORD_SHP'))