Skip to content

Instantly share code, notes, and snippets.

View tthn0's full-sized avatar
💻
Coding

Thomas ☻ tthn0

💻
Coding
View GitHub Profile
@vbe0201
vbe0201 / music_bot_example.py
Last active June 21, 2024 12:36
A simple music bot written using discord.py rewrite and youtube_dl.
# -*- coding: utf-8 -*-
"""
Copyright (c) 2019 Valentin B.
A simple music bot written in discord.py using youtube-dl.
Though it's a simple example, music bots are complex and require much time and knowledge until they work perfectly.
Use this as an example or a base for your own bot and extend it as you want. If there are any bugs, please let me know.
@AileenLumina
AileenLumina / bot.py
Last active May 2, 2022 17:40
discord.py command error handler
async def on_command_error(self, ctx, error):
# if command has local error handler, return
if hasattr(ctx.command, 'on_error'):
return
# get the original exception
error = getattr(error, 'original', error)
if isinstance(error, commands.CommandNotFound):
return
@EvieePy
EvieePy / error_handler.py
Last active May 27, 2024 17:01
Simple Error Handling for ext.commands - discord.py
"""
If you are not using this inside a cog, add the event decorator e.g:
@bot.event
async def on_command_error(ctx, error)
For examples of cogs see:
https://gist.github.com/EvieePy/d78c061a4798ae81be9825468fe146be
For a list of exceptions:
https://discordpy.readthedocs.io/en/latest/ext/commands/api.html#exceptions