Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

281
Visualizações
Discord.js DiscordAPIError: Two factor is require for this operation

I've been using this sudo command in my test server and it works well but when I tried to use it in another server, I keep getting the DiscordAPIError: Two factors are required for this operation error.
Any way on how to fix this?

const Discord = require('discord.js');
const { MessageEmbed } = require('discord.js');

module.exports = {
  name: 'sudo',
  description: 'sudo webhook',
  userpermissions: ['MANAGE_WEBHOOKS'],

  async run(client, message, args) {
    if (!args[1])
      return message.reply(
        'Please provide a message to send \n ```\n usages: sudo [mention] [text]```'
      );
    const member = message.mentions.members.first();
    if (!member) return message.reply('Please tag a user');
    message.channel
      .createWebhook(member.user.username, {
        avatar: member.user.displayAvatarURL({ dynamic: true }),
      })
      .then((webhook) => {
        webhook.send(args.slice(1).join(' '));
        setTimeout(() => {
          webhook.delete();
        }, 3000);
      });
  },
};
about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

You probably have 2FA enabled on the guild/account and it is asking since you're creating a webhook.

about 4 years ago · Juan Pablo Isaza Relatório

0

You need to enable two factor authentication on your own account for this action to work. Go into your user settings -> my account and click "Enable Two-Factor Auth". After following the steps you're prompted with everything should work fine.

https://support.discord.com/hc/en-us/articles/219576828-Setting-up-Two-Factor-Authentication

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda