-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdre.py
38 lines (28 loc) · 945 Bytes
/
dre.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
# This example requires the 'message_content' intent.
import os, re
import discord
intents = discord.Intents.default()
intents.message_content = True
client = discord.Client(intents=intents)
words = [
"เดร", "เ ด ร",
"dre", "d re", "dr e", "d r e",
"รักนะ", "คิดถึง", "คิถึง", "คิดถุง", "คิถุง",
]
words_re = re.compile("|".join(words) ,re.IGNORECASE)
@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
# not missing you
elif message.content.find("ไม่คิดถึง") > -1:
return
# someone say "dre"
elif words_re.search(message.content):
mention = message.author.mention
await message.channel.send("{} Dm me".format(mention))
client.run(os.getenv('DISCORD_DRE'))