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>",
|
"🌘 <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
|
||||||
|
|
|
@ -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(),
|
||||||
),
|
),
|
||||||
|
|
|
@ -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
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue