Slightly better styling:

This commit is contained in:
Timothy Pidashev
2024-06-14 19:26:36 -07:00
parent c3bc253182
commit 93d9b3e014
5 changed files with 144 additions and 62 deletions

View File

@@ -8,8 +8,40 @@ tags: ["coreboot", "t440p", "dgpu"]
```python
import random
print(random.randint(1, 100))
# discord api
import discord
from discord.ext import commands
# custom utilities
from Utilities import log
log = log.Logger("errors")
class Errors(commands.Cog):
def __init__(self, client):
self.client = client
@commands.Cog.listener()
async def on_ready(self):
await log.info("Errors cog loaded.")
@commands.Cog.listener()
async def on_command_error(self, context, error):
if isinstance(error, commands.CheckFailure):
await context.reply(
"You are not priveleged enough to use this command.",
mention_author=False
)
else:
await context.reply(
f"**Error**\n```diff\n- {error}```",
mention_author=False
)
def setup(client):
client.add_cog(Errors(client))
```
# Heading 1