use logging in bot startup
This commit is contained in:
parent
c2da9d09a3
commit
a226cfd020
@ -1,5 +1,6 @@
|
|||||||
"""Start the Discord bot and connect to Discord."""
|
"""Start the Discord bot and connect to Discord."""
|
||||||
import asyncio
|
import asyncio
|
||||||
|
import logging
|
||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.core.management.base import BaseCommand
|
from django.core.management.base import BaseCommand
|
||||||
@ -7,11 +8,13 @@ from django.core.management.base import BaseCommand
|
|||||||
from bot import hitomi
|
from bot import hitomi
|
||||||
from bot.api import hitomi_api
|
from bot.api import hitomi_api
|
||||||
|
|
||||||
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
@hitomi.event
|
@hitomi.event
|
||||||
async def on_ready():
|
async def on_ready():
|
||||||
"""Print some basic login info to the console, when the bot connects."""
|
"""Print some basic login info to the console, when the bot connects."""
|
||||||
print("Logged in as {0:s} ({1:s})".format(hitomi.user.name, hitomi.user.id))
|
logger.info("Logged in as {0:s} ({1:s})".format(hitomi.user.name, hitomi.user.id))
|
||||||
|
|
||||||
|
|
||||||
async def run_bot():
|
async def run_bot():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user