📅  最后修改于: 2023-12-03 14:40:44.348000             🧑  作者: Mango
This is a guide for programmers to create a Discord bot with streaming status using the Javascript programming language. By following this guide, you will be able to set up your bot to display a streaming status on Discord.
Before proceeding with the tutorial, you need to have the following software installed:
npm init
command.npm install discord.js
command.bot.js
) in your project directory.const Discord = require('discord.js');
const client = new Discord.Client();
client.login('YOUR_BOT_TOKEN');
client.on('ready', () => {
const streamingOptions = {
type: 'STREAMING',
url: 'YOUR_STREAMING_URL'
};
client.user.setPresence({ activity: streamingOptions });
});
bot.js
file.node bot.js
command in the terminal.Congratulations! You have successfully created a Discord bot with streaming status using Javascript. You can now enhance your bot's functionality further by exploring various Discord.js features and APIs.
Note: Remember to replace YOUR_BOT_TOKEN
with the token you obtained in step 1, and YOUR_STREAMING_URL
with the streaming URL you want to display.