You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

77 lines
2.6 KiB

const Discord = require('discord.js');
const client = new Discord.Client();
// Express site serving
const express = require('express');
const app = express();
const bodyParser = require('body-parser');
// Message Array
const responseObject = {
"test": "It worked!",
"best girl?": "Big Band.",
"best girl": "Big Band.",
"best grill": "Big Band.",
"best grill?": "Big Band.",
"best gurl": "Big Band.",
"best gurl?": "Big Band.",
"best booty": "Squigly, Duh.",
"best booty?": "Squigly, Duh.",
"hi": "Hello there, I'm a dumb bot written by [@calexil#9270]( and [@Timberius#8180]( , you can see my commands here:",
"commands": "You can see my commands here:"
console.log("best girl?".replace(/best g(ir|ri|ur)l+\??/g, "Big Band."));
// Call the web page with express
extended: true
// Listen for the users local script to post the current track and log it to console
app.listen(process.env.PORT, () => console.log(`App listening on port ${process.env.PORT}!`))'/endpoint', (req, res) => {
let trackName = req.body.trackName;
res.send('Track received!');
console.log(`Received ${trackName}`);
// Post the current track in discord
if (musicChannel) {
// Make sure the bot is in the correct channel and show that the bot has launched successfully in console
client.on('ready', () => {
let musicChannelId = '318919013101076481'; //This number will need too be set you your desired channel id
musicChannel = client.channels.find(channel => === musicChannelId);
if (!musicChannel) console.error('Could not find music channel!');
console.log('I am ready!');
// Reply to keywords in the array
client.on("message", (message) => {
if (responseObject[message.content]) {[message.content]);
// Reply to regex regarding best girl
client.on("message", (message) => {
if (responseObject[message.content]) { g(ir|ri|ur)l+\??/g, "Big Band."));
// Ping server every 15 minutes to prevent web dyno from sleeping
var http = require("http");
setInterval(function() {
}, 1500000);
// Do not change