Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

222
Views
¿Cómo puedo hacer un bot que escuche eventos pero que también tenga comandos en discordia?

Necesito mi bot de discordia para escuchar eventos y necesito que tenga comandos. Aquí hay un ejemplo de mi problema.

 import os from keepalive import keep_alive from discord.ext import commands client = commands.Bot(command_prefix = "$") banned_words = [ "blah", "blahh", "blahhh" ] @client.event async def on_message(message): msg = message.content msgsend = message.channel.send if any(word in msg.lower() for word in banned_words): await message.channel.purge(limit=1) await msgsend("Please don't use banned words!") @client.command() async def dice(message, amount:int): await message.channel.send("blah blah blah")
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Agregue await client.process_commands(message) al comienzo de su evento on_message . Este código procesa comandos y permite a los usuarios invocarlos/usarlos.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!