mirror of
https://github.com/PaiGramTeam/PaiGram.git
synced 2024-11-16 12:51:35 +00:00
Modify function to contain unused parameters
This commit is contained in:
parent
e334554baf
commit
bb77a52918
@ -56,11 +56,12 @@ class Auth:
|
||||
return True
|
||||
except BadRequest as error:
|
||||
if "not found" in str(error):
|
||||
Log.warning(f"Auth模块删除消息 chat_id[{chat_id}] message_id[{message_id}]失败 消息不存在")
|
||||
Log.warning(f"Auth模块删除消息 chat_id[{chat_id}] user_id[{user_id}] message_id[{message_id}]失败 消息不存在")
|
||||
elif "Message can't be deleted" in str(error):
|
||||
Log.warning(f"Auth模块删除消息 chat_id[{chat_id}] message_id[{message_id}]失败 消息无法删除 可能是没有授权")
|
||||
Log.warning(
|
||||
f"Auth模块删除消息 chat_id[{chat_id}] user_id[{user_id}] message_id[{message_id}]失败 消息无法删除 可能是没有授权")
|
||||
else:
|
||||
Log.error(f"Auth模块删除消息 chat_id[{chat_id}] message_id[{message_id}]失败 \n", error)
|
||||
Log.error(f"Auth模块删除消息 chat_id[{chat_id}] user_id[{user_id}] message_id[{message_id}]失败 \n", error)
|
||||
return False
|
||||
|
||||
@staticmethod
|
||||
|
@ -18,7 +18,7 @@ class Inline:
|
||||
def __init__(self, service: BaseService):
|
||||
self.service = service
|
||||
|
||||
async def inline_query(self, update: Update, context: CallbackContext) -> None:
|
||||
async def inline_query(self, update: Update, _: CallbackContext) -> None:
|
||||
user = update.effective_user
|
||||
ilq = cast(InlineQuery, update.inline_query)
|
||||
query = ilq.query
|
||||
|
@ -161,7 +161,7 @@ class Post(BasePlugins):
|
||||
await message.reply_text(text, reply_markup=ReplyKeyboardMarkup(reply_keyboard, one_time_keyboard=True))
|
||||
return self.CHECK_COMMAND
|
||||
|
||||
async def get_channel(self, update: Update, context: CallbackContext) -> int:
|
||||
async def get_channel(self, update: Update, _: CallbackContext) -> int:
|
||||
message = update.message
|
||||
reply_keyboard = []
|
||||
try:
|
||||
@ -197,7 +197,7 @@ class Post(BasePlugins):
|
||||
reply_markup=ReplyKeyboardMarkup(reply_keyboard, one_time_keyboard=True))
|
||||
return self.SEND_POST
|
||||
|
||||
async def add_tags(self, update: Update, context: CallbackContext) -> int:
|
||||
async def add_tags(self, update: Update, _: CallbackContext) -> int:
|
||||
message = update.message
|
||||
await message.reply_text("请回复添加的tag名称,如果要添加多个tag请以空格作为分隔符")
|
||||
return self.GET_TAGS
|
||||
|
@ -129,7 +129,7 @@ class Quiz(BasePlugins):
|
||||
self._add_delete_message_job(context, poll_message.chat_id, poll_message.message_id, 300)
|
||||
return ConversationHandler.END
|
||||
|
||||
async def view_command(self, update: Update, context: CallbackContext) -> int:
|
||||
async def view_command(self, update: Update, _: CallbackContext) -> int:
|
||||
keyboard = [
|
||||
[
|
||||
InlineKeyboardButton(text="选择问题", switch_inline_query_current_chat="查看问题 ")
|
||||
@ -139,7 +139,7 @@ class Quiz(BasePlugins):
|
||||
reply_markup=InlineKeyboardMarkup(keyboard))
|
||||
return self.CHECK_COMMAND
|
||||
|
||||
async def check_question(self, update: Update, context: CallbackContext) -> int:
|
||||
async def check_question(self, update: Update, _: CallbackContext) -> int:
|
||||
reply_keyboard = [
|
||||
["删除问题"],
|
||||
["退出"]
|
||||
@ -176,7 +176,7 @@ class Quiz(BasePlugins):
|
||||
await update.message.reply_text("命令错误", reply_markup=ReplyKeyboardRemove())
|
||||
return ConversationHandler.END
|
||||
|
||||
async def refresh_question(self, update: Update, context: CallbackContext) -> int:
|
||||
async def refresh_question(self, update: Update, _: CallbackContext) -> int:
|
||||
try:
|
||||
await self.service.quiz_service.refresh_quiz()
|
||||
except DataError:
|
||||
|
@ -30,6 +30,5 @@ async def ping(update: Update, _: CallbackContext) -> None:
|
||||
await update.message.reply_text("online! ヾ(✿゚▽゚)ノ")
|
||||
|
||||
|
||||
async def reply_keyboard_remove(update: Update, context: CallbackContext) -> None:
|
||||
async def reply_keyboard_remove(update: Update, _: CallbackContext) -> None:
|
||||
await update.message.reply_text("移除远程键盘成功", reply_markup=ReplyKeyboardRemove())
|
||||
# await context.bot.delete_message(chat_id=update.message.chat_id, message_id=update.message.message_id)
|
||||
|
@ -59,14 +59,14 @@ class RedisCache:
|
||||
await self.client.lpush(qname + ":id_list", *question_id_list)
|
||||
return await self.client.llen(qname + ":id_list")
|
||||
|
||||
async def del_all_question(self, answer_list: List[AnswerData] = None):
|
||||
async def del_all_question(self):
|
||||
qname = "quiz:question"
|
||||
keys = await self.client.keys(qname + "*")
|
||||
if keys is not None:
|
||||
for key in keys:
|
||||
await self.client.delete(key)
|
||||
|
||||
async def del_all_answer(self, answer_list: List[AnswerData] = None):
|
||||
async def del_all_answer(self):
|
||||
qname = "quiz:answer"
|
||||
keys = await self.client.keys(qname + "*")
|
||||
if keys is not None:
|
||||
|
Loading…
Reference in New Issue
Block a user