Minor fixes

pull/1/head
hikariatama 2022-06-12 17:14:22 +00:00
parent 212a1a3f59
commit fd749d3189
4 changed files with 17 additions and 2 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 244 KiB

After

Width:  |  Height:  |  Size: 186 KiB

View File

@ -631,6 +631,7 @@ class HikkaConfigMod(loader.Module):
"🌘 <b>Loading configuration</b>", "🌘 <b>Loading configuration</b>",
message, message,
{"text": "🌘", "data": "empty"}, {"text": "🌘", "data": "empty"},
ttl=24 * 60 * 60,
) )
await self.inline__configure(form, args) await self.inline__configure(form, args)
return return

View File

@ -74,7 +74,7 @@ class HikkaInfoMod(loader.Module):
), ),
loader.ConfigValue( loader.ConfigValue(
"banner_url", "banner_url",
"https://i.imgur.com/XYNawuK.jpeg", "https://github.com/hikariatama/assets/raw/master/hikka_banner.png",
lambda: self.strings("_cfg_banner"), lambda: self.strings("_cfg_banner"),
validator=loader.validators.Link(), validator=loader.validators.Link(),
), ),

View File

@ -27,6 +27,7 @@
# 🌐 https://www.gnu.org/licenses/agpl-3.0.html # 🌐 https://www.gnu.org/licenses/agpl-3.0.html
import asyncio import asyncio
import contextlib
import functools import functools
import io import io
import json import json
@ -82,6 +83,7 @@ from telethon.tl.types import (
PeerUser, PeerUser,
User, User,
Chat, Chat,
UpdateNewChannelMessage,
) )
from .inline.types import InlineCall, InlineMessage from .inline.types import InlineCall, InlineMessage
@ -466,13 +468,25 @@ async def set_avatar(
else: else:
return False return False
await client( res = await client(
EditPhotoRequest( EditPhotoRequest(
channel=peer, channel=peer,
photo=await client.upload_file(f, file_name="photo.png"), photo=await client.upload_file(f, file_name="photo.png"),
) )
) )
with contextlib.suppress(Exception):
await client.delete_messages(
peer,
message_ids=[
next(
update
for update in res.updates
if isinstance(update, UpdateNewChannelMessage)
).message.id
],
)
return True return True