Skip to content

Commit

Permalink
Create Yre2.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Badhacker98 authored Oct 17, 2024
1 parent a0193e8 commit 137bbad
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions shizuchat/modules/Yre2.py
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

0 comments on commit 137bbad

Please sign in to comment.