Locale for console is gone for good
This commit is contained in:
@@ -100,15 +100,10 @@ async def authorize(custom_session: Union[ClientSession, None] = None) -> str:
|
||||
)
|
||||
if not response.ok:
|
||||
logger.warning(
|
||||
i18n._(
|
||||
"api_creds_invalid",
|
||||
"console",
|
||||
locale=(await config_get("locale_log")).format(
|
||||
await config_get("address", "posting", "api"),
|
||||
await config_get("username", "posting", "api"),
|
||||
response.status,
|
||||
),
|
||||
)
|
||||
"Incorrect API credentials! Could not login into '%s' using login '%s': HTTP %s",
|
||||
await config_get("address", "posting", "api"),
|
||||
await config_get("username", "posting", "api"),
|
||||
response.status,
|
||||
)
|
||||
raise ValueError
|
||||
async with aiofiles.open(
|
||||
|
@@ -111,7 +111,9 @@ async def send_content(app: PyroClient, http_session: ClientSession) -> None:
|
||||
return
|
||||
|
||||
except (KeyError, AttributeError, TypeError, IndexError):
|
||||
logger.info(app._("post_empty", "console"))
|
||||
logger.info(
|
||||
"Could not send content due to queue empty or contains only forbidden extensions"
|
||||
)
|
||||
if app.config["reports"]["error"]:
|
||||
await app.send_message(
|
||||
app.owner,
|
||||
@@ -244,16 +246,17 @@ async def send_content(app: PyroClient, http_session: ClientSession) -> None:
|
||||
rmtree(path.join(app.config["locations"]["tmp"], tmp_dir), ignore_errors=True)
|
||||
|
||||
logger.info(
|
||||
app._("post_sent", "console").format(
|
||||
media.id,
|
||||
str(app.config["posting"]["channel"]),
|
||||
caption.replace("\n", "%n"),
|
||||
str(app.config["posting"]["silent"]),
|
||||
)
|
||||
"Sent %s to %s with caption %s and silently %s",
|
||||
media.id,
|
||||
str(app.config["posting"]["channel"]),
|
||||
caption.replace("\n", "%n"),
|
||||
str(app.config["posting"]["silent"]),
|
||||
)
|
||||
|
||||
except Exception as exp:
|
||||
logger.error(app._("post_exception", "console").format(str(exp), format_exc()))
|
||||
logger.error(
|
||||
"Could not send content due to %s. Traceback: %s", exp, format_exc()
|
||||
)
|
||||
if app.config["reports"]["error"]:
|
||||
await app.send_message(
|
||||
app.owner,
|
||||
|
Reference in New Issue
Block a user