mirror of
https://github.com/timmypidashev/web.git
synced 2026-04-14 11:03:50 +00:00
Slightly better styling:
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user