mirror of
https://github.com/ION606/selmerBot.git
synced 2026-05-15 05:36:54 +00:00
Added the ability to collect spam with a ommand, cleaned up the code and modified the LISCENCE.md file
This commit is contained in:
@@ -3,7 +3,7 @@ const { exit } = require('process');
|
||||
const { checkResponses } = require('./wordlist.js');
|
||||
|
||||
|
||||
//Error checking function (message deleted error fix)
|
||||
//Error checking function (message deleted error fix, workaround already applied but...)
|
||||
//message.channel.send("Oops, there's been an error, please contact support!");
|
||||
async function messageExists(message) {
|
||||
return new Promise((resolve, reject) => {
|
||||
|
||||
+7
-12
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
-----WEBHOOKS ARE RECIEVED AND MONITORED HERE-----
|
||||
-----WEBHOOKS ARE MONITORED AND PROCESSED HERE-----
|
||||
https://glitch.com/edit/#!/selmer-bot-listener
|
||||
--------------------------------------------------
|
||||
*/
|
||||
@@ -13,7 +13,7 @@ async function createSubscriptionManual(bot, interaction, id, priceID) {
|
||||
const stripe = bot.stripe;
|
||||
const mongouri = bot.mongouri;
|
||||
|
||||
//Start Error Checking
|
||||
//Error Checking (unlikely, but just in case)
|
||||
if (!id) { console.log('....What? How?'); return interaction.editReply("Uh oh, something happened with the Stripe Discord ID check, please contact support!"); }
|
||||
|
||||
const client = new MongoClient(mongouri, { useNewUrlParser: true, useUnifiedTopology: true, serverApi: ServerApiVersion.v1 });
|
||||
@@ -75,7 +75,7 @@ async function changeSubscriptionManual(bot, message) {
|
||||
const mongouri = bot.mongouri;
|
||||
const id = message.author.id;
|
||||
|
||||
//Start Error Checking
|
||||
//Just in case
|
||||
if (!id) { return console.log('....What? How?'); }
|
||||
|
||||
const client = new MongoClient(mongouri, { useNewUrlParser: true, useUnifiedTopology: true, serverApi: ServerApiVersion.v1 });
|
||||
@@ -105,17 +105,13 @@ async function changeSubscriptionManual(bot, message) {
|
||||
return_url: "https://linktr.ee/selmerbot",
|
||||
});
|
||||
message.reply(session.url);
|
||||
// console.log(session.url);
|
||||
}).catch((err) => {
|
||||
message.reply(err);
|
||||
// console.log(err);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function createDropDown(bot, message) {
|
||||
// const stripe = bot.stripe;
|
||||
|
||||
function createDropDown(bot, message) {
|
||||
const stripe = bot.stripe;
|
||||
|
||||
const pl = [];
|
||||
@@ -155,14 +151,13 @@ function createDropDown(bot, message) {
|
||||
|
||||
|
||||
function handleInp(bot, message) {
|
||||
if (message.content == '!premium help') {
|
||||
message.reply('Use _!premium buy_ to get premium or use _!premium manage_ to change or cancel your subscription\n_Disclaimer: Selmer Bot uses Stripe to manage payments. Read more at *https://stripe.com/ *_');
|
||||
if (message.content == '!premium' || message.content == '!premium help') {
|
||||
message.reply('Use _!premium buy_ to get premium or use _!premium manage_ to change or cancel your subscription\n\n_Disclaimer: Selmer Bot uses Stripe to manage payments. Read more at *https://stripe.com/ *_');
|
||||
} else if (message.content == '!premium buy') {
|
||||
createDropDown(bot, message);
|
||||
} else if (message.content == '!premium manage') {
|
||||
changeSubscriptionManual(bot, message)
|
||||
changeSubscriptionManual(bot, message);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -17,15 +17,12 @@ function checkResponses(convoOG, answer) {
|
||||
|
||||
if (b === 'pay') {
|
||||
//Exctract the number
|
||||
var amt = convoOG.match(/(\d+)/)[0];
|
||||
// var amt = convoOG.match(/(\d+)/)[0];
|
||||
// currency = convoOG[convoOG.indexOf(amt) - 1];
|
||||
|
||||
|
||||
if (matches) {
|
||||
currency = convoOG[convoOG.indexOf(amt) - 1];
|
||||
//Do something with pay API to get the amount here
|
||||
}
|
||||
return ('Use _!premium_ to get Selmer Bot Premium now!');
|
||||
} else if (b == 'name') {
|
||||
return 'My name is Selmer Bot!';
|
||||
return ('My name is Selmer Bot!');
|
||||
} else { return null; }
|
||||
|
||||
return b;
|
||||
|
||||
Reference in New Issue
Block a user