def blockpm(client, message): if message.reply_to_message: reply = message.reply_to_message replied_user = reply.from_user if replied_user.is_self: edit(message, f'`{get_translation("cannotBlockMyself")}`') return aname = replied_user.id name0 = str(replied_user.first_name) uid = replied_user.id else: aname = message.chat if not aname.type == 'private': edit(message, f'`{get_translation("pmApproveError")}`') return name0 = aname.first_name uid = aname.id client.block_user(uid) edit(message, f'`{get_translation("pmBlocked")}`') try: from sedenecem.sql.pm_permit_sql import dissprove dissprove(uid) except BaseException: pass send_log(get_translation('pmBlockedLog', [name0, uid]))
def disapprovepm(message): try: from sedenecem.sql.pm_permit_sql import dissprove except BaseException: edit(message, f'`{get_translation("nonSqlMode")}`') return if message.reply_to_message: reply = message.reply_to_message replied_user = reply.from_user if replied_user.is_self: edit(message, f'`{get_translation("cannotDisapproveMyself")}`') return aname = replied_user.id name0 = str(replied_user.first_name) uid = replied_user.id else: aname = message.chat if not aname.type == 'private': edit(message, f'`{get_translation("pmApproveError")}`') return name0 = aname.first_name uid = aname.id dissprove(uid) edit(message, get_translation("pmDisapprove", [name0, uid, '`'])) send_log(get_translation("pmDisapprove", [name0, uid, '`']))