removed *.save files

This commit is contained in:
nocturn9x 2020-06-06 12:37:30 +00:00
parent 5a0ad4a199
commit aa9b14cb3b
1 changed files with 0 additions and 43 deletions

View File

@ -1,43 +0,0 @@
from pyrogram import Client, Filters, InlineKeyboardButton, InlineKeyboardMarkup
from .antiflood import BANNED_USERS
from ..config import GREET, BUTTONS, CREDITS
from ..database.query import get_users, set_user
import logging
import itertools
from ..methods.safe_send import send_message
from ..methods.safe_edit import edit_message_text
@Client.on_message(Filters.command("start") & ~BANNED_USERS & Filters.private)
def start_handler(client, message):
"""Simply handles the /start command sending a pre-defined greeting
and saving new users to the database"""
if message.from_user.first_name:
name = message.from_user.first_name
elif message.from_user.username:
name = message.from_user.username
else:
name = "Anonymous"
if message.from_user.id not in itertools.chain(*get_users()):
logging.warning(f"New user detected ({message.from_user.id}), adding to database")
set_user(message.from_user.id, None if not message.from_user.username else message.from_user.username)
if GREET:
send_message(client,
message.chat.id,
GREET.format(mention=f"[{name}](tg://user?id={message.from_user.id})",
id=message.from_user.id,
username=message.from_user.username
),
reply_markup=BUTTONS
)
@Client.on_callback_query(Filters.callback_data("info"))
def bot_info(_, query):
buttons = InlineKeyboardMarkup([[InlineKeyboardButton("🔙 Back", "back_start")]])
edit_message_text(query, CREDITS, reply_markup=buttons)
@Client.on_callback_query(Filters.callback_data("back_start"))
def