Skip to content

Commit

Permalink
update on message
Browse files Browse the repository at this point in the history
  • Loading branch information
MegumiKatou02 committed Nov 27, 2024
1 parent bde92f9 commit e9f0f4e
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions message.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
### This file can be customized to your liking <(")

import asyncio
import random
import re

import discord

greetings = ['chào', 'hello', 'hi', 'yo']

async def on_message_event(message, bot):
Expand Down Expand Up @@ -32,6 +36,29 @@ async def on_message_event(message, bot):
if not message.author.bot and re.search(r'\bchinh beo\b$', message.content.lower()):
await message.channel.send('Co m bel ay')

if not message.author.bot and message.content.lower() == "o o":
emojis = ["🐣", "🐔"]
try:
for emoji in emojis:
if emoji:
await message.add_reaction(emoji)
except discord.HTTPException as e:
print(f"Không thể thêm reaction: {e}")

if not message.author.bot and re.search(r'\ban co\b$', message.content.lower()):
emoji = random.choice(["🐂", "🐄"])
try:
await message.add_reaction(emoji)
except discord.HTTPException as e:
print(f"Không thể thêm reaction: {e}")

if not message.author.bot and re.search(r'\băn cỏ\b$', message.content.lower()):
emoji = random.choice(["🐂", "🐄"])
try:
await message.add_reaction(emoji)
except discord.HTTPException as e:
print(f"Không thể thêm reaction: {e}")

if bot.user.mentioned_in(message) and not message.author.bot:
hello_message = await message.channel.send("Nhấn `/help` để biết thêm thông tin !")

Expand Down

0 comments on commit e9f0f4e

Please sign in to comment.