#i have a discord js 12 bot which im going to update soon , but all the responses come in ephemeral

7 messages · Page 1 of 1 (latest)

quaint sluice
#

uses slash commands

jade surge
#

• What's your exact discord.js npm list discord.js and node node -v version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.

quaint sluice
#

discord.js 12.5.3

#

module.exports = {
  name: "viewtodos",
  description: "View your todo list. ",
  async execute(interaction, client, discordTodo) {
    const memberID = interaction.member.user.id;
    const username = interaction.member.user.username;
    const todoList = await discordTodo.find({ userID: memberID }).exec();
    var todos = [];

    todoList.forEach((todo) => {
      let newTask = { name: "\u200B", value: "- \u200B " + todo.task };
      todos.push(newTask);
    });

    let todoListEmbed = new MessageEmbed()
      .setColor("#FF5733")
      .setTitle(username + "'s Todo List")
      .addFields({ name: "\u200B", value: "No tasks in your list. " });

    if (!todos.length == 0) {
      todoListEmbed = new MessageEmbed()
        .setColor("#FF5733")
        .setTitle(username + "'s Todo List")
        .addFields(todos);
    }

    client.api.interactions(interaction.id, interaction.token).callback.post({
      data: {
        type: 4,
        data: {
          embeds: [todoListEmbed],
          flags: 64,
        },
      },
    });
  },
};
torpid pier
#

also, we don’t provide any support for v12

quaint sluice
#

oh