This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Note: You really should not use this. | |
# You can easily convert your app | |
# to use Quart by using async+await | |
# and then use loop.create_task(bot.start(...)) | |
# before using app.run. | |
from threading import Thread | |
from flask import Flask | |
from functools import partial | |
from discord.ext import commands |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.forms import ModelForm | |
from django.forms.models import inlineformset_factory | |
from models import Sponsor, Sponsorship | |
class SponsorForm(ModelForm): | |
class Meta: | |
model = Sponsor |