mirror of https://github.com/coddrago/Heroku
Deepsource fixes
parent
01a4d11432
commit
3e2bd4494a
|
@ -32,7 +32,7 @@ class BotInteractions(InlineUnit):
|
|||
|
||||
return self.fsm.get(str(user), False)
|
||||
|
||||
async def _bot_message_answer(
|
||||
async def _bot_message_answer( # skipcq: PYL-E0213
|
||||
mod,
|
||||
text: str = None,
|
||||
message: AiogramMessage = None,
|
||||
|
|
|
@ -11,16 +11,14 @@
|
|||
# 🌐 https://www.gnu.org/licenses/agpl-3.0.html
|
||||
|
||||
from aiogram import Bot, Dispatcher
|
||||
from aiogram.utils.exceptions import Unauthorized, TerminatedByOtherGetUpdates
|
||||
|
||||
import time
|
||||
import asyncio
|
||||
|
||||
from telethon.errors.rpcerrorlist import InputUserDeactivatedError
|
||||
|
||||
from telethon.utils import get_display_name
|
||||
|
||||
from aiogram.utils.exceptions import Unauthorized, TerminatedByOtherGetUpdates
|
||||
|
||||
from .gallery import Gallery
|
||||
from .form import Form
|
||||
from .bot_interaction import BotInteractions
|
||||
|
|
|
@ -37,12 +37,12 @@ class TokenObtainment(InlineUnit):
|
|||
uid = utils.rand(6)
|
||||
username = f"hikka_{uid}_bot"
|
||||
|
||||
for msg in {
|
||||
for msg in [
|
||||
f"👩🎤 Hikka Userbot of {self._name}",
|
||||
username,
|
||||
"/setuserpic",
|
||||
username,
|
||||
}:
|
||||
]:
|
||||
m = await conv.send_message(msg)
|
||||
r = await conv.get_response()
|
||||
|
||||
|
@ -154,7 +154,7 @@ class TokenObtainment(InlineUnit):
|
|||
# Enable inline mode or change its
|
||||
# placeholder in case it is not set
|
||||
|
||||
for msg in {
|
||||
for msg in [
|
||||
"/setinline",
|
||||
button.text,
|
||||
"HikkaQuery",
|
||||
|
@ -163,7 +163,7 @@ class TokenObtainment(InlineUnit):
|
|||
"Enabled",
|
||||
"/setuserpic",
|
||||
button.text,
|
||||
}:
|
||||
]:
|
||||
m = await conv.send_message(msg)
|
||||
r = await conv.get_response()
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@ from aiogram.types import Message as AiogramMessage, InlineQuery as AiogramInlin
|
|||
|
||||
|
||||
class InlineCall:
|
||||
"""Modified version of original Aiogram CallbackQuery"""
|
||||
def __init__(self):
|
||||
self.delete = None
|
||||
self.unload = None
|
||||
|
@ -10,16 +11,19 @@ class InlineCall:
|
|||
|
||||
|
||||
class InlineUnit:
|
||||
"""InlineManager extension type. For internal use only"""
|
||||
def __init__(self):
|
||||
pass
|
||||
"""Made just for type specification"""
|
||||
|
||||
|
||||
class BotMessage(AiogramMessage):
|
||||
"""Modified version of original Aiogram Message"""
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
|
||||
|
||||
class InlineQuery:
|
||||
"""Modified version of original Aiogram InlineQuery"""
|
||||
def __init__(self, inline_query: AiogramInlineQuery) -> None:
|
||||
self.inline_query = inline_query
|
||||
|
||||
|
|
|
@ -82,7 +82,7 @@ function finish_login() {
|
|||
credentials: "include"
|
||||
})
|
||||
.then(response => response.text())
|
||||
.then(function (response) {
|
||||
.then((response) => {
|
||||
window.expanse = true;
|
||||
if(response == "0") {
|
||||
setTimeout(() => {
|
||||
|
@ -97,7 +97,7 @@ function finish_login() {
|
|||
window.location.href = "/";
|
||||
}, response == "0" ? 10000 : 1500);
|
||||
})
|
||||
.catch(function () {
|
||||
.catch(() => {
|
||||
error_state();
|
||||
error_message("Login confirmation error");
|
||||
});
|
||||
|
@ -108,7 +108,7 @@ function tg_code() {
|
|||
method: "POST",
|
||||
body: `${_tg_pass}\n${_phone}\n${_2fa_pass}`
|
||||
})
|
||||
.then(function (response) {
|
||||
.then((response) => {
|
||||
if (!response.ok) {
|
||||
if (response.status == 403) {
|
||||
error_state();
|
||||
|
@ -186,7 +186,7 @@ function process_next() {
|
|||
return;
|
||||
}
|
||||
|
||||
_api_id = parseInt(api_id);
|
||||
_api_id = parseInt(api_id, 10);
|
||||
switch_block("api_hash");
|
||||
|
||||
return;
|
||||
|
@ -206,7 +206,7 @@ function process_next() {
|
|||
body: _api_hash + _api_id,
|
||||
credentials: "include"
|
||||
})
|
||||
.then(function (response) {
|
||||
.then((response) => {
|
||||
if (!response.ok) {
|
||||
error_state();
|
||||
error_message("Error occured while saving credentials")
|
||||
|
@ -214,7 +214,7 @@ function process_next() {
|
|||
switch_block("phone");
|
||||
}
|
||||
})
|
||||
.catch(function () {
|
||||
.catch(() => {
|
||||
error_state();
|
||||
error_message("Error occured while saving credentials")
|
||||
});
|
||||
|
@ -235,7 +235,7 @@ function process_next() {
|
|||
body: _phone,
|
||||
credentials: "include"
|
||||
})
|
||||
.then(function (response) {
|
||||
.then((response) => {
|
||||
if (!response.ok) {
|
||||
error_state();
|
||||
error_message("Code send failed");
|
||||
|
@ -257,7 +257,7 @@ function process_next() {
|
|||
})
|
||||
}
|
||||
})
|
||||
.catch(function () {
|
||||
.catch(() => {
|
||||
error_state();
|
||||
error_message("Code send failed");
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue