Reply to text messages via your discord bot

    0

    14

    khalid35

    Discord Js Cookbook

    The code is saying that when a message is sent to the client, the client should run a function named msg => { .. }. If the message's content matched the identifier in the message, the client should reply with given reply .

    Shortcut: discord.reply

    client.on("message", msg => {
      if (msg.content === "<Put your message identifier>") {
        msg.reply("Write your reply here");
      }
    })
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.