Skip to content

Commit cfb6c0b

Browse files
Autofix: Lint and format code
1 parent 5b542eb commit cfb6c0b

File tree

1 file changed

+22
-21
lines changed

1 file changed

+22
-21
lines changed

src/start.py

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -29,31 +29,32 @@
2929

3030

3131
async def start_bot(bot: custom.Bot, token: str, rest_config: RestConfig, public_key: str | None = None) -> None:
32-
try:
33-
if isinstance(bot, custom.CustomRestBot):
34-
if not public_key:
35-
raise TypeError("CustomRestBot requires a public key to start.") # noqa: TRY301
36-
await bot.start(
37-
token=token,
38-
public_key=public_key,
39-
health=rest_config.health,
40-
uvicorn_options={
41-
"host": rest_config.host,
42-
"port": rest_config.port,
43-
},
44-
)
45-
else:
46-
await bot.start(token)
47-
except LoginFailure as e:
48-
logger.critical("Failed to log in, is the bot token valid?")
49-
logger.debug("", exc_info=e)
50-
except Exception as e: # noqa: BLE001
51-
logger.critical("An unexpected error occurred while starting the bot.")
52-
logger.debug("", exc_info=e)
32+
try:
33+
if isinstance(bot, custom.CustomRestBot):
34+
if not public_key:
35+
raise TypeError("CustomRestBot requires a public key to start.") # noqa: TRY301
36+
await bot.start(
37+
token=token,
38+
public_key=public_key,
39+
health=rest_config.health,
40+
uvicorn_options={
41+
"host": rest_config.host,
42+
"port": rest_config.port,
43+
},
44+
)
45+
else:
46+
await bot.start(token)
47+
except LoginFailure as e:
48+
logger.critical("Failed to log in, is the bot token valid?")
49+
logger.debug("", exc_info=e)
50+
except Exception as e: # noqa: BLE001
51+
logger.critical("An unexpected error occurred while starting the bot.")
52+
logger.debug("", exc_info=e)
5353

5454

5555
# blerp
5656

57+
5758
async def start_backend(app: Quart, bot: discord.Bot, token: str) -> None:
5859
from hypercorn.asyncio import serve # pyright: ignore [reportUnknownVariableType]
5960
from hypercorn.config import Config

0 commit comments

Comments
 (0)