mirror of https://github.com/coddrago/Heroku
Minor fixes
parent
212a1a3f59
commit
fd749d3189
Binary file not shown.
Before Width: | Height: | Size: 244 KiB After Width: | Height: | Size: 186 KiB |
|
@ -631,6 +631,7 @@ class HikkaConfigMod(loader.Module):
|
|||
"🌘 <b>Loading configuration</b>",
|
||||
message,
|
||||
{"text": "🌘", "data": "empty"},
|
||||
ttl=24 * 60 * 60,
|
||||
)
|
||||
await self.inline__configure(form, args)
|
||||
return
|
||||
|
|
|
@ -74,7 +74,7 @@ class HikkaInfoMod(loader.Module):
|
|||
),
|
||||
loader.ConfigValue(
|
||||
"banner_url",
|
||||
"https://i.imgur.com/XYNawuK.jpeg",
|
||||
"https://github.com/hikariatama/assets/raw/master/hikka_banner.png",
|
||||
lambda: self.strings("_cfg_banner"),
|
||||
validator=loader.validators.Link(),
|
||||
),
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
# 🌐 https://www.gnu.org/licenses/agpl-3.0.html
|
||||
|
||||
import asyncio
|
||||
import contextlib
|
||||
import functools
|
||||
import io
|
||||
import json
|
||||
|
@ -82,6 +83,7 @@ from telethon.tl.types import (
|
|||
PeerUser,
|
||||
User,
|
||||
Chat,
|
||||
UpdateNewChannelMessage,
|
||||
)
|
||||
|
||||
from .inline.types import InlineCall, InlineMessage
|
||||
|
@ -466,13 +468,25 @@ async def set_avatar(
|
|||
else:
|
||||
return False
|
||||
|
||||
await client(
|
||||
res = await client(
|
||||
EditPhotoRequest(
|
||||
channel=peer,
|
||||
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
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue