-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a0193e8
commit 137bbad
Showing
1 changed file
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import asyncio | ||
from os import remove | ||
from pyrogram import Client, filters | ||
from pyrogram.enums import ChatType | ||
from pyrogram.types import Message | ||
from datetime import datetime | ||
from time import time | ||
from pyrogram.errors import MessageDeleteForbidden, RPCError | ||
from asyncio import sleep | ||
from pyrogram import Client, enums | ||
from pyrogram.types import Message, User | ||
from pyrogram import Client, enums, filters | ||
from pyrogram import Client, enums, filters, raw | ||
from pyrogram.errors.exceptions.bad_request_400 import ChatNotModified | ||
from shizuchat import shizuchat | ||
from pyrogram.types import ChatPermissions, Message | ||
from os import getenv | ||
from dotenv import load_dotenv | ||
import random | ||
|
||
CMDS = [" ","sukh"] | ||
|
||
@shizuchat.on_message(filters.command(CMDS, prefixes=[""])) | ||
async def handle_incoming_messages(client, message): | ||
reactions = ['👍','❤️','🔥','🥰','👏','😁','🤩','👌','🥱','😍','❤️🔥','💯','🤣','⚡️','😴','👀','🙈','🤝','🤗','🤪','💘','😘','😎'] | ||
if not await react_to_message(client, message, random.choice(reactions)): | ||
print("All positive reactions failed.") | ||
return | ||
|
||
async def react_to_message(client, message, reactions): | ||
for reaction in reactions: | ||
try: | ||
if hasattr(message, 'id'): | ||
await client.send_reaction(message.chat.id, message.id, reactions) | ||
return True | ||
else: | ||
print("Message object does not have id attribute.") | ||
return False | ||
except Exception as e: | ||
print(f"An error occurred: {e}") | ||
continue | ||
return False |