Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

331
Vistas
Los cheques no funcionan correctamente en mi biblioteca

Resumen:

Tengo mi propia biblioteca Discord.py llamada "Fusion.py", y de alguna manera rompí commands.check , no sé cómo e intenté varias cosas para intentar solucionarlo, pero nada funcionó. Aquí está la página de Github de la biblioteca. Aquí está el enlace de GitHub a la función exacta.

Además, desinstalé mi biblioteca e instalé la biblioteca dpy mejorada solo para ver si funcionaba y esta función de verificación se copia de edpy, por lo tanto, si funcionó para ellos, debería funcionar para mí, pero después de instalar su biblioteca, funciona en su biblioteca. , pero no funciona en el mío... Le he preguntado a mucha gente, y nadie pudo ayudarme... TT

Código:

 def check(predicate: Check, **command_attrs: Any) -> Callable[[T], T]: def decorator(func: Union[Command, CoroFunc]) -> Union[Command, CoroFunc]: if isinstance(func, Command): func.checks.append(predicate) func._update_attrs(**command_attrs) else: if not hasattr(func, "__commands_checks__"): func.__commands_checks__ = [] if not hasattr(func, "__command_attrs__"): func.__command_attrs__ = {} func.__commands_checks__.append(predicate) func.__command_attrs__.update(command_attrs) return func if inspect.iscoroutinefunction(predicate): decorator.predicate = predicate else: @functools.wraps(predicate) async def wrapper(ctx): return predicate(ctx) # type: ignore decorator.predicate = wrapper return decorator # type: ignore

Código de uso:

 from discord.ext import commands from cool_utils import Terminal Const = { "TESTERS": [] } def is_tester(): Terminal.display("Testing tester") async def predicate(ctx): try: if ctx.message.author.id in Const.get("TESTERS"): Terminal.display("TESTER_DEBUG: User is tester") return True else: Terminal.display("TESTER_DEBBUG: User is not tester") return False except Exception as error: Terminal.error(error) return False try: return commands.check(predicate) except Exception as error: Terminal.error(error) bot = commands.Bot("!") @bot.event async def on_ready(): print("Test") @bot.command() @is_tester() async def test(ctx): await ctx.send("Test") bot.run("TOKEN")
over 4 years ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda