小编Sam*_*ith的帖子

发送预定消息

我刚刚开始使用 Javascript 和 Node.js,所以我真的不知道该怎么做。请对我有耐心。谢谢!

所以我在我的物理服务器上托管了一个 node.js。我想创建一个 Discord Bot,它在我的服务器上的特定时间发送每日消息,例如,我想每天早上 8 点向一个频道发送一条消息,说“早安”。我该怎么做?

目前,我只有这个代码来 ping 机器人(和服务器)

/*
 A ping pong bot, whenever you send "ping", it replies "pong".
*/

// Import the discord.js module
const Discord = require('discord.js');

// Create an instance of a Discord client
const client = new Discord.Client();

// The token of your bot - https://discordapp.com/developers/applications/me
const token = 'your bot token here';

// The ready event is vital, it means that your bot will only start reacting to information …
Run Code Online (Sandbox Code Playgroud)

javascript node.js discord.js

5
推荐指数
1
解决办法
4万
查看次数

标签 统计

discord.js ×1

javascript ×1

node.js ×1