bombsquad-plugin-manager/plugins/utilities/topmsg.py

34 lines
761 B
Python
Raw Normal View History

2025-08-03 13:53:51 +03:00
# Copyright 2025 - Solely by BrotherBoard
# Intended for personal use only
# Bug? Feedback? Telegram >> @BroBordd
2024-05-16 18:44:57 +03:00
2025-08-03 13:53:51 +03:00
"""
TopMsg v1.1.2 - Chat top right
2024-05-16 16:07:23 +00:00
2025-08-03 13:53:51 +03:00
When chat is muted, shows chat messages top right.
Prevents spam and flooding screen.
Does not repeat messages.
"""
2025-06-23 19:27:10 +00:00
2025-08-03 13:53:51 +03:00
from babase import app, Plugin
from bascenev1 import (
get_chat_messages as gcm,
broadcastmessage as push,
apptimer as z
)
2025-06-23 19:27:10 +00:00
2025-08-03 13:53:51 +03:00
# ba_meta require api 9
# ba_meta export babase.Plugin
2025-08-10 13:02:22 +00:00
2025-08-03 13:53:51 +03:00
class byBordd(Plugin):
2025-08-10 13:02:22 +00:00
def __init__(s): return (setattr(s, 'la', None), z(5, s.ear))[1]
2024-05-16 18:44:57 +03:00
def ear(s):
a = gcm()
if a and s.la != a[-1]:
2024-05-16 16:07:23 +00:00
if app.config.resolve('Chat Muted'):
2025-08-10 13:02:22 +00:00
push(a[-1], (1, 1, 1), True)
2024-05-16 18:44:57 +03:00
s.la = a[-1]
z(0.1, s.ear)