use console.log rather than print()

This commit is contained in:
EEKIM10 2022-10-12 17:40:02 +01:00
parent 9802a6756e
commit c4ec8035cb
2 changed files with 9 additions and 9 deletions

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="dataSourceStorageLocal" created-in="PY-222.4167.33"> <component name="dataSourceStorageLocal" created-in="PY-222.4345.23">
<data-source name="main" uuid="28efee07-d306-4126-bf69-01008b4887e2"> <data-source name="main" uuid="28efee07-d306-4126-bf69-01008b4887e2">
<database-info product="SQLite" version="3.39.2" jdbc-version="2.1" driver-name="SQLite JDBC" driver-version="3.39.2.0" dbms="SQLITE" exact-version="3.39.2" exact-driver-version="3.39"> <database-info product="SQLite" version="3.39.2" jdbc-version="2.1" driver-name="SQLite JDBC" driver-version="3.39.2.0" dbms="SQLITE" exact-version="3.39.2" exact-driver-version="3.39">
<identifier-quote-string>&quot;</identifier-quote-string> <identifier-quote-string>&quot;</identifier-quote-string>

16
main.py
View file

@ -1,7 +1,7 @@
import discord import discord
from discord.ext import commands from discord.ext import commands
import config import config
from utils import registry from utils import registry, console
bot = commands.Bot( bot = commands.Bot(
@ -10,26 +10,26 @@ bot = commands.Bot(
allowed_mentions=discord.AllowedMentions.none(), allowed_mentions=discord.AllowedMentions.none(),
intents=discord.Intents.default() + discord.Intents.members intents=discord.Intents.default() + discord.Intents.members
) )
bot.load_extension("jishaku")
bot.load_extension("cogs.verify") for ext in ["jishaku", "cogs.verify", "cogs.mod", "cogs.events", "cogs.assignments"]:
bot.load_extension("cogs.mod") bot.load_extension(ext)
bot.load_extension("cogs.events") console.log(f"Loaded extension [green]{ext}")
bot.load_extension("cogs.assignments")
bot.loop.run_until_complete(registry.create_all()) bot.loop.run_until_complete(registry.create_all())
@bot.listen() @bot.listen()
async def on_connect(): async def on_connect():
print("Connected to discord!") console.log("[green]Connected to discord!")
@bot.event @bot.event
async def on_ready(): async def on_ready():
print("Logged in as", bot.user) console.log("Logged in as", bot.user)
@bot.slash_command() @bot.slash_command()
async def ping(ctx: discord.ApplicationContext): async def ping(ctx: discord.ApplicationContext):
# noinspection SpellCheckingInspection
"""Checks the bot's response time""" """Checks the bot's response time"""
gateway = round(ctx.bot.latency * 1000, 2) gateway = round(ctx.bot.latency * 1000, 2)
return await ctx.respond(f"\N{white heavy check mark} Pong! `{gateway}ms`.") return await ctx.respond(f"\N{white heavy check mark} Pong! `{gateway}ms`.")