aboutsummaryrefslogtreecommitdiffstats
path: root/arthur/__init__.py
blob: 0d837f609b3942a65cd1efe49560221bb15c6c1f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
"""King Arthur is Python Discord's DevOps utility bot."""
import asyncio
import os
from functools import partial
from typing import TYPE_CHECKING

import loguru

if TYPE_CHECKING:
    from arthur.bot import KingArthur

logger = loguru.logger.opt(colors=True)
logger.opt = partial(logger.opt, colors=True)

# On Windows, the selector event loop is required for aiodns.
if os.name == "nt":
    asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())

instance: "KingArthur" = None  # Global Bot instance.