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

import loguru
from pydis_core.utils import apply_monkey_patches

if TYPE_CHECKING:
    from arthur.bot import KingArthur

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

apply_monkey_patches()

# 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.