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
init python: | |
class HoverTooltips: | |
hovers = { | |
"camping": { | |
"activated": False, | |
"tooltip": "Tooltip for this scene", | |
}, | |
"tournament": { | |
"activated": False, |
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
import signal | |
def timeout(func, duration, *args, **kwargs): | |
""" | |
Handles timing out a function | |
Parameters | |
---------- | |
func |
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
def deprecated(msg="", replace=None): | |
"""A decorator that denotes that an object wrapped with this is deprecated. This can be around classes, | |
methods, properties (only put it around the getter, not the setter), staticmethods, and classmethods. | |
Parameters | |
----------- | |
msg : :class:`str` | |
An extra message that will be put a line after the default one printed with the deprecation warning | |
replace : :class:`object` |
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
import traceback | |
import inspect | |
from copy import copy | |
overloaded_functions = {} | |
def overload(func): | |
# Create a mapping of overloaded functions, based on the name of the function |
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 discord.ext import commands | |
# The check to ensure this is the guild used where the command was made | |
def guild_check(_custom_commands): | |
async def predicate(ctx): | |
return _custom_commands.get(ctx.command.qualified_name) and ctx.guild.id in _custom_commands.get(ctx.command.qualified_name) | |
return commands.check(predicate) | |
class CustomCommands(commands.Cog): |