Add changelog command that takes changelog from the CHANGELOG.md file (last major update)

pull/16/head
Who? 2024-11-18 09:06:17 +07:00 committed by GitHub
commit 8e49dc79c9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 14 additions and 0 deletions

View File

@ -385,6 +385,7 @@ update_notifier:
latest_disabled: "Notifications about the latest update have been suppressed"
update: "🔄 Update"
ignore: "🚫 Ignore"
changelog: '<emoji document_id=5434144690511290129>📰</emoji> <b>Changelog of the last major update:</b>\n<pre><code class="language-hikka">{}</code></pre>'
_cls_doc: "Tracks latest Hikka releases, and notifies you, if update is required"
updater:

View File

@ -367,6 +367,7 @@ update_notifier:
latest_disabled: "Уведомления о последнем обновлении были отключены"
update: "🔄 Обновить"
ignore: "🚫 Игнорировать"
changelog: '<emoji document_id=5434144690511290129>📰</emoji> <b>Список изменений последнего крупного обновления:</b>\n<pre><code class="language-hikka">{}</code></pre>'
updater:
source: "<emoji document_id=5456255401194429832>📖</emoji> <b>Исходный код можно прочитать</b> <a href='{}'>здесь</a>"

View File

@ -367,6 +367,7 @@ update_notifier:
latest_disabled: "Повідомлення про останнє оновлення було вимкнено"
update: "🔄 Оновити"
ignore: "🚫 Ігнорувати"
changelog: '<emoji document_id=5434144690511290129>📰</emoji> <b>Список змін останнього великого оновлення:</b>\n<pre><code class="language-hikka">{}</code></pre>'
updater:
source: "<emoji document_id=5456255401194429832>📖</emoji> <b>Вихідний код можна прочитати</b> <a href='{}'>тут</a>"

View File

@ -11,6 +11,7 @@ import git
from .. import loader, utils, version
from ..inline.types import InlineCall
from ..types import Message
@loader.tds
@ -137,3 +138,13 @@ class UpdateNotifier(loader.Module):
await call.delete()
await self.invoke("update", "-f", peer=self.inline.bot_username)
@loader.command()
async def changelog(self, message: Message):
"""Shows the changelog of the last major update"""
with open('CHANGELOG.md', mode='r', encoding='utf-8') as f:
changelog = f.read().split('##')[1].strip()
if (await self._client.get_me()).premium:
changelog.replace('🌑 Hikka', '<emoji document_id=5192765204898783881>🌘</emoji><emoji document_id=5195311729663286630>🌘</emoji><emoji document_id=5195045669324201904>🌘</emoji>')
await utils.answer(message, self.strings('changelog').format(changelog))