Wie funktioniert bulkDelete Arbeit?

Versuchte ich mit bulkDelete meinen bot löschen Sie die Nachricht, aber ich bekomme diese Fehlermeldung:

(node:5724) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Bad Request
(node:5724) DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Und hier ist mein code:

const Discord = require('discord.js');
const bot = new Discord.Client();
const config = require("./config.json");

bot.on('ready', () =>{
    console.log('I am ready!');
});

//var cleanarr=[];

bot.on("message", message =>{
    if (message.author.bot) return;
var cleanarr=[];
        let command = message.content.split(" ")[0];
command = command.slice(config.prefix.length);

        let args = message.content.split(" ").slice(1);
if (message.content == 'lol'){
    message.channel.sendMessage('LUL');
    cleanarr.unshift(`${message.channel.lastMessageID}`);
    }
if (command == "clean") {
    message.channel.sendMessage('Cleaning...');
    message.channel.bulkDelete(cleanarr);
    var cleanarr = [];

Was bedeutet die bulkDelete müssen? Ist es die message-id oder etwas anderes?

Ich habe keine Ahnung, ob ich dieses Recht (ich bin natürlich nicht), da ich mit Programmieren angefangen mit null Kenntnisse in javascript oder alles rund.

InformationsquelleAutor Neycho Kalaydzhiev | 2017-01-10

Schreibe einen Kommentar