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

405
Vistas
in discord.py How can i make my bot that the commands only can be use in specific channel or specific server?

So, anyone can invite my personal bot to their server. So, I want the command will work on specific channel or specific server with @bot.event not client.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

if you use await bot.process_commands(message) you can try this

@bot.event
async def on_message(message):
    if message.channel.id == yourchannelid:
        await bot.process_commands(message)
    
    if message.guild.id = yourguildid:
        await bot.process_commands(message)

you can add checks in on_message so the bot doesn't reply to itself

about 4 years ago · Juan Pablo Isaza Denunciar
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