最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Error [ERR_REQUIRE_ESM]: require() of ES Module appnode_modulesgotdistsourceindex.js from appcommandsImagememe.js n

programmeradmin4浏览0评论

Code:

const { EmbedBuilder } = require("discord.js");
const got = require("got");

module.exports = {
  name: "meme",
  description: "Shows an image of a meme!",
  run: async (client, message, args) => {
      got("/.json").then(response => {
      const [list] = JSON.parse(response.body);
      const [post] = list.data.children;

      const permalink = post.data.permalink;
      const memeUrl = `${post.data.permalink}`;
      const memeImage = post.data.url;
      const memeTitle = post.data.title;
      const memeUpvotes = post.data.ups;
      const memeNumComments = post.data.num_ments;
      
      const memeEmbed = new EmbedBuilder()
         .setTitle(`${memeTitle}`)
         .setURL(`${memeUrl}`)
         .setColor("Random")
         .setImage(memeImage)
         .setFooter({ text: `

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论