Node.js 从邮件中的链接创建Discord Bot post映像

Node.js 从邮件中的链接创建Discord Bot post映像,node.js,discord.js,Node.js,Discord.js,我想从文本中创建discord bot post图像 例如— 如果有人打字 !形象 然后,机器人应该回复没有链接的图像。 有什么帮助吗? 谢谢。以下是一个示例,您可以这样做: const Discord = require('discord.js'); const imageUrl = msg.content.split(' ').slice(1); const embed = new Discord.RichEmbed().setImage(imageUrl) msg.channel.sen

我想从文本中创建discord bot post图像

例如— 如果有人打字 !形象

然后,机器人应该回复没有链接的图像。 有什么帮助吗?
谢谢。

以下是一个示例,您可以这样做:

const Discord = require('discord.js');
const imageUrl = msg.content.split(' ').slice(1);

const embed = new Discord.RichEmbed().setImage(imageUrl)
msg.channel.send{ embed }

您如何处理参数和命令?请发布您所使用的triedUse regex的代码,以查找linkI管理它以使其工作,但什么是regex?