Romain J
7962205d16
todo: - fix l'INET6 qui s'affiche comme 10 plutot que 6 - suppr le message Retrieving info si la commande n'a pas pu etre faite - this shit https://canary.discord.com/channels/767804368233037886/768097484655689758/803299217279811634
24 lines
528 B
Python
24 lines
528 B
Python
import functools
|
|
|
|
from discord.ext import commands
|
|
|
|
from tuxbot.core.utils.functions.extra import ContextPlus
|
|
|
|
|
|
def upper_first(string: str) -> str:
|
|
return "".join(string[0].upper() + string[1:])
|
|
|
|
|
|
def typing(func):
|
|
@functools.wraps(func)
|
|
async def wrapped(*args, **kwargs):
|
|
context = (
|
|
args[0]
|
|
if isinstance(args[0], (commands.Context, ContextPlus))
|
|
else args[1]
|
|
)
|
|
|
|
async with context.typing():
|
|
await func(*args, **kwargs)
|
|
|
|
return wrapped
|