tuxbot-bot/tuxbot/core/utils/functions/utils.py
Romain J 7962205d16 feat(commands|Network>iplocalise): feat iplocalise command
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
2021-01-25 17:28:59 +01:00

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