Skip to content

Commit

Permalink
🔧 refactor(cli): use real_pack_name for consistency in sticker pack n…
Browse files Browse the repository at this point in the history
…aming

🔖 chore(release): update version to 0.1.12 in pyproject.toml
  • Loading branch information
sudoskys committed Oct 10, 2024
1 parent 5d323ab commit 7cd25b2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "tsticker"
version = "0.1.11"
version = "0.1.12"
description = "Telegram sticker management tool"
authors = [
{ name = "sudoskys", email = "coldlando@hotmail.com" },
Expand Down
5 changes: 3 additions & 2 deletions src/tsticker/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,10 +342,11 @@ async def init(
return
console.print(f"[bold blue]Pack directory inited:[/] {sticker_dir}")
index_file = sticker_dir.joinpath("index.json")
real_pack_name = bot_setting.make_set_name(bot_setting.pack_name, bot_setting.bot_user.username)
index_file.write_text(
StickerPack.create(
title=bot_setting.pack_title,
name=bot_setting.make_set_name(bot_setting.pack_name, bot_setting.bot_user.username),
name=real_pack_name,
sticker_type=bot_setting.sticker_type,
operator_id=str(bot_setting.bot_user.id)
).model_dump_json(indent=2)
Expand All @@ -354,7 +355,7 @@ async def init(
app = StickerApp(bot_setting)
with console.status("[bold blue]Retrieving sticker...[/]", spinner='dots'):
try:
sticker_set = await limited_request(app.bot.get_sticker_set(bot_setting.pack_name))
sticker_set = await limited_request(app.bot.get_sticker_set(real_pack_name))
except Exception as e:
if "STICKERSET_INVALID" in str(e):
sticker_set = None
Expand Down

0 comments on commit 7cd25b2

Please sign in to comment.