简体   繁体   English

欢迎不和谐消息

[英]Welcome Discord Message

so i tried adding an embed message in the welcome message and as i pressed npm run it stated that there was an error the error is stated below.所以我尝试在欢迎消息中添加一条嵌入消息,当我按下npm run它指出存在错误,错误如下所述。 file is named as welcome.py文件被命名为welcome.py

const Discord = require('discord.js');

bot.on('guildMemberAdd', member => {
    const exampleEmbed = new Discord.RichEmbed()
        .setColor('#2f3136')
        .setTitle('Welcome to miyoko.')
        .setImage("https://media.discordapp.net/attachments/891480598680600608/893855953831743508/image0.jpg")
        .setThumbnail("https://cdn.discordapp.com/icons/891338757972840458/603efa60b46e5dd8b09aafeaf8167c5c.webp")
        .setDescription('<:asc_bhrttt:893064714735726622> <#892951925270642739> \n <:ra_xheart01:893064647698178069> <#892953158299582484> \n <:ra_xheart02:893065191170924544> <#892954010993164308')

    member.guild.channels.get('891480598680600608').send(exampleEmbed);
})
Error: Cannot find module 'node:events'
Require stack:
- /home/runner/welc-hyewon/node_modules/discord.js/src/client/BaseClient.js
- /home/runner/welc-hyewon/node_modules/discord.js/src/index.js
- /home/runner/welc-hyewon/index.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:815:15)
    at Function.Module._load (internal/modules/cjs/loader.js:667:27)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/home/runner/welc-hyewon/node_modules/discord.js/src/client/BaseClient.js:3:22)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Module.require (internal/modules/cjs/loader.js:887:19)H

What node.js version are you using?您使用的是哪个 node.js 版本? It looks like you are using an old node.js version.看起来您使用的是旧的 node.js 版本。 Use node -v to check.使用node -v检查。 You can download the latest node.js version here: https://nodejs.org/en/download/current/你可以在这里下载最新的 node.js 版本: https : //nodejs.org/en/download/current/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM