Sends messages on warning being revoked (#36)
This commit is contained in:
@@ -3,7 +3,7 @@ from app import app
|
||||
from pyrogram import filters
|
||||
from pyrogram.types import CallbackQuery
|
||||
from pyrogram.client import Client
|
||||
from modules.utils import locale
|
||||
from modules.utils import configGet, locale
|
||||
from modules.database import col_warnings
|
||||
from bson import ObjectId
|
||||
|
||||
@@ -25,3 +25,9 @@ async def callback_query_warning_revoke(app: Client, clb: CallbackQuery):
|
||||
text=locale("warning_revoked", "callback", locale=clb.from_user).format(),
|
||||
show_alert=True,
|
||||
)
|
||||
await app.send_message(
|
||||
configGet("admin", "groups"),
|
||||
locale("warning_revoked_auto", "message").format(
|
||||
warning["user"], warning["date"].strftime("%d.%m.%Y")
|
||||
),
|
||||
)
|
||||
|
@@ -224,6 +224,12 @@ if configGet("enabled", "features", "warnings") is True:
|
||||
logWrite(
|
||||
f'Revoked warning {str(warning["_id"])} of user {warning["user"]} because no active warnings for the last 90 days found.'
|
||||
)
|
||||
await app.send_message(
|
||||
configGet("admin", "groups"),
|
||||
locale("warning_revoked_auto", "message").format(
|
||||
warning["user"], warning["date"].strftime("%d.%m.%Y")
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
# Register all bot commands
|
||||
|
Reference in New Issue
Block a user