mirror of https://github.com/coddrago/Heroku
commit
ba024ce9e6
|
@ -247,7 +247,7 @@ settings:
|
|||
_cmd_doc_blacklistuser: "[Benutzer] - Verhindert, dass ein Benutzer Befehle ausführt"
|
||||
_cmd_doc_cleardb: "Löscht die Datenbank"
|
||||
_cmd_doc_delalias: "Entfernt einen Alias für einen Befehl"
|
||||
_cmd_doc_hikka: "Zeigt die Version von Hikka an"
|
||||
_cmd_doc_heroku: "Zeigt die Version von Hikka an"
|
||||
_cmd_doc_setprefix: "<Präfix> - Setzt den Befehlspräfix"
|
||||
_cmd_doc_unblacklist: "[Chat] - Aktiviert den Bot an einem bestimmten Ort"
|
||||
_cmd_doc_unblacklistuser: "[Benutzer] - Erlaubt einem Benutzer, Befehle auszuführen"
|
||||
|
|
|
@ -159,7 +159,7 @@ heroku_settings:
|
|||
_cmd_doc_nonickuser: "Allow no nickname for certain user"
|
||||
_cmd_doc_nonickusers: "Returns the list of NoNick users"
|
||||
_cmd_doc_settings: "Show settings menu"
|
||||
_cmd_doc_uninstall_hikka: "Uninstall Heroku"
|
||||
_cmd_doc_uninstall_heroku: "Uninstall Heroku"
|
||||
_cmd_doc_watcherbl: "<module> - Toggle watcher in current chat"
|
||||
_cmd_doc_watcher: "<module> - Toggle global watcher rules\nArgs:\n[-c - only in chats]\n[-p - only in pm]\n[-o - only out]\n[-i - only incoming]"
|
||||
_cmd_doc_watchers: "List current watchers"
|
||||
|
@ -229,7 +229,20 @@ presets:
|
|||
|
||||
settings:
|
||||
name: "Settings"
|
||||
termux: "🕶 Termux"
|
||||
vds: "💎 VDS"
|
||||
railway: "🚂 Railway"
|
||||
jamhost: "🧃 JamHost"
|
||||
module_switch: "📁 Module Switching"
|
||||
userland: "🐧 UserLand"
|
||||
choose_installation: "<emoji document_id=5363805650327450240>🪐</emoji><b> Choose your Heroku installation option:</b>"
|
||||
installation: "<emoji document_id=5363805650327450240>▪️</emoji> The installation is very easy! Just enter the following in your servers terminal:\n<pre><code class=\"language-bash\">sudo apt update && sudo apt upgrade -y && sudo apt install git && sudo apt install python3-pip && git clone https://github.com/coddrago/Heroku && cd Heroku && pip install -r requirements.txt && python3 -m hikka</code></pre>\n<emoji document_id=5299027123913105700>😐</emoji> If you dont have sudo access, simply remove the initial steps.\n\n<emoji document_id=5300777464820145682>🥳</emoji> Lets go over a few arguments:\n\n<emoji document_id=5787313834012184077>🔐</emoji> The <code>--root</code> argument allows you to run Heroku as a <b>root user</b>.\n\n<emoji document_id=5785209342986817408>🌎</emoji> The <code>--no-web</code> argument enables login to your account <b>directly in the terminal, rather than through a link</b> <code>{}.lhr.life</code>.\n\n<emoji document_id=5471895949804575096>🤲</emoji> However, if you want to migrate from hikariatama Hikka, download this module:\n<pre><code class=\"language-heroku\">{prefix}dlm https://raw.githubusercontent.com/coddrago/modules/main/SwitchToHeroku.py</code></pre>\nIt completely safe and will help you upgrade to Heroku automatically"
|
||||
termux_install: "😲 <b>How to install Heroku on Termux?</b>\n⬜️ <b>Download Termux from</b> <a href=\"https://f-droid.org/repo/com.termux_118.apk\">the link</a> <b>. ⚠️ The version from Play Market will not work!</b>\n⬜️ <b>Copy the command into it:</b> <code>termux-wake-lock && export AIOHTTP_NO_EXTENSIONS=1 && pkg upgr -y && pkg install tur-repo && pkg update && pkg install python3.10 && pkg i wget ncurses-utils python3.10 -y && pkg update && pkg install openssl -y && pkg install git && clear && git clone https://github.com/coddrago/Heroku && cd Heroku && pip install -r requirements.txt && python3.10 -m hikka --no-web</code>\n⬜️ <b>Answer \"y\" to everything the script asks</b>\n⬜️ <b>Follow the instructions in the script.</b>\n\n⬜️ <b>Where to get API_ID and API_HASH?</b> 🎬 <a href=\"https://youtu.be/DcqDA249Lhg?t=24\">Video</a>"
|
||||
vds_install: "<pre><code class=\"language-bash\">sudo apt update && sudo apt upgrade -y && sudo apt install git && sudo apt install python3-pip && git clone https://github.com/coddrago/Heroku && cd Heroku && pip install -r requirements.txt && python3 -m hikka</code></pre>"
|
||||
railway_install: "Image for RailWay:\nhttps://railway.com/template/2YO_QL?referralCode=RfzFur\n\nBe careful! Any userbots are officially prohibited on RailWay, if your account is banned, neither the creator nor other people are to blame for this."
|
||||
jamhost_install: "Proceed to @jamhostbot, type <code>/pay</code> and follow its instructions"
|
||||
module_switch_install: "<pre><code class=\"language-heroku\">dlm https://raw.githubusercontent.com/coddrago/modules/main/SwitchToHeroku.py</code></pre>"
|
||||
userland_install: "<b>Install UserLAnd from</b> <a href=\"https://play.google.com/store/apps/details?id=tech.ula\">the link</a>\n\n<b>Open it, choose Ubuntu —> Minimal —> Terminal</b>\n\n<b>Wait for the distribution to install, you can pour some tea</b>\n\n<b>After successful installation, a terminal will open in front of you, write there:</b>\n<pre><code class=\"language-shell\">sudo apt update && sudo apt upgrade -y && sudo apt install python3 git python3-pip -y && git clone https://github.com/coddrago/Heroku && cd Heroku && sudo pip install -r requirements.txt && python3 -m hikka</code></pre>\n\n<b>At the end of the installation, a link will appear, follow it and enter your account details to log in.\n\nVoila! You have installed Heroku on UserLAnd.</b>"
|
||||
too_many_args: "<emoji document_id=5210952531676504517>🚫</emoji> <b>Too many args</b>"
|
||||
blacklisted: "<emoji document_id=5197474765387864959>👍</emoji> <b>Chat {} blacklisted from userbot</b>"
|
||||
unblacklisted: "<emoji document_id=5197474765387864959>👍</emoji> <b>Chat {} unblacklisted from userbot</b>"
|
||||
|
|
|
@ -148,7 +148,7 @@ heroku_settings:
|
|||
_cmd_doc_nonickuser: "Включить NoNick для определенного пользователя"
|
||||
_cmd_doc_nonickusers: "Показать список активных NoNick пользователей"
|
||||
_cmd_doc_settings: "Показать настройки"
|
||||
_cmd_doc_uninstall_hikka: "Удалить Heroku"
|
||||
_cmd_doc_uninstall_heroku: "Удалить Heroku"
|
||||
_cmd_doc_watcherbl: "<module> - Включить/выключить смотрителя в текущем чате"
|
||||
_cmd_doc_watcher: "<модуль> - Управление глобальными правилами смотрителя\nАргументы:\n[-c - только в чатах]\n[-p - только в лс]\n[-o - только исходящие]\n[-i - только входящие]"
|
||||
_cmd_doc_watchers: "Показать активные смотрители"
|
||||
|
|
|
@ -247,7 +247,7 @@ settings:
|
|||
_cmd_doc_blacklistuser: "[користувач] - Заборонити користувачу виконувати команди"
|
||||
_cmd_doc_cleardb: "Очистити базу даних"
|
||||
_cmd_doc_delalias: "Видалити аліас для команди"
|
||||
_cmd_doc_hikka: "Показати версію Heroku"
|
||||
_cmd_doc_heroku: "Показати версію Heroku"
|
||||
_cmd_doc_setprefix: "<префікс> - Встановити префікс команд"
|
||||
_cmd_doc_unblacklist: "[чат] - Увімкнути бота де-небудь"
|
||||
_cmd_doc_unblacklistuser: "[користувач] - Дозволити користувачу виконувати команди"
|
||||
|
|
|
@ -45,6 +45,20 @@ class CoreMod(loader.Module):
|
|||
),
|
||||
)
|
||||
|
||||
async def client_ready(self):
|
||||
self._markup = utils.chunks(
|
||||
[
|
||||
{
|
||||
"text": self.strings(platform),
|
||||
"callback": self._inline__choose__installation,
|
||||
"args": (platform,),
|
||||
}
|
||||
for platform in {'termux', 'vds', 'railway',
|
||||
'jamhost', 'module_switch', 'userland'}
|
||||
],
|
||||
2
|
||||
)
|
||||
|
||||
def _process_config_changes(self):
|
||||
# option is controlled by user only
|
||||
# it's not a RCE
|
||||
|
@ -292,7 +306,15 @@ class CoreMod(loader.Module):
|
|||
|
||||
args = utils.get_args_raw(message)
|
||||
|
||||
if not args:
|
||||
if (not args or args not in {'-t', '-v', '-r', '-jh', '-ms', '-u'}) and \
|
||||
not (await self.inline.form(
|
||||
self.strings("choose_installation"),
|
||||
message,
|
||||
reply_markup=self._markup,
|
||||
photo="https://imgur.com/a/HrrFair.png"
|
||||
)
|
||||
):
|
||||
|
||||
await self.client.send_file(
|
||||
message.peer_id,
|
||||
"https://imgur.com/a/HrrFair.png",
|
||||
|
@ -306,8 +328,13 @@ class CoreMod(loader.Module):
|
|||
elif "-jh" in args:
|
||||
await utils.answer(message, self.strings["jamhost_install"])
|
||||
elif "-ms" in args:
|
||||
await utils.answer(message, self.strings["module_switch"])
|
||||
await utils.answer(message, self.strings["module_switch_install"])
|
||||
elif "-u" in args:
|
||||
await utils.answer(message, self.strings["userland_install"])
|
||||
|
||||
await message.delete()
|
||||
async def _inline__choose__installation(self, call: InlineCall, platform: str):
|
||||
await call.edit(
|
||||
text=self.strings(f'{platform}_install'),
|
||||
reply_markup=self._markup,
|
||||
)
|
||||
|
||||
|
|
|
@ -3,7 +3,8 @@
|
|||
# 🌐 https://github.com/hikariatama/Hikka
|
||||
# You can redistribute it and/or modify it under the terms of the GNU AGPLv3
|
||||
# 🔑 https://www.gnu.org/licenses/agpl-3.0.html
|
||||
|
||||
import getpass
|
||||
import platform as lib_platform
|
||||
import inspect
|
||||
import logging
|
||||
import os
|
||||
|
@ -380,8 +381,8 @@ class TestMod(loader.Module):
|
|||
ping_hint=(
|
||||
(self.config["hint"]) if random.choice([0, 0, 1]) == 1 else ""
|
||||
),
|
||||
hostname=subprocess.run(['hostname'], stdout=subprocess.PIPE).stdout.decode().strip(),
|
||||
user=subprocess.run(['whoami'], stdout=subprocess.PIPE).stdout.decode().strip(),
|
||||
hostname=lib_platform.node(),
|
||||
user=getpass.getuser(),
|
||||
),
|
||||
reply_to=getattr(message, "reply_to_msg_id", None),
|
||||
)
|
||||
|
|
|
@ -130,7 +130,7 @@ class UpdaterMod(loader.Module):
|
|||
)
|
||||
|
||||
@loader.callback_handler()
|
||||
async def update(self, call: InlineCall):
|
||||
async def update_call(self, call: InlineCall):
|
||||
"""Process update buttons clicks"""
|
||||
if call.data not in {"heroku/update", "heroku/ignore_upd"}:
|
||||
return
|
||||
|
|
Loading…
Reference in New Issue