This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Require Packages -- You will need to install these | |
const Discord = require('discord.js'); | |
const client = new Discord.Client(); // This uses the discord.js package to setup a client | |
// Constant Variables | |
const prefix = '_'; // This can be changed to anything you want | |
const ownerID = '144645791145918464'; // This will be used in future videos | |
// First, we need to create an object containing the serverStats info | |
const serverStats = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The command reloads other commands, using the command handler from our series | |
exports.run = (client, message, args, ops) => { | |
// We're going to be passing an extra argument, titled 'ops' | |
// We can choose what to pass into it via the server.js file | |
// Now, we can access ops.ownerID & it will return the ID defined at the top of server.js | |
// Check if author is the bot owner | |
if (message.author.id !== ops.ownerID) return message.channel.send('Sorry, only the owner can use this command.'); | |
// If the two IDs aren't the same, it will return and send a message to the channel |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Require Packages -- You will need to install these | |
const Discord = require('discord.js'); | |
const client = new Discord.Client(); // This uses the discord.js package to setup a client | |
// Constant Variables | |
const prefix = '_'; // This can be changed to anything you want | |
const ownerID = '144645791145918464'; // This will be used in future videos | |
// Listener Events | |
client.on('message', message => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The command will be activated using _ping, since the filename is ping & our prefix is _ | |
exports.run = (client, message, args) => { | |
// This sends a message to the channel, containing the string 'Pong!' | |
message.channel.send('Pong!'); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Require Packages -- You will need to install these | |
const Discord = require('discord.js'); | |
const client = new Discord.Client(); // This uses the discord.js package to setup a client | |
// Constant Variables | |
const prefix = '_'; // This can be changed to anything you want | |
const ownerID = 'yourID'; // This will be used in future videos | |
// Listener Events | |
client.on('message', message => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fetch = require('snekfetch') | |
const ws = require("ws") | |
var logHeartbeat = false | |
// Weebsocket | |
get('gateway').then(gateway => { | |
let weebsocket = new ws(gateway.url) | |
NewerOlder