forked from AeonOrg/Aeon-MLTB
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- No mood to write description.
- Loading branch information
Showing
19 changed files
with
164 additions
and
196 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
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
This file was deleted.
Oops, something went wrong.
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,24 @@ | ||
from random import choice | ||
from bot import bot, LOGGER | ||
|
||
async def send_react(message): | ||
try: | ||
chat_id = int(message.chat.id) | ||
chat_info = await bot.get_chat(chat_id) | ||
available_reactions = chat_info.available_reactions | ||
|
||
full_emoji_set = {'👌', '🔥', '🥰', '❤️', '❤️🔥', '💯', '⚡', '💋', '😘', '🤩', '😍'} | ||
|
||
if available_reactions: | ||
if getattr(available_reactions, "all_are_enabled", False): | ||
emojis = full_emoji_set | ||
else: | ||
emojis = {reaction.emoji for reaction in available_reactions.reactions} | ||
|
||
await message.react(choice(list(emojis)), big=True) | ||
except AttributeError as e: | ||
LOGGER.error(f"AttributeError: {e}") | ||
except TypeError as e: | ||
LOGGER.error(f"TypeError: {e}") | ||
except Exception as e: | ||
LOGGER.error(f"An unexpected error occurred: {e}") |
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
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
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
Oops, something went wrong.