Deepsource fixes

pull/1/head
hikari.ftg 2022-03-27 15:06:15 +00:00
parent b08b998903
commit 4c68b2aebb
8 changed files with 24 additions and 27 deletions

View File

@ -29,7 +29,6 @@ from telethon.utils import get_display_name
from aiogram.types import ( # skipcq: PYL-C0412
InputTextMessageContent,
InlineQuery,
InlineKeyboardMarkup,
InlineKeyboardButton,
InlineQueryResultArticle,
@ -40,6 +39,7 @@ from aiogram.types import ( # skipcq: PYL-C0412
)
from aiogram.types import Message as AiogramMessage
from aiogram.types import InlineQuery as AiogramInlineQuery
from aiogram.utils.exceptions import Unauthorized
@ -76,7 +76,7 @@ class BotMessage(AiogramMessage):
class InlineQuery:
def __init__(self, inline_query: InlineQuery) -> None:
def __init__(self, inline_query: AiogramInlineQuery) -> None:
self.inline_query = inline_query
# Inherit original `InlineQuery` attributes for

View File

@ -498,7 +498,7 @@ class Hikka:
_platform = "Termux" if termux else "Unknown"
logo1 = f"""

View File

@ -81,7 +81,7 @@ class CoreMod(loader.Module):
async def hikkacmd(self, message: Message) -> None:
"""Get Hikka version"""
ver = getattr(main, "__version__", False)
await utils.answer(message, self.strings("hikka").format(*ver))
async def blacklistcmd(self, message: Message) -> None:

View File

@ -130,7 +130,6 @@ class PythonMod(loader.Module):
"f": telethon.tl.functions,
"c": self._client,
"m": message,
"loader": loader,
"lookup": self.lookup,
"self": self,
},

View File

@ -402,12 +402,14 @@ def get_named_platform() -> str:
if is_termux:
return "🕶 Termux"
elif is_okteto:
if is_okteto:
return "☁️ Okteto"
elif is_lavhost:
if is_lavhost:
return f"✌️ lavHost {os.environ['LAVHOST']}"
else:
return "📻 VDS"
return "📻 VDS"
def uptime() -> int:

1
hikka/version.py 100644
View File

@ -0,0 +1 @@
__version__ = (1, 0, 4)

View File

@ -26,9 +26,9 @@ function blackhole(element) {
function setDPI(canvas, dpi) {
// Set up CSS size if it's not set up already
if (!canvas.get(0).style.width)
canvas.get(0).style.width = canvas.get(0).width + 'px';
canvas.get(0).style.width = `${canvas.get(0).width}px`;
if (!canvas.get(0).style.height)
canvas.get(0).style.height = canvas.get(0).height + 'px';
canvas.get(0).style.height = `${canvas.get(0).height}px`;
var scaleFactor = dpi / 96;
canvas.get(0).width = Math.ceil(canvas.get(0).width * scaleFactor);
@ -77,7 +77,7 @@ function blackhole(element) {
}
stars.push(this);
this.color = 'rgba(255,180,255,'+ (1 - ((this.orbital) / 255 * .8)) +')'; // Color the star white, but make it more transparent the further out it is generated
this.color = `rgba(255,180,255,${1 - ((this.orbital) / 255 * 0.8)})`; // Color the star white, but make it more transparent the further out it is generated
this.hoverPos = centery + (maxorbit/2) + this.collapseBonus; // Where the star will go on hover of the blackhole
this.expansePos = centery + (this.id%100)*-10 + (Math.floor(Math.random() * 20) + 1); // Where the star will go when expansion takes place
@ -153,7 +153,7 @@ function blackhole(element) {
requestFrame(loop);
}
function init(time){
function init(){
context.fillStyle = 'rgba(25,25,25,1)'; // Initial clear of the canvas, to avoid an issue where it all gets too dark
context.fillRect(0, 0, cw, ch);
for(var i = 0; i < 2000; i++){ // create 2000 stars

View File

@ -97,7 +97,7 @@ function finish_login() {
window.location.href = "/";
}, response == "0" ? 10000 : 1500);
})
.catch(function (response) {
.catch(function () {
error_state();
error_message("Login confirmation error");
});
@ -106,11 +106,10 @@ function finish_login() {
function tg_code() {
fetch("/tgCode", {
method: "POST",
body: _tg_pass + "\n" + _phone + "\n" + _2fa_pass
body: `${_tg_pass}\n${_phone}\n${_2fa_pass}`
})
.then(function (response) {
if (!response.ok) {
console.log(response);
if (response.status == 403) {
error_state();
Swal.showValidationMessage("Code is incorrect!");
@ -129,7 +128,7 @@ function tg_code() {
})
.catch(error => {
Swal.showValidationMessage(
"Auth failed: " + error.toString()
`Auth failed: ${error.toString()}`
)
})
}
@ -137,14 +136,14 @@ function tg_code() {
function switch_block(block) {
cnt_btn.setAttribute("current-step", block);
try {
$("#block_" + _current_block)
$(`#block_${_current_block}`)
.fadeOut(() => {
$("#block_" + block)
$(`#block_${block}`)
.hide()
.fadeIn();
});
} catch {
$("#block_" + block)
$(`#block_${block}`)
.hide()
.fadeIn();
}
@ -215,7 +214,7 @@ function process_next() {
switch_block("phone");
}
})
.catch(function (response) {
.catch(function () {
error_state();
error_message("Error occured while saving credentials")
});
@ -258,7 +257,7 @@ function process_next() {
})
}
})
.catch(function (error) {
.catch(function () {
error_state();
error_message("Code send failed");
});
@ -271,13 +270,9 @@ function process_next() {
tg_code();
return
}
if (step == "config") {
}
}
cnt_btn.onclick = (e) => {
cnt_btn.onclick = () => {
if (cnt_btn.disabled) return;
if (auth_required) return auth(() => {cnt_btn.click();});