Added full support for server reminders and added the ability to view reminders in Discord

This commit is contained in:
ION606
2022-08-17 12:09:40 -07:00
parent d8d4bbea56
commit b7d51c2d14
11 changed files with 678 additions and 24 deletions
+11 -2
View File
@@ -78,7 +78,14 @@ async function execute(bot, message, args, command, Discord, mongouri, items, xp
if (!l.includes(tier)) { return message.reply("Please select an existing tier ('none', 'low', 'medium', 'high')"); }
dbo.updateOne({_id: 'LOG'}, {$set: {severity: tier}})
}
} else if (command == 'announcement_role') {
const role = message.mentions.roles.first().id;
dbo.updateOne({_id: 'announcement'}, { $set: { 'role': role } });
} else if (command == "announcement_channel") {
const channel = message.guild.channels.cache.find(ch => ch.name === args[1]);
if (!channel) { return message.reply('The specified channel does not exist!'); }
dbo.updateOne({_id: 'announcement'}, { $set: { 'channel': channel } });
}
else if (command == 'help') {
let temp;
@@ -88,7 +95,9 @@ async function execute(bot, message, args, command, Discord, mongouri, items, xp
temp = 'To enable logging, use the command _!setup keep\\_logs true_ and _!setup log\\_channel_ [channel name] to set the logging channel!\n';
temp += 'Use _!setup keep\\_logs false_ to disable logging and _!setup log\\_severity [none, low, medium, high]_ to set the threshold\n';
temp += '__Severities:__\n*none* - unmute, unban\n*low* - mute\n*medium* - kick\n*high* - ban\nEvery tier also includes all notifs for ***higher*** tiers (AKA _!setup log\\_severity none_ will log everything from every severity)\n';
} else { temp = 'Please use the following format: _!setup help [welcome, logs]_\nExample: _!setup help welcome_'; }
} else if (args[1] == 'announcement') {
temp = "To pick the announcement channel, use _!setup announcement\\_channel_\nTo pick the announcement role, use _!setup announcement\\_role_";
} else { temp = 'Use _!setup Please use the following format: _!setup help [welcome, logs, announcement]_\nExample: _!setup help welcome_'; }
message.reply(temp);
}
+4 -3
View File
@@ -1,5 +1,6 @@
const { convoManager } = require('./premium/chat.js');
const { handleInp } = require('./premium/stripe');
const reminders = require('./premium/reminders.js')
const { MongoClient, ServerApiVersion, ConnectionClosedEvent } = require('mongodb');
function handle_dm(message, bot) {
@@ -9,10 +10,8 @@ function handle_dm(message, bot) {
const member = bot.guilds.cache.get(bot.home_server).members.cache.get(message.author.id);
bot.mongoconnection.then(async (client) => {
// if (err) { return console.log(err); }
const dbo = client.db('main').collection('authorized');
dbo.find({id: message.author}).toArray((err, docs) => {
dbo.find({ discordID: message.author.id }).toArray((err, docs) => {
//Only available to Selmer Bot devs, testers and "authorized" users
if (docs[0] != undefined || member.roles.cache.has('944048889038774302') || member.roles.cache.has('946610800418762792')) {
@@ -25,6 +24,8 @@ function handle_dm(message, bot) {
} else if (message.content.indexOf('!premium') != -1) {
handleInp(bot, message);
} else if (message.content.indexOf('!reminders') != -1) {
reminders.execute(message, null, null, null, bot);
} else {
return message.reply('UNUSABLE DM COMMAND DETECTED');
}
+15 -2
View File
@@ -2,9 +2,14 @@ const { MongoClient, ServerApiVersion } = require('mongodb');
const { createSubscriptionManual } = require('./premium/stripe.js');
const { pause_start_stop, playNext, showQueue } = require('./misc/playAudio.js');
const { resolveComplaint } = require('./dev only/submitcomplaint.js');
const reminders = require('./premium/reminders.js');
// const { RSSInteractionHandler } = require('./premium/rssFeed.js');
const { Interaction } = require('discord.js')
/**
*
* @param {Interaction} interaction
*/
async function handle_interaction(interaction, mongouri, turnManager, bot, STATE, items, xp_collection) {
if (interaction.isButton()) {
const battlecommandlist = ['ATTACK', 'HEAL', 'DEFEND', 'ITEMS', 'ULTIMATE'];
@@ -72,6 +77,10 @@ async function handle_interaction(interaction, mongouri, turnManager, bot, STATE
} else if (interaction.customId == 'DEBUGURGENT' || interaction.customId == 'DEBUGDONE') {
resolveComplaint(interaction);
} else if (interaction.customId.indexOf('newEvent') != -1 || interaction.customId.indexOf('getEvents') != -1) {
reminders.modalHandle(bot, interaction);
} else if (interaction.customId.indexOf('reminderQueue') != -1) {
reminders.turnPage(bot, interaction);
} //Button else ifs here
});
}
@@ -83,7 +92,6 @@ async function handle_interaction(interaction, mongouri, turnManager, bot, STATE
if (interaction.customId.toLowerCase().indexOf('|heal') != -1) {
bot.mongoconnection.then(client => {
console.log(id);
if (id != interaction.user.id) { return; }
let current_user = turnManager.getTurn(client, bot, interaction);
@@ -132,6 +140,11 @@ async function handle_interaction(interaction, mongouri, turnManager, bot, STATE
} /*else if (interaction.customId.indexOf('RSS') != -1) {
RSSInteractionHandler(bot, interaction);
}*/ //menu else ifs here
}
//Forms
else if (interaction.isModalSubmit()) {
reminders.modalHandle(bot, interaction);
} //other selection types here
}
+1 -1
View File
@@ -1,5 +1,5 @@
const { modHelp } = require('../admin/moderation.js');
//CHANGE THIS TO FORMS?
module.exports ={
name: "help",
description: "Gets help for all of Selmer Bot's commands",
+1 -1
View File
@@ -38,7 +38,7 @@ async function getResponse(convo, bot) {
return response;
}
async function convoManager(clientinp, bot, message) {
async function convoManager(clientinp, bot, message) {
//Just in case, make sure it can't be changed
const client = clientinp;
+409
View File
@@ -0,0 +1,409 @@
const { Modal, TextInputComponent, MessageActionRow, MessageButton, MessageEmbed, Interaction } = require('discord.js');
/**
* @param {Interaction} interaction
*/
function postEmbd(bot, desc, interaction, page, isGuild, id, refered) {
try {
const author = {
name: "Selmer Bot",
url: "",
iconURL: bot.user.displayAvatarURL()
};
const newEmbed = new MessageEmbed()
.setTitle("REMINDERS")
.setAuthor(author)
.setDescription(desc[page])
.setFooter({ text: `Page ${page + 1}` });
const row = new MessageActionRow();
//Make sure the page is never < 1
const prevbtn = new MessageButton()
.setCustomId(`reminderQueue|${isGuild}-${id}|`)
.setLabel('⬅️')
.setStyle('SECONDARY')
if (page <= 0) {
prevbtn.customId += `0`;
// prevbtn.setCustomId(`reminderQueue|${isGuild}-${id}|0`);
prevbtn.setDisabled(true);
} else {
prevbtn.customId += `${page - 1}`;
}
const nextbtn = new MessageButton()
.setCustomId(`reminderQueue|${isGuild}-${id}|`)
.setLabel('➡️')
.setStyle('SECONDARY');
if ((page + 1) >= desc.length) {
nextbtn.customId += `${desc.length}`;
// nextbtn.setCustomId(`reminderQueue|`);
nextbtn.setDisabled(true);
} else {
nextbtn.customId += `${page + 1}`;
}
row.addComponents(prevbtn, nextbtn);
if (page > 0 || refered) {
interaction.update({ content: '_Note: To see a full list of reminder stats visit www.selmerbot.com _', embeds: [newEmbed], components: [row] });
} else {
interaction.reply({ content: '_Note: To see a full list of reminder stats visit www.selmerbot.com _', embeds: [newEmbed], components: [row] });
}
} catch (err) {
console.log(err);
return interaction.reply("Uh Oh! There's been an error!");
}
}
async function postForm(interaction, isGuild = false) {
// Create the modal
const modal = new Modal();
if (!isGuild) {
modal.setTitle('Creating a New Personal Reminder')
.setCustomId('newEventModal|user');
} else {
modal.setTitle('Creating a New Guild Reminder')
.setCustomId('newEventModal|guild');
}
// Add components to modal
// Create the text input components
// The label is the prompt the user sees for this input
// Short means only a single line of text
// Paragraph means multiple lines of text
const nameInp = new TextInputComponent()
.setCustomId('name')
.setLabel("What is the Event's name?")
.setStyle('SHORT');
const descInp = new TextInputComponent()
.setCustomId('description')
.setLabel("What's the event's description?")
.setStyle('PARAGRAPH');
const dateInp = new TextInputComponent()
.setCustomId('date')
.setLabel("What's the event's date?")
.setPlaceholder('1/1/2020')
.setStyle('SHORT');
const timeInp = new TextInputComponent()
.setCustomId('time')
.setLabel("What's the event's time?")
.setPlaceholder("2:00 PM or 14:00")
.setStyle('SHORT');
const locurlinp = new TextInputComponent()
.setCustomId('locationwurl')
.setLabel("Where is the event happening?")
.setPlaceholder('To add a URL, simply use location;url (the seperator is a semi-colon)')
.setStyle('SHORT');
// An action row only holds one text input,
// so you need one action row per text input.
const name = new MessageActionRow().addComponents(nameInp);
const desc = new MessageActionRow().addComponents(descInp);
const date = new MessageActionRow().addComponents(dateInp);
const time = new MessageActionRow().addComponents(timeInp);
const offset = new MessageActionRow().addComponents(locurlinp);
// Add inputs to the modal
modal.addComponents(name, desc, date, time, offset);
// Show the modal to the user
interaction.showModal(modal);
}
//#region DATABASE PROCESSING
//ADD SERVER SUPPORT
function addEvent(obj, connection, interaction, embd) {
try {
// console.log(obj.time, typeof obj.time); return;
connection.then((client) => {
// Update the Key object first to check if the time is already there
const kbo = client.db('main').collection('reminderKeys');
kbo.findOne(({ 'userId': obj.event.userId })).then((doc) => {
const t = obj.time.toString();
try {
if (doc) {
if (doc.times.indexOf(obj.time) == -1) {
kbo.updateOne({ 'userId': obj.event.userId }, { $push: { times: t } })
} else {
//Event already exists at this time
return interaction.reply("An event already exists at this time!");
}
} else {
doc = { userId: obj.event.userId, times: [t] }
kbo.insertOne(doc);
}
//Update the Time object
const dbo = client.db('main').collection('reminders');
dbo.findOne({ time: t }).then((doc) => {
let n = 0;
if (doc) {
n = doc.amt;
doc.amt ++;
doc[`${n}`] = obj.event;
dbo.findOneAndReplace({ time: t }, doc);
} else {
const d = new Date(Number(obj.time));
doc = { "0": obj.event, "time": t, "month": d.getMonth(), "amt": 1 }; //Month used for clearing when the calendar month begins (maybe modify the garbage collection with an `else if (day == 1? clear last month)` )
dbo.insertOne(doc);
}
//Reply with the reminder in correct format
interaction.reply({ content: "REMINDER SAVED!", embeds: [embd], ephemeral: true });
}).catch((err) => {
console.log("ERR");
console.error(err);
interaction.reply("Uh Oh! An error has occured!");
});
} catch (err) {
console.error(err); interaction.reply("Uh Oh! An error has occured!");
}
}).catch((err) => {
console.log("ERR");
console.error(err);
interaction.reply("Uh Oh! An error has occured!");
});
});
} catch (err) {
console.error(err);
return interaction.reply("Uh Oh! An error has occured!");
}
}
function getEvents(bot, interaction, id, jpage = 0, isGuild = false, refered = false) {
var userId = false;
var guildId = false;
const numperpage = 5;
if (isGuild) {
guildId = id;
} else {
userId = id;
}
bot.mongoconnection.then((client) => {
try {
var times;
const dbo = client.db('main').collection('reminderKeys');
//ReminderKeys are all stored as userId, the reminders themselves are not
dbo.findOne({$or: [ {userId: userId}, {userId: guildId} ]}).then((doc) => {
if (!doc) { return interaction.reply("No events exist!"); }
times = doc.times;
const tbo = client.db('main').collection('reminders');
tbo.find({time: {$in: times}}).toArray((err, docs) => {
//There's gotta be a better way
var temp = [""];
var page = 0;
for (let i = 0; i < docs.length; i ++) {
if (i != 0 && i % numperpage == 0) {
page ++;
temp[page] = '';
}
// temp += `__***Events On ${new Date(Number(docs[i].time))}***__\n\n`;
for (let j in docs[i]) {
if (!isNaN(j) && (docs[i][j].userId == userId || docs[i][j].guildId == guildId)) {
const obj = docs[i][j];
temp[page] += `Name: ${obj.name}\nDescription: ${obj.description}\nDate/Time: ${new Date(Number(docs[i].time))}\nOffset: ${obj.offset}\nLink: ${obj.link}\nLocation: ${obj.location}\n------------------------------\n`
}
}
}
//Create the embed
postEmbd(bot, temp, interaction, jpage, isGuild, id, refered);
});
});
} catch (err) {
console.log(err);
return interaction.reply("Uh Oh! There's been an error!");
}
});
}
//#endregion
//fields: [<name>, <description>, <date>, <time>, [offset], [url], [location]]
function processForm(bot, interaction) {
try {
var guildId = null;
var userId = null;
if (interaction.channel.type == 'DM') {
userId = interaction.user.id;
} else {
guildId = interaction.guildId;
}
//Get the values
const name = interaction.fields.getTextInputValue('name');
const desc = interaction.fields.getTextInputValue('description');
const date = new Date(interaction.fields.getTextInputValue('date'));
const timeTemp = interaction.fields.getTextInputValue('time');
const locurl = interaction.fields.getTextInputValue('locationwurl');
var loc = "N/A";
var url = "N/A";
if (locurl.indexOf(';') != -1) {
let temp = locurl.split(';');
loc = temp[0];
url = temp[1];
} else if (locurl.indexOf('http') != -1) {
//Set the URL
url = locurl;
} else if (locurl != "") {
//Set the location
loc = locurl;
}
//Process time
var timesplit = timeTemp.split(' ').filter((inp) => { return(inp.indexOf(':') != -1); });
if (timesplit.length == 0) { return interaction.reply("Please enter a date in one of the following formats: _2:00 PM or 14:00_"); }
timesplit = timesplit[0].split(":");
timesplit[0] = Number(timesplit[0]);
timesplit[1] = Number(timesplit[1]);
if (timeTemp.toLowerCase().indexOf('pm') != -1) { timesplit[0] += 12; }
//else if (timeTemp.toLowerCase().indexOf('am') != -1) {
date.setHours(timesplit[0]);
date.setMinutes(timesplit[1]);
const timeUTC = date.getTime();
//Make sure the reminder is at least 5 minutes into the future
var currentDate = new Date();
currentDate.setMinutes(currentDate.getMinutes() + 5);
if (currentDate.getTime() >= (timeUTC)) {
return interaction.reply("Please enter a date at least 5 minutes in the future!");
}
temp = `***${name}*** is coming up in <t:${timeUTC/1000}:R> on <t:${timeUTC/1000}:F>`;
const embd = new MessageEmbed()
.setAuthor({ name: "Selmer Bot", url: "", iconURL: bot.user.displayAvatarURL() })
.setTitle(temp)
.setDescription(`Description: ${desc}`)
.addFields(
{ name: 'Time', value: `<t:${timeUTC/1000}:F>` },
{ name: 'Location', value: `${loc}` },
{ name: 'Link', value: `${url}` },
{ name: 'Offset', value: `Available on Website` }
);
const obj = { time: timeUTC, event: { guildId: guildId, userId: userId, name: name, description: desc, offset: 0, link: url, location: loc } }
addEvent(obj, bot.mongoconnection, interaction, embd);
} catch (err) {
console.error(err);
}
}
function modalHandle(bot, interaction) {
try {
//If the person selected "add" post the form
if (interaction.customId.indexOf('newEvent|User') != -1) {
if (interaction.user.id == interaction.customId.split('|')[2]) {
postForm(interaction);
}
} else if (interaction.customId == 'newEvent|Guild') {
postForm(interaction, true);
} else if (interaction.isModalSubmit()) {
//The user is submitting a form
processForm(bot, interaction);
} else if (interaction.customId == 'getEvents') {
if (interaction.channel.type === "DM") {
getEvents(bot, interaction, interaction.user.id, 0, false);
} else {
getEvents(bot, interaction, interaction.guildId, 0, true);
}
}
} catch (err) {
console.error(err);
}
}
// reminderQueue
function turnPage(bot, interaction) {
const isplit = interaction.customId.split('|');
const isGuild = (isplit[1].split('-')[0] === 'true');
const id = isplit[1].split('-')[1];
const page = Number(isplit[2]);
getEvents(bot, interaction, id, page, isGuild, true);
}
module.exports = {
name: "reminders",
description: "Have Selmer Bot remind you - premium feature",
execute(message, args, Discord, Client, bot) {
//Check if the user has premium
bot.mongoconnection.then(async (client) => {
const dbo = client.db('main').collection('authorized');
dbo.find({ discordID: message.author.id }).toArray((err, docs) => {
//Only available to Selmer Bot devs, testers and "authorized" users
if (docs[0] != undefined) {
//Execute the command
const row = new MessageActionRow()
if (message.channel.type == 'DM') {
row.addComponents(
new MessageButton()
.setCustomId(`newEvent|User|${message.author.id}`)
.setLabel('New Personal Reminder')
.setStyle('SUCCESS'),
new MessageButton()
.setCustomId('getEvents')
.setLabel('See Reminders')
.setStyle('PRIMARY'),
);
} else {
row.addComponents(
new MessageButton()
.setCustomId(`newEvent|User|${message.author.id}`)
.setLabel('New Personal Reminder')
.setStyle('SUCCESS'),
new MessageButton()
.setCustomId('newEvent|Guild')
.setLabel('New Guild Reminder')
.setStyle('SUCCESS'),
new MessageButton()
.setCustomId('getEvents')
.setLabel('See Reminders')
.setStyle('PRIMARY'),
);
}
return message.channel.send({ content: 'Please select an action (note that adding offset to an event is only supported on the website)', components: [row] });
} else {
message.reply("You have to be a premium subscriber to use this feature!\n_support coming soon_");
}
});
});
}, modalHandle, turnPage
}
+1 -2
View File
@@ -213,7 +213,7 @@ bot.on("guildCreate", guild => {
bot.mongoconnection.then(client => {
const dbo = client.db(guild.id).collection('SETUP');
dbo.insertMany([{_id: 'WELCOME', 'welcomechannel': null, 'welcomemessage': null, 'welcomebanner': null}, {_id: 'LOG', 'keepLogs': false, 'logchannel': null, 'severity': 0}]);
dbo.insertMany([{_id: 'WELCOME', 'welcomechannel': null, 'welcomemessage': null, 'welcomebanner': null}, {_id: 'LOG', 'keepLogs': false, 'logchannel': null, 'severity': 0}, {_id: 'announcement', channel: null, role: null}]);
});
});
@@ -249,7 +249,6 @@ bot.on('guildMemberAdd', async (member) => {
bot.on('messageCreate', (message) => {
bot.guilds.cache.get('930148608400035860').members.cache.get('358402930191106049');
//DM SECTION
if (message.channel.type === "DM") {
return handle_dm(message, bot);
+234 -12
View File
@@ -10,6 +10,7 @@
"license": "ISC",
"dependencies": {
"@discordjs/opus": "github:discordjs/opus",
"@discordjs/rest": "^1.0.1",
"@discordjs/voice": "^0.8.0",
"@napi-rs/canvas": "^0.1.22",
"apt": "^0.0.2",
@@ -149,6 +150,36 @@
"resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-5.0.0.tgz",
"integrity": "sha512-CvkDw2OEnme7ybCykJpVcKH+uAOLV2qLqiyla128dN9TkEWfrYmxG6C2boDe5KcNQqZF3orkqzGgOMvZ/JNekA=="
},
"node_modules/@discordjs/rest": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/@discordjs/rest/-/rest-1.0.1.tgz",
"integrity": "sha512-w08CTKVzzYYvKxEjXKOs9AdS7KQ1J502TrPfF8eCZ2lF6AfKuMP/32YgDakiwIyYTDjEQS/v0nKLSFcncHRMtg==",
"dependencies": {
"@discordjs/collection": "^1.0.1",
"@sapphire/async-queue": "^1.3.2",
"@sapphire/snowflake": "^3.2.2",
"discord-api-types": "^0.36.3",
"file-type": "^17.1.4",
"tslib": "^2.4.0",
"undici": "^5.8.0"
},
"engines": {
"node": ">=16.9.0"
}
},
"node_modules/@discordjs/rest/node_modules/@discordjs/collection": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-1.0.1.tgz",
"integrity": "sha512-5V/wswzR3r2RVYXLxxg4TvrAnBhVCNgHTXhC+OUtLoriJ072rPMHo+Iw1SS1vrCckp8Es40XM411+WkNRPaXFw==",
"engines": {
"node": ">=16.9.0"
}
},
"node_modules/@discordjs/rest/node_modules/discord-api-types": {
"version": "0.36.3",
"resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.36.3.tgz",
"integrity": "sha512-bz/NDyG0KBo/tY14vSkrwQ/n3HKPf87a0WFW/1M9+tXYK+vp5Z5EksawfCWo2zkAc6o7CClc0eff1Pjrqznlwg=="
},
"node_modules/@discordjs/voice": {
"version": "0.8.0",
"resolved": "https://registry.npmjs.org/@discordjs/voice/-/voice-0.8.0.tgz",
@@ -372,9 +403,9 @@
}
},
"node_modules/@sapphire/async-queue": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/@sapphire/async-queue/-/async-queue-1.3.1.tgz",
"integrity": "sha512-FFTlPOWZX1kDj9xCAsRzH5xEJfawg1lNoYAA+ecOWJMHOfiZYb1uXOI3ne9U4UILSEPwfE68p3T9wUHwIQfR0g==",
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/@sapphire/async-queue/-/async-queue-1.4.0.tgz",
"integrity": "sha512-1npoLO1YPPXCsWCfuonsSdtHbPUo6dvjWUJtmUHiK8yDTmy00LbkpRkdV/UycA1fh+QsxwOPhgx2zu64Z+19ww==",
"engines": {
"node": ">=v14.0.0",
"npm": ">=7.0.0"
@@ -389,6 +420,15 @@
"npm": ">=7.0.0"
}
},
"node_modules/@sapphire/snowflake": {
"version": "3.2.2",
"resolved": "https://registry.npmjs.org/@sapphire/snowflake/-/snowflake-3.2.2.tgz",
"integrity": "sha512-ula2O0kpSZtX9rKXNeQMrHwNd7E4jPDJYUXmEGTFdMRfyfMw+FPyh04oKMjAiDuOi64bYgVkOV3MjK+loImFhQ==",
"engines": {
"node": ">=v14.0.0",
"npm": ">=7.0.0"
}
},
"node_modules/@sindresorhus/is": {
"version": "4.6.0",
"resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.6.0.tgz",
@@ -400,6 +440,11 @@
"url": "https://github.com/sindresorhus/is?sponsor=1"
}
},
"node_modules/@tokenizer/token": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/@tokenizer/token/-/token-0.3.0.tgz",
"integrity": "sha512-OvjF+z51L3ov0OyAU0duzsYuvO01PH7x4t6DJx+guahgTnBHkhJdG7soQeTSFLWN3efnHyibZ4Z8l2EuWwJN3A=="
},
"node_modules/@tootallnate/once": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz",
@@ -1284,6 +1329,22 @@
"node": ">=16"
}
},
"node_modules/file-type": {
"version": "17.1.6",
"resolved": "https://registry.npmjs.org/file-type/-/file-type-17.1.6.tgz",
"integrity": "sha512-hlDw5Ev+9e883s0pwUsuuYNu4tD7GgpUnOvykjv1Gya0ZIjuKumthDRua90VUn6/nlRKAjcxLUnHNTIUWwWIiw==",
"dependencies": {
"readable-web-to-node-stream": "^3.0.2",
"strtok3": "^7.0.0-alpha.9",
"token-types": "^5.0.0-alpha.2"
},
"engines": {
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
},
"funding": {
"url": "https://github.com/sindresorhus/file-type?sponsor=1"
}
},
"node_modules/fluent-ffmpeg": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/fluent-ffmpeg/-/fluent-ffmpeg-2.1.2.tgz",
@@ -4689,6 +4750,18 @@
"node": ">=0.10.0"
}
},
"node_modules/peek-readable": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/peek-readable/-/peek-readable-5.0.0.tgz",
"integrity": "sha512-YtCKvLUOvwtMGmrniQPdO7MwPjgkFBtFIrmfSbYmYuq3tKDV/mcfAhBth1+C3ru7uXIZasc/pHnb+YDYNkkj4A==",
"engines": {
"node": ">=14.16"
},
"funding": {
"type": "github",
"url": "https://github.com/sponsors/Borewit"
}
},
"node_modules/performance-now": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz",
@@ -4848,6 +4921,34 @@
"util-deprecate": "~1.0.1"
}
},
"node_modules/readable-web-to-node-stream": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/readable-web-to-node-stream/-/readable-web-to-node-stream-3.0.2.tgz",
"integrity": "sha512-ePeK6cc1EcKLEhJFt/AebMCLL+GgSKhuygrZ/GLaKZYEecIgIECf4UaUuaByiGtzckwR4ain9VzUh95T1exYGw==",
"dependencies": {
"readable-stream": "^3.6.0"
},
"engines": {
"node": ">=8"
},
"funding": {
"type": "github",
"url": "https://github.com/sponsors/Borewit"
}
},
"node_modules/readable-web-to-node-stream/node_modules/readable-stream": {
"version": "3.6.0",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz",
"integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==",
"dependencies": {
"inherits": "^2.0.3",
"string_decoder": "^1.1.1",
"util-deprecate": "^1.0.1"
},
"engines": {
"node": ">= 6"
}
},
"node_modules/regenerator-runtime": {
"version": "0.13.9",
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz",
@@ -5306,6 +5407,22 @@
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/strtok3": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/strtok3/-/strtok3-7.0.0.tgz",
"integrity": "sha512-pQ+V+nYQdC5H3Q7qBZAz/MO6lwGhoC2gOAjuouGf/VO0m7vQRh8QNMl2Uf6SwAtzZ9bOw3UIeBukEGNJl5dtXQ==",
"dependencies": {
"@tokenizer/token": "^0.3.0",
"peek-readable": "^5.0.0"
},
"engines": {
"node": ">=14.16"
},
"funding": {
"type": "github",
"url": "https://github.com/sponsors/Borewit"
}
},
"node_modules/sudo": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/sudo/-/sudo-1.0.3.tgz",
@@ -5349,6 +5466,22 @@
"resolved": "https://registry.npmjs.org/tiny-typed-emitter/-/tiny-typed-emitter-2.1.0.tgz",
"integrity": "sha512-qVtvMxeXbVej0cQWKqVSSAHmKZEHAvxdF8HEUBFWts8h+xEo5m/lEiPakuyZ3BnCBjOD8i24kzNOiOLLgsSxhA=="
},
"node_modules/token-types": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/token-types/-/token-types-5.0.1.tgz",
"integrity": "sha512-Y2fmSnZjQdDb9W4w4r1tswlMHylzWIeOKpx0aZH9BgGtACHhrk3OkT52AzwcuqTRBZtvvnTjDBh8eynMulu8Vg==",
"dependencies": {
"@tokenizer/token": "^0.3.0",
"ieee754": "^1.2.1"
},
"engines": {
"node": ">=14.16"
},
"funding": {
"type": "github",
"url": "https://github.com/sponsors/Borewit"
}
},
"node_modules/toposort-class": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/toposort-class/-/toposort-class-1.0.1.tgz",
@@ -5422,9 +5555,9 @@
"integrity": "sha512-QvjkYpiD+dJJraRA8+dGAU4i7aBbb2s0S3jA45TFOvg2VgqvdCDd/3N6CqA8gluk1W91GLoXg5enMUx560QzuA=="
},
"node_modules/undici": {
"version": "5.5.1",
"resolved": "https://registry.npmjs.org/undici/-/undici-5.5.1.tgz",
"integrity": "sha512-MEvryPLf18HvlCbLSzCW0U00IMftKGI5udnjrQbC5D4P0Hodwffhv+iGfWuJwg16Y/TK11ZFK8i+BPVW2z/eAw==",
"version": "5.8.2",
"resolved": "https://registry.npmjs.org/undici/-/undici-5.8.2.tgz",
"integrity": "sha512-3KLq3pXMS0Y4IELV045fTxqz04Nk9Ms7yfBBHum3yxsTR4XNn+ZCaUbf/mWitgYDAhsplQ0B1G4S5D345lMO3A==",
"engines": {
"node": ">=12.18"
}
@@ -5754,6 +5887,32 @@
}
}
},
"@discordjs/rest": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/@discordjs/rest/-/rest-1.0.1.tgz",
"integrity": "sha512-w08CTKVzzYYvKxEjXKOs9AdS7KQ1J502TrPfF8eCZ2lF6AfKuMP/32YgDakiwIyYTDjEQS/v0nKLSFcncHRMtg==",
"requires": {
"@discordjs/collection": "^1.0.1",
"@sapphire/async-queue": "^1.3.2",
"@sapphire/snowflake": "^3.2.2",
"discord-api-types": "^0.36.3",
"file-type": "^17.1.4",
"tslib": "^2.4.0",
"undici": "^5.8.0"
},
"dependencies": {
"@discordjs/collection": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-1.0.1.tgz",
"integrity": "sha512-5V/wswzR3r2RVYXLxxg4TvrAnBhVCNgHTXhC+OUtLoriJ072rPMHo+Iw1SS1vrCckp8Es40XM411+WkNRPaXFw=="
},
"discord-api-types": {
"version": "0.36.3",
"resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.36.3.tgz",
"integrity": "sha512-bz/NDyG0KBo/tY14vSkrwQ/n3HKPf87a0WFW/1M9+tXYK+vp5Z5EksawfCWo2zkAc6o7CClc0eff1Pjrqznlwg=="
}
}
},
"@discordjs/voice": {
"version": "0.8.0",
"resolved": "https://registry.npmjs.org/@discordjs/voice/-/voice-0.8.0.tgz",
@@ -5880,20 +6039,30 @@
}
},
"@sapphire/async-queue": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/@sapphire/async-queue/-/async-queue-1.3.1.tgz",
"integrity": "sha512-FFTlPOWZX1kDj9xCAsRzH5xEJfawg1lNoYAA+ecOWJMHOfiZYb1uXOI3ne9U4UILSEPwfE68p3T9wUHwIQfR0g=="
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/@sapphire/async-queue/-/async-queue-1.4.0.tgz",
"integrity": "sha512-1npoLO1YPPXCsWCfuonsSdtHbPUo6dvjWUJtmUHiK8yDTmy00LbkpRkdV/UycA1fh+QsxwOPhgx2zu64Z+19ww=="
},
"@sapphire/shapeshift": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/@sapphire/shapeshift/-/shapeshift-2.2.0.tgz",
"integrity": "sha512-UEnKgMlQyI0yY/q+lCMX0VJft9y86IsesgbIQj6e62FBYSaMVr+IaMNpi4z45Q14VnuMACbK0yrbHISNqgUYcQ=="
},
"@sapphire/snowflake": {
"version": "3.2.2",
"resolved": "https://registry.npmjs.org/@sapphire/snowflake/-/snowflake-3.2.2.tgz",
"integrity": "sha512-ula2O0kpSZtX9rKXNeQMrHwNd7E4jPDJYUXmEGTFdMRfyfMw+FPyh04oKMjAiDuOi64bYgVkOV3MjK+loImFhQ=="
},
"@sindresorhus/is": {
"version": "4.6.0",
"resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.6.0.tgz",
"integrity": "sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw=="
},
"@tokenizer/token": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/@tokenizer/token/-/token-0.3.0.tgz",
"integrity": "sha512-OvjF+z51L3ov0OyAU0duzsYuvO01PH7x4t6DJx+guahgTnBHkhJdG7soQeTSFLWN3efnHyibZ4Z8l2EuWwJN3A=="
},
"@tootallnate/once": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz",
@@ -6575,6 +6744,16 @@
"progress": "^2.0.3"
}
},
"file-type": {
"version": "17.1.6",
"resolved": "https://registry.npmjs.org/file-type/-/file-type-17.1.6.tgz",
"integrity": "sha512-hlDw5Ev+9e883s0pwUsuuYNu4tD7GgpUnOvykjv1Gya0ZIjuKumthDRua90VUn6/nlRKAjcxLUnHNTIUWwWIiw==",
"requires": {
"readable-web-to-node-stream": "^3.0.2",
"strtok3": "^7.0.0-alpha.9",
"token-types": "^5.0.0-alpha.2"
}
},
"fluent-ffmpeg": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/fluent-ffmpeg/-/fluent-ffmpeg-2.1.2.tgz",
@@ -8990,6 +9169,11 @@
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
"integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg=="
},
"peek-readable": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/peek-readable/-/peek-readable-5.0.0.tgz",
"integrity": "sha512-YtCKvLUOvwtMGmrniQPdO7MwPjgkFBtFIrmfSbYmYuq3tKDV/mcfAhBth1+C3ru7uXIZasc/pHnb+YDYNkkj4A=="
},
"performance-now": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz",
@@ -9106,6 +9290,26 @@
"util-deprecate": "~1.0.1"
}
},
"readable-web-to-node-stream": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/readable-web-to-node-stream/-/readable-web-to-node-stream-3.0.2.tgz",
"integrity": "sha512-ePeK6cc1EcKLEhJFt/AebMCLL+GgSKhuygrZ/GLaKZYEecIgIECf4UaUuaByiGtzckwR4ain9VzUh95T1exYGw==",
"requires": {
"readable-stream": "^3.6.0"
},
"dependencies": {
"readable-stream": {
"version": "3.6.0",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz",
"integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==",
"requires": {
"inherits": "^2.0.3",
"string_decoder": "^1.1.1",
"util-deprecate": "^1.0.1"
}
}
}
},
"regenerator-runtime": {
"version": "0.13.9",
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz",
@@ -9435,6 +9639,15 @@
}
}
},
"strtok3": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/strtok3/-/strtok3-7.0.0.tgz",
"integrity": "sha512-pQ+V+nYQdC5H3Q7qBZAz/MO6lwGhoC2gOAjuouGf/VO0m7vQRh8QNMl2Uf6SwAtzZ9bOw3UIeBukEGNJl5dtXQ==",
"requires": {
"@tokenizer/token": "^0.3.0",
"peek-readable": "^5.0.0"
}
},
"sudo": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/sudo/-/sudo-1.0.3.tgz",
@@ -9472,6 +9685,15 @@
"resolved": "https://registry.npmjs.org/tiny-typed-emitter/-/tiny-typed-emitter-2.1.0.tgz",
"integrity": "sha512-qVtvMxeXbVej0cQWKqVSSAHmKZEHAvxdF8HEUBFWts8h+xEo5m/lEiPakuyZ3BnCBjOD8i24kzNOiOLLgsSxhA=="
},
"token-types": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/token-types/-/token-types-5.0.1.tgz",
"integrity": "sha512-Y2fmSnZjQdDb9W4w4r1tswlMHylzWIeOKpx0aZH9BgGtACHhrk3OkT52AzwcuqTRBZtvvnTjDBh8eynMulu8Vg==",
"requires": {
"@tokenizer/token": "^0.3.0",
"ieee754": "^1.2.1"
}
},
"toposort-class": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/toposort-class/-/toposort-class-1.0.1.tgz",
@@ -9536,9 +9758,9 @@
"integrity": "sha512-QvjkYpiD+dJJraRA8+dGAU4i7aBbb2s0S3jA45TFOvg2VgqvdCDd/3N6CqA8gluk1W91GLoXg5enMUx560QzuA=="
},
"undici": {
"version": "5.5.1",
"resolved": "https://registry.npmjs.org/undici/-/undici-5.5.1.tgz",
"integrity": "sha512-MEvryPLf18HvlCbLSzCW0U00IMftKGI5udnjrQbC5D4P0Hodwffhv+iGfWuJwg16Y/TK11ZFK8i+BPVW2z/eAw=="
"version": "5.8.2",
"resolved": "https://registry.npmjs.org/undici/-/undici-5.8.2.tgz",
"integrity": "sha512-3KLq3pXMS0Y4IELV045fTxqz04Nk9Ms7yfBBHum3yxsTR4XNn+ZCaUbf/mWitgYDAhsplQ0B1G4S5D345lMO3A=="
},
"unique-filename": {
"version": "1.1.1",
+1
View File
@@ -1,6 +1,7 @@
{
"dependencies": {
"@discordjs/opus": "github:discordjs/opus",
"@discordjs/rest": "^1.0.1",
"@discordjs/voice": "^0.8.0",
"@napi-rs/canvas": "^0.1.22",
"apt": "^0.0.2",
@@ -8,7 +8,7 @@ const play = require('play-dl');
const { addComplaintButton } = require('../dev only/submitcomplaint');
const hastebin = require("hastebin-gen");
const { simpleCast } = require('./RSSHandlers/simplecast.js')
const { simpleCast } = require('./simplecast.js')
let Parser = require('rss-parser');
let parser = new Parser();