Skip to content

Commit

Permalink
fix some bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
omg-xtao committed Mar 6, 2023
1 parent f6cb35f commit 208433d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion plugins/genshin/avatar_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ async def avatar_list(self, update: Update, context: CallbackContext):

logger.info("用户 %s[%s] [bold]练度统计[/bold]: all=%s", user.full_name, user.id, all_avatars, extra={"markup": True})

client = await self.get_user_client(user, message, context)
client = await self.get_user_client(update, context)
if not client:
return

Expand Down
5 changes: 4 additions & 1 deletion plugins/genshin/ledger.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,10 @@ def format_amount(amount: int) -> str:

@handler.command(command="ledger", block=False)
@handler.message(filters=filters.Regex("^旅行札记查询(.*)"), block=False)
async def command_start(self, update: Update, context: CallbackContext) -> None:
async def command_start(self, update: Update, _: CallbackContext) -> None:
user = update.effective_user
message = update.effective_message

now = datetime.now()
now_time = (now - timedelta(days=1)) if now.day == 1 and now.hour <= 4 else now
month = now_time.month
Expand Down
3 changes: 2 additions & 1 deletion plugins/tools/genshin.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from typing import Optional, Tuple, Union, TYPE_CHECKING

import genshin
from genshin.errors import GenshinException
from genshin.models import BaseCharacter
from genshin.models import CalculatorCharacterDetails
from pydantic import ValidationError
Expand All @@ -25,7 +26,7 @@

if TYPE_CHECKING:
from sqlalchemy import Table
from genshin import Client as GenshinClient, GenshinException
from genshin import Client as GenshinClient

__all__ = ("GenshinHelper", "PlayerNotFoundError", "CookiesNotFoundError")

Expand Down

0 comments on commit 208433d

Please sign in to comment.