mirror of
https://github.com/ION606/selmerBot.git
synced 2026-06-05 23:06:14 +00:00
Added cards to the leveling system, and fixed some bugs. Note that node-fetch has been bumped DOWN to v2 to avoid EMS format
This commit is contained in:
@@ -13,13 +13,15 @@ async function setCard(bot, interaction) {
|
||||
|
||||
|
||||
function textToLevels(bot, message, xp_list) {
|
||||
if (!bot.inDebugMode && message.guild.id == bot.home_server) { return; }
|
||||
|
||||
const author = message.author;
|
||||
// doc.xp + (BASE.XP * doc.rank)
|
||||
bot.mongoconnection.then((client) => {
|
||||
const serverOpts = client.db(message.guild.id).collection('SETUP');
|
||||
serverOpts.findOne({_id: "LEVELING"}).then((doc) => {
|
||||
if (!doc) {
|
||||
serverOpts.insertOne({_id: "LEVELING", enabled: false, card: undefined, text: undefined});
|
||||
serverOpts.insertOne({_id: "LEVELING", enabled: false, card: undefined, text: undefined, col: "#FFFFFF"});
|
||||
const server = bot.guilds.cache.get(message.guild.id);
|
||||
server.members.fetch(message.guild.ownerId).then(function(owner) {
|
||||
// Implement `setup leveling enable`
|
||||
@@ -29,7 +31,7 @@ function textToLevels(bot, message, xp_list) {
|
||||
const dbo = client.db(message.guild.id).collection(author.id);
|
||||
dbo.findOne({"balance": {$exists: true}}).then((doc) => {
|
||||
const newXp = doc.xp + Math.ceil((BASE.XP * doc.rank) / 4);
|
||||
addxp(message, dbo, newXp, xp_list, true);
|
||||
addxp(bot, message, dbo, newXp, xp_list, true);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
const Discord = require('discord.js');
|
||||
|
||||
/**
|
||||
* @description a fun little easter egg mention function
|
||||
* @param {Discord.Message} message
|
||||
*/
|
||||
function replies(bot, message) {
|
||||
const c = message.content.replace(`<@${bot.user.id}>`, "").toLowerCase().trim();
|
||||
var s = "";
|
||||
|
||||
switch (c) {
|
||||
case "hi":
|
||||
case "hello":
|
||||
case "hya":
|
||||
s = "Hi there! :wave:";
|
||||
break;
|
||||
|
||||
case "i love you":
|
||||
s = "seek help :smile:";
|
||||
break;
|
||||
|
||||
case "chicken nuggets":
|
||||
s = "nom nom nom";
|
||||
break;
|
||||
|
||||
case "chimkin nungits":
|
||||
s = "marry me :heart_eyes:";
|
||||
break;
|
||||
|
||||
case "😉":
|
||||
s = ":wink:";
|
||||
break;
|
||||
|
||||
case "😜":
|
||||
s = "😜";
|
||||
break;
|
||||
|
||||
case "🍆":
|
||||
case "🍑":
|
||||
case "🍌":
|
||||
s = "❌";
|
||||
break;
|
||||
|
||||
case "💩":
|
||||
s = "🤮";
|
||||
break;
|
||||
|
||||
default: s = "I'm not sure what that means! Please use `/help` for a comprehensive list of commands!\n\n_PS - If you want to make full use of the bot's AI capabilities, consider Selmer Bot Premium. See more at https://selmerbot.com/premium _";
|
||||
}
|
||||
|
||||
message.reply(s).catch(() => { message.channel.send(s); });
|
||||
}
|
||||
|
||||
module.exports = replies;
|
||||
@@ -18,7 +18,7 @@ module.exports = {
|
||||
|
||||
new MessageButton()
|
||||
.setStyle("LINK")
|
||||
.setURL("https://www.selmerbot.com/")
|
||||
.setURL("https://selmerbot.com/")
|
||||
.setLabel("Website"),
|
||||
|
||||
new MessageButton()
|
||||
|
||||
@@ -12,7 +12,7 @@ const tutoText = [
|
||||
"__**SELMER SPECIFIC**__\nThese commands will probably be found nowhere else\nThese include quotes (For legal reasons I have to state they aren't real quotes, mostly), as well as varius other things I based on good old Selmer\n\n__***COMMANDS***__\narrow, extracredit, tuto, profile, quotes",
|
||||
"__**MISCELLANEOUS**__\nThese are the commands that are not really in any of the other categories. Don't be fooled, these are actually some of the most useful commands Selmer Bot has to offer. From playing music to web scraping to memes, I'm sure Selmer Bot has what you're looking for\n\n__***COMMANDS***__\nhelp, kareoke, link, meme, pickupline, audio, react, scrape, stocks, crypto",
|
||||
"__**DM COMMANDS**__\nThese commands will only work in DM's. All these commands will only work with Selmer Bot Premium (it's on the next page).\nThese features include Reminders (AKA a calendar) and Selmer Bot's own chat AI\n\n__***COMMANDS***__\nchat, startconvo, endconvo, premium",
|
||||
"__**SELMER BOT PREMIUM**__\nUse an AI chat, complete with semi-accurate IRL data, have Selmer Bot remind you of events with an easy-to-use interface and even a clickable calendar on the Selmer Bot website (_www.selmerbot.com_)\n\n__***COMMANDS***__\npremium, premium buy, premium manage, reminders",
|
||||
"__**SELMER BOT PREMIUM**__\nUse an AI chat, complete with semi-accurate IRL data, have Selmer Bot remind you of events with an easy-to-use interface and even a clickable calendar on the Selmer Bot website (_ https://selmerbot.com _)\n\n__***COMMANDS***__\npremium, premium buy, premium manage, reminders",
|
||||
"__**Thank you for completing the Selmer Bot Tutorial**__\n\nTry out Selmer Bot's features, play the games and most importantly, have fun\n\n-The Selmer Bot Team AKA ION606"
|
||||
];
|
||||
|
||||
@@ -29,7 +29,7 @@ function postEmbd(bot, interaction, page, refered) {
|
||||
te.setAuthor(author)
|
||||
.setTitle("Selmer Bot Tutorial")
|
||||
.setDescription(tutoText[page])
|
||||
.setURL('https://www.selmerbot.com/')
|
||||
.setURL('https://selmerbot.com/')
|
||||
.setFooter({ text: `Page ${page + 1}` });
|
||||
|
||||
|
||||
@@ -66,9 +66,9 @@ function postEmbd(bot, interaction, page, refered) {
|
||||
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: [te], components: [row] });
|
||||
interaction.update({ content: '_Note: To see a full list of reminder stats visit selmerbot.com _', embeds: [te], components: [row] });
|
||||
} else {
|
||||
interaction.channel.send({ content: '_Note: To see a full list of reminder stats visit www.selmerbot.com _', embeds: [te], components: [row] });
|
||||
interaction.channel.send({ content: '_Note: To see a full list of reminder stats visit selmerbot.com _', embeds: [te], components: [row] });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user