简体   繁体   English

我将如何使用 Discord.js 制作一个“主持活动”的机器人?

[英]How would I make a bot that "host events" with Discord.js?

I need a way to host "events" with Discord.js.我需要一种使用 Discord.js 托管“事件”的方法。

The closest I found was this .我找到的最接近的是这个

This is exactly what I need it to do but this doesn't show any code to try and replicate.这正是我需要它做的,但这并没有显示任何尝试和复制的代码。

Any suggestions?有什么建议?

I figured out how to do this.我想出了如何做到这一点。

  if(command === 'mnhost') {
var movie = args.join(" ");
let MNP = message.guild.roles.find(role => role.name === "Movie Night Pings");
if (!movie) return message.reply('Please specify the movie you are hosting! (Ex. `~mnhost <Movie Title>`)')


  message.channel.send(":partying_face: Are you ready for some movies?:partying_face:")
  message.channel.send(MNP + " :movie_camera: " + message.author + " is hosting __**" + movie + "**__!!! :movie_camera:")
}

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

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