Javascript discordapierror:缺少访问权限

Javascript discordapierror:缺少访问权限,javascript,node.js,Javascript,Node.js,我似乎无法找出我的代码的问题。我没有看到任何错误,但当它加入服务器时,它将出错并可能停止运行。我会感谢你的帮助 index.js const Discord = require('discord.js'); const client = new Discord.Client(); const KeepAlive = require('./server'); client.on('message', function (msg) { const Logged = new Discord.

我似乎无法找出我的代码的问题。我没有看到任何错误,但当它加入服务器时,它将出错并可能停止运行。我会感谢你的帮助

index.js

const Discord = require('discord.js');
const client = new Discord.Client();
const KeepAlive = require('./server');

client.on('message', function (msg) {
    const Logged = new Discord.MessageEmbed()
        .setTitle(msg.author.tag)
        .setDescription(msg.content)
        .setColor('0x00AAFF')
        .setTimestamp();

    if(msg.author.id === 'BOT-ID-GOES-HERE') {
        console.log('')
    } else if(msg.author.username) {
        const channel = client.channels.cache.find(channel => channel.name === 'logs')
        channel.send(Logged)
    }
});

client.on('ready', ()=> {
console.log('Connected as '+client.user.tag)
});

KeepAlive()
client.login(process.env.token);
server.js

const express = require('express')

const server = express()

server.all('/', (req, res) => {
res.send('Bot is running!')
});

function KeepAlive() {
    server.listen(671, () => {});
    console.log('Server is ready!')
}

module.exports = KeepAlive
现在错误是

(node:313) UnhandledPromiseRejectionWarning: DiscordAPIError: Missing Access
    at RequestHandler.execute (/home/runner/Censored-Logging/node_modules/discord.js/src/rest/RequestHandler.js:154:13)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async RequestHandler.push (/home/runner/Censored-Logging/node_modules/discord.js/src/rest/RequestHandler.js:39:14)
(node:313) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:313) [DEP0018] 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.
我还是个新手,有很多错误,我不能正确地阅读它们