Co-authored-by: Aakash <BLUE-DEVIL1134@users.noreply.github.com> Co-authored-by: Aditya <me@xditya.me> Co-authored-by: Danish <danish@ultroid.tech> Co-authored-by: buddhhu <buddhuu@users.noreply.github.com> Co-authored-by: sppidy <sppidy@users.noreply.github.com> Co-authored-by: Arnab Paryali <Arnabxd@users.noreply.github.com> Co-authored-by: divkix <divkix@users.noreply.github.com> Co-authored-by: hellboi_atul <hellboi-atul@users.noreply.github.com> Co-authored-by: Programming Error <error@notavailable.live> Co-authored-by: New-dev0 <New-dev0@notavailable.live>
45 lines
1.2 KiB
Python
45 lines
1.2 KiB
Python
# Ultroid - UserBot
|
|
# Copyright (C) 2020 TeamUltroid
|
|
#
|
|
# This file is a part of < https://github.com/TeamUltroid/Ultroid/ >
|
|
# PLease read the GNU Affero General Public License in
|
|
# <https://www.github.com/TeamUltroid/Ultroid/blob/main/LICENSE/>.
|
|
"""
|
|
✘ Commands Available -
|
|
• `{i}update`
|
|
See changelogs if any update is available.
|
|
"""
|
|
|
|
from . import *
|
|
from git import Repo
|
|
|
|
|
|
@ultroid_cmd(pattern="update$")
|
|
async def _(e):
|
|
x = await updater()
|
|
branch = (Repo.init()).active_branch
|
|
if x is not None:
|
|
await eor(
|
|
e,
|
|
f'<strong><a href="t.me/c/{x.peer_id.channel_id}/{x.id}">[ChangeLogs]</a></strong>',
|
|
parse_mode="html",
|
|
link_preview=False,
|
|
)
|
|
else:
|
|
await eor(
|
|
e,
|
|
f'<code>Your BOT is </code><strong>up-to-date</strong><code> with </code><strong><a href="https://github.com/TeamUltroid/Ultroid/tree/{branch}">[{branch}]</a></strong>',
|
|
parse_mode="html",
|
|
link_preview=False,
|
|
)
|
|
|
|
|
|
@callback("updtavail")
|
|
@owner
|
|
async def updava(event):
|
|
await event.delete()
|
|
await updater()
|
|
|
|
|
|
HELP.update({f"{__name__.split('.')[1]}": f"{__doc__.format(i=HNDLR)}"})
|