Blacklists / Topic Settings / many more changes

This commit is contained in:
ry 2020-01-03 17:27:32 +01:00
parent 3793241426
commit 34c1822e97
19 changed files with 317 additions and 131 deletions

View File

@ -1,5 +1,6 @@
const { const {
eco eco,
db
} = require("../utils"); } = require("../utils");
const { const {
table table
@ -14,6 +15,10 @@ module.exports = {
if (Message.author.bot) return; if (Message.author.bot) return;
if (!Message.guild) return; if (!Message.guild) return;
if (Message.author.id !== '318044130796109825') return; if (Message.author.id !== '318044130796109825') return;
let UserFromDB = await db.blacklist(Message.author.id, 's')
if (UserFromDB.state) return;
await eco.CalculateFromMessage(Message) await eco.CalculateFromMessage(Message)
// console.log(Message) // console.log(Message)
} }

View File

@ -1,6 +1,14 @@
const { log, db } = require("../utils/index"); const {
const { ShortLinks } = require("../utils"); log,
const { table } = require("quick.db"); db
} = require("../utils/index");
const {
ShortLinks,
topic
} = require("../utils");
const {
table
} = require("quick.db");
const Servers = new table("servers"); const Servers = new table("servers");
const Users = new table("users"); const Users = new table("users");
const Backend = new table("backend"); const Backend = new table("backend");
@ -9,6 +17,12 @@ module.exports = {
name: "message", name: "message",
run: async (client, Message) => { run: async (client, Message) => {
if (Message.author.bot) return; if (Message.author.bot) return;
let UserFromDB = await db.blacklist(Message.author.id, 's')
if (UserFromDB.state) return;
if (topic.includesSetting('thaldrin.no-SL', Message.channel.topic)) return;
let Server = Servers.get(Message.guild.id); let Server = Servers.get(Message.guild.id);
let Enabled; let Enabled;
if (Server === null) { if (Server === null) {
@ -18,4 +32,4 @@ module.exports = {
} }
ShortLinks(Enabled, Message); ShortLinks(Enabled, Message);
} }
}; };

View File

@ -1,6 +1,14 @@
const { log, db } = require("../utils/index"); const {
const { SourceFynnder } = require("../utils"); log,
const { table } = require("quick.db"); db
} = require("../utils/index");
const {
SourceFynnder,
topic
} = require("../utils");
const {
table
} = require("quick.db");
const Servers = new table("servers"); const Servers = new table("servers");
const Users = new table("users"); const Users = new table("users");
const Backend = new table("backend"); const Backend = new table("backend");
@ -9,6 +17,12 @@ module.exports = {
name: "message", name: "message",
run: async (client, Message) => { run: async (client, Message) => {
if (Message.author.bot) return; if (Message.author.bot) return;
let UserFromDB = await db.blacklist(Message.author.id, 's')
if (UserFromDB.state) return;
if (topic.includesSetting('thaldrin.no-SF', Message.channel.topic)) return;
let Server = Servers.get(Message.guild.id); let Server = Servers.get(Message.guild.id);
let Enabled; let Enabled;
if (Server === null) { if (Server === null) {
@ -18,4 +32,4 @@ module.exports = {
} }
SourceFynnder(Enabled, Message); SourceFynnder(Enabled, Message);
} }
}; };

View File

@ -1,23 +1,36 @@
const { Collection, MessageEmbed } = require('discord.js'); const {
const { table } = require('quick.db'); Collection,
MessageEmbed
} = require('discord.js');
const {
table
} = require('quick.db');
const Servers = new table('servers'); const Servers = new table('servers');
const Users = new table('users'); const Users = new table('users');
const Backend = new table('backend'); const Backend = new table('backend');
const Trello = require('trello'); const Trello = require('trello');
const config = require('../config'); const config = require('../config');
const {
db,
topic
} = require('../utils')
const vars = require('../vars'); const vars = require('../vars');
const trello = new Trello(config.trello.key, config.trello.token); const trello = new Trello(config.trello.key, config.trello.token);
module.exports = { module.exports = {
name: 'message', name: 'message',
run: async (client, msg) => { run: async (client, msg) => {
//if (msg.author.id !== '318044130796109825') return;
if (msg.author.bot) return; if (msg.author.bot) return;
//if (msg.author.id !== '318044130796109825') return;
//console.log(msg.author.tag)
let UserFromDB = await db.blacklist(msg.author.id, 's')
if (UserFromDB.state) return;
const DefaultPrefix = client.config.prefixes; const DefaultPrefix = client.config.prefixes;
const CustomPrefix = Servers.get(msg.guild.id); const CustomPrefix = Servers.get(msg.guild.id);
if (!CustomPrefix) { if (!CustomPrefix) {
PrefixArray = [ DefaultPrefix /* , CustomPrefix */ ].flat(Infinity); PrefixArray = [DefaultPrefix /* , CustomPrefix */ ].flat(Infinity);
} else { } else {
PrefixArray = [ DefaultPrefix, CustomPrefix.prefix ].flat(Infinity); PrefixArray = [DefaultPrefix, CustomPrefix.prefix].flat(Infinity);
} }
let PREFIX; let PREFIX;
let EXISTS; let EXISTS;
@ -28,10 +41,14 @@ module.exports = {
} }
} }
if (!EXISTS) return; if (!EXISTS) return;
//console.log(topic.includesSetting('thaldrin.no-cmds', msg.channel.topic))
if (topic.includesSetting('thaldrin.no-cmd', msg.channel.topic)) return;
const args = msg.content.slice(PrefixArray[PREFIX].length).trim().split(/ +/g); const args = msg.content.slice(PrefixArray[PREFIX].length).trim().split(/ +/g);
const command = args.shift().toLowerCase(); const command = args.shift().toLowerCase();
const cmd = client.commands.find((c) => c.name == command || (c.aliases && c.aliases.includes(command))); const cmd = client.commands.find((c) => c.name == command || (c.aliases && c.aliases.includes(command)));
const ctx = { const ctx = {
send: msg.channel.send.bind(msg.channel), send: msg.channel.send.bind(msg.channel),
client, client,
@ -44,7 +61,11 @@ module.exports = {
author: msg.author, author: msg.author,
member: msg.member, member: msg.member,
trello, trello,
db: { users: Users, servers: Servers, backend: Backend }, db: {
users: Users,
servers: Servers,
backend: Backend
},
utils: require('../utils'), utils: require('../utils'),
config: require('../config'), config: require('../config'),
vars: require('../vars'), vars: require('../vars'),
@ -119,4 +140,4 @@ module.exports = {
}); });
} }
} }
}; };

View File

@ -0,0 +1,24 @@
const Command = require('../../src/structures/Command');
module.exports = class Blacklist extends Command {
constructor() {
super({
name: 'blacklist',
description: 'Master the Blacklist',
aliases: ['bl'],
module: 'Developers',
cooldown: 0,
guildOnly: false,
developerOnly: true
});
}
async command(ctx) {
console.log(ctx.args)
let ACTION = ctx.args[0]
let ID = ctx.args[1]
let REASON = ctx.args[2]
let X = await ctx.utils.db.blacklist(ID, ACTION, REASON)
console.log(X)
}
};

View File

@ -1,7 +1,9 @@
const Command = require("../../src/structures/Command"); const Command = require("../../src/structures/Command");
const exec = require("shell-exec"); const exec = require("shell-exec");
const dig = require("node-dig-dns"); const dig = require("node-dig-dns");
const { MessageEmbed } = require("discord.js"); const {
MessageEmbed
} = require("discord.js");
let DomainReg = new RegExp( let DomainReg = new RegExp(
`(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]` `(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]`
); );
@ -11,7 +13,7 @@ module.exports = class Dig extends Command {
name: "dig", name: "dig",
description: "dig website dns information stuff", description: "dig website dns information stuff",
aliases: [], aliases: [],
module: "General", module: "Developers",
cooldown: 10, cooldown: 10,
guildOnly: false, guildOnly: false,
developerOnly: true, developerOnly: true,
@ -40,4 +42,4 @@ module.exports = class Dig extends Command {
} }
ctx.send(DIG); ctx.send(DIG);
} }
}; };

View File

@ -0,0 +1,22 @@
const Command = require('../../src/structures/Command');
module.exports = class Crime extends Command {
constructor() {
super({
name: 'crime',
description: 'Commit crimes',
aliases: [],
module: 'Economy',
cooldown: 15,
guildOnly: true,
developerOnly: true,
nsfw: false
});
}
async command(ctx) {
ctx.utils.eco.quick('crime', ctx.author.id).then(r => {
ctx.send(r.text)
}).catch(error => ctx.send(`Error ${error.message}`))
}
}

View File

@ -16,7 +16,7 @@ module.exports = class Daily extends Command {
async command(ctx) { async command(ctx) {
ctx.utils.eco.Dailies().then(r => { ctx.utils.eco.Dailies().then(r => {
ctx.send(`**${r.amount}** has been added to your bank.`) ctx.send(`**${r.amount}**<:coin:574116462260912138> has been added to your bank.`)
}).catch(error => ctx.send(`You can get your dailies in ${error.message}`)) }).catch(error => ctx.send(`You can get your dailies in ${error.message}`))
} }
} }

View File

@ -16,7 +16,7 @@ module.exports = class Weekly extends Command {
async command(ctx) { async command(ctx) {
ctx.utils.eco.weekly().then(r => { ctx.utils.eco.weekly().then(r => {
ctx.send(`**${r.amount}** has been added to your bank.`) ctx.send(`**${r.amount}**<:coin:574116462260912138> has been added to your bank.`)
}).catch(error => ctx.send(`You can get your weeklies in ${error.message}`)) }).catch(error => ctx.send(`You can get your weeklies in ${error.message}`))
} }
} }

View File

@ -3,7 +3,7 @@ module.exports = class Work extends Command {
constructor() { constructor() {
super({ super({
name: 'work', name: 'work',
description: 'Get your Dailies', description: 'Work for your money',
aliases: [], aliases: [],
module: 'Economy', module: 'Economy',
cooldown: 15, cooldown: 15,
@ -19,4 +19,4 @@ module.exports = class Work extends Command {
ctx.send(r.text) ctx.send(r.text)
}).catch(error => ctx.send(`Error ${error.message}`)) }).catch(error => ctx.send(`Error ${error.message}`))
} }
} }

View File

@ -1,6 +1,8 @@
const Command = require('../../src/structures/Command'); const Command = require('../../src/structures/Command');
const { MessageEmbed, version: DiscordVersion } = require('discord.js'); const {
const { developers, contributors, source, color } = require('../../config'); MessageEmbed,
version: DiscordVersion
} = require('discord.js');
const db = require('quick.db'); const db = require('quick.db');
const Backend = new db.table('backend'); const Backend = new db.table('backend');
module.exports = class Info extends Command { module.exports = class Info extends Command {
@ -8,7 +10,7 @@ module.exports = class Info extends Command {
super({ super({
name: 'info', name: 'info',
description: 'Show the Makers and Contributors of the Bot', description: 'Show the Makers and Contributors of the Bot',
aliases: [ 'about' ], aliases: ['about'],
module: 'General', module: 'General',
cooldown: 0, cooldown: 0,
guildOnly: false, guildOnly: false,
@ -18,8 +20,18 @@ module.exports = class Info extends Command {
async command(ctx) { async command(ctx) {
let result; let result;
const {
developers,
contributors,
source,
color
} = ctx.vars
const contribs = []; const contribs = [];
for (const { id, nick, reason } of contributors) { for (const {
id,
nick,
reason
} of contributors) {
const user = await ctx.client.users.fetch(id); const user = await ctx.client.users.fetch(id);
contribs.push(`${user} (${nick}) - ${reason}`); contribs.push(`${user} (${nick}) - ${reason}`);
} }
@ -50,4 +62,4 @@ module.exports = class Info extends Command {
ctx.send(CreditEmbed); ctx.send(CreditEmbed);
} }
}; };

View File

@ -1,10 +1,15 @@
const Command = require('../../src/structures/Command'); const Command = require('../../src/structures/Command');
function Toggle(bool, ctx) {
return bool ? `${ctx.utils.emotes.settings.on}*_ _*` : `${ctx.utils.emotes.settings.off}*_ _*`
}
module.exports = class Settings extends Command { module.exports = class Settings extends Command {
constructor() { constructor() {
super({ super({
name: 'settings', name: 'settings',
description: 'Show the Settings of this Server', description: 'Show the Settings of this Server',
aliases: [ 'config' ], aliases: ['config'],
module: 'Settings', module: 'Settings',
cooldown: 5, cooldown: 5,
guildOnly: true, guildOnly: true,
@ -12,6 +17,7 @@ module.exports = class Settings extends Command {
}); });
} }
async command(ctx) { async command(ctx) {
const SettingsEmbed = new ctx.utils.discord.MessageEmbed(); const SettingsEmbed = new ctx.utils.discord.MessageEmbed();
SettingsEmbed.setColor(ctx.config.color); SettingsEmbed.setColor(ctx.config.color);
@ -22,24 +28,19 @@ module.exports = class Settings extends Command {
.addField('Prefixes', Server.prefix.join(', ') || `<@${ctx.client.user.id}> or \`'\``, false) .addField('Prefixes', Server.prefix.join(', ') || `<@${ctx.client.user.id}> or \`'\``, false)
.addField( .addField(
'SourceFynnder', 'SourceFynnder',
Server.SourceFynnder ? ctx.utils.emotes.settings.on : ctx.utils.emotes.settings.off, Toggle(Server.SourceFynnder, ctx), true
true
) )
.addField( .addField(
'Shortlinks', 'Shortlinks',
Server.Shortlinks ? ctx.utils.emotes.settings.on : ctx.utils.emotes.settings.off, Toggle(Server.Shortlinks, ctx), true)
true
)
.addBlankField(true) .addBlankField(true)
.addField( .addField(
'Image Embeds', 'Image Embeds',
Server.embeds ? ctx.utils.emotes.settings.on : ctx.utils.emotes.settings.off, Toggle(Server.embeds, ctx), true
true
) )
.addField( .addField(
'Image Text', 'Image Text',
Server.rp_text ? ctx.utils.emotes.settings.on : ctx.utils.emotes.settings.off, Toggle(Server.rp_text, ctx), true
true
); );
// .addField('Default Yiff', Server.default_yiff, true); // .addField('Default Yiff', Server.default_yiff, true);
ctx.send(SettingsEmbed); ctx.send(SettingsEmbed);
@ -51,4 +52,4 @@ module.exports = class Settings extends Command {
ctx.send(SettingsEmbed); ctx.send(SettingsEmbed);
} }
} }
}; };

View File

@ -4,6 +4,7 @@ const {
} }
} = require('discord.js'); } = require('discord.js');
module.exports = { module.exports = {
topic: require('./src/TopicSettings'),
format: require('./src/format'), format: require('./src/format'),
status: require('./src/statuses'), status: require('./src/statuses'),
calc: require('./src/calc'), calc: require('./src/calc'),

View File

@ -0,0 +1,25 @@
const TopicSettings = /thaldrin.(no-cmd|no-SL|no-SF)/g;
let PlaceholderTopic = `
Commands for staff members
thaldrin.no-cmd
thaldrin.no-SL`
//if (PlaceholderTopic.match(TopicSettings)) return console.log(PlaceholderTopic.match(TopicSettings))
module.exports = {
includesSetting: function (setting, topic) {
if (!setting || !topic) return;
let TopicSetting = topic.match(TopicSettings)
let Bool;
if (TopicSetting) {
if (TopicSetting.includes(setting)) {
Bool = true
}
} else {
Bool = false
}
return Bool
}
}

View File

@ -1,8 +1,8 @@
const db = require('quick.db'); const db = require("quick.db");
const Servers = new db.table('servers'); const Servers = new db.table("servers");
const Users = new db.table('users'); const Users = new db.table("users");
//const { prefixes } = require('../../config'); //const { prefixes } = require('../../config');
const chalk = require('chalk'); const chalk = require("chalk");
const DatabaseDefaults = { const DatabaseDefaults = {
user: { user: {
@ -19,13 +19,13 @@ const DatabaseDefaults = {
Shortlinks: false, Shortlinks: false,
embeds: true, embeds: true,
rp_text: true, rp_text: true,
default_yiff: 'gay' default_yiff: "gay"
} }
}; };
module.exports = { module.exports = {
defaults: DatabaseDefaults, defaults: DatabaseDefaults,
setupServer: async function(ctx) { setupServer: async function (ctx) {
ctx.utils.log.servers.setup(ctx.guild); ctx.utils.log.servers.setup(ctx.guild);
if (Servers.get(ctx.guild.id) === null) { if (Servers.get(ctx.guild.id) === null) {
await Servers.set(ctx.guild.id, DatabaseDefaults.server); await Servers.set(ctx.guild.id, DatabaseDefaults.server);
@ -34,25 +34,26 @@ module.exports = {
return true; return true;
}, },
prefix: { prefix: {
add: async function(ctx, Prefix) { add: async function (ctx, Prefix) {
let Prefixes = []; let Prefixes = [];
let New; let New;
Prefixes = await Servers.get(ctx.guild.id).prefix; Prefixes = await Servers.get(ctx.guild.id).prefix;
if (Prefixes.includes(Prefix)) throw new Error('Prefix already in Database'); if (Prefixes.includes(Prefix))
throw new Error("Prefix already in Database");
else { else {
New = await Servers.push(`${ctx.guild.id}.prefix`, Prefix); New = await Servers.push(`${ctx.guild.id}.prefix`, Prefix);
} }
return New; return New;
}, },
remove: async function(ctx, Prefix) { remove: async function (ctx, Prefix) {
if (DatabaseDefaults.server.prefix.includes(Prefix)) { if (DatabaseDefaults.server.prefix.includes(Prefix)) {
throw new Error('You cannot remove the Default Prefix(es)'); throw new Error("You cannot remove the Default Prefix(es)");
} }
let Prefixes = ctx.db.servers.get(ctx.guild.id).prefix; let Prefixes = ctx.db.servers.get(ctx.guild.id).prefix;
if (!Prefixes.includes(Prefix)) { if (!Prefixes.includes(Prefix)) {
throw new Error('Prefix does not exist in Database'); throw new Error("Prefix does not exist in Database");
} }
let index = Prefixes.indexOf(Prefix); let index = Prefixes.indexOf(Prefix);
@ -61,77 +62,126 @@ module.exports = {
} }
}, },
toggle: { toggle: {
SourceFynnder: async function(ctx) { SourceFynnder: async function (ctx) {
let Server = await Servers.get(ctx.guild.id); let Server = await Servers.get(ctx.guild.id);
Server.SourceFynnder Server.SourceFynnder ?
? console.log( console.log(
`${chalk.green('✔')} Set ${chalk.blue('SourceFynnder')} in ${chalk.magenta( `${chalk.green("✔")} Set ${chalk.blue(
ctx.guild.id "SourceFynnder"
)} to ${chalk.red('false')} ` )} in ${chalk.magenta(ctx.guild.id)} to ${chalk.red("false")} `
) ) :
: console.log( console.log(
`${chalk.green('✔')} Set ${chalk.blue('SourceFynnder')} in ${chalk.magenta( `${chalk.green("✔")} Set ${chalk.blue(
ctx.guild.id "SourceFynnder"
)} to ${chalk.green('true')} ` )} in ${chalk.magenta(ctx.guild.id)} to ${chalk.green("true")} `
); );
Server.SourceFynnder Server.SourceFynnder ?
? await Servers.set(`${ctx.guild.id}.SourceFynnder`, false) await Servers.set(`${ctx.guild.id}.SourceFynnder`, false) :
: await Servers.set(`${ctx.guild.id}.SourceFynnder`, true); await Servers.set(`${ctx.guild.id}.SourceFynnder`, true);
}, },
Shortlinks: async function(ctx) { Shortlinks: async function (ctx) {
let Server = await Servers.get(ctx.guild.id); let Server = await Servers.get(ctx.guild.id);
Server.Shortlinks Server.Shortlinks ?
? console.log( console.log(
`${chalk.green('✔')} Set ${chalk.blue('Shortlinks')} in ${chalk.magenta( `${chalk.green("✔")} Set ${chalk.blue(
ctx.guild.id "Shortlinks"
)} to ${chalk.red('false')} ` )} in ${chalk.magenta(ctx.guild.id)} to ${chalk.red("false")} `
) ) :
: console.log( console.log(
`${chalk.green('✔')} Set ${chalk.blue('Shortlinks')} in ${chalk.magenta( `${chalk.green("✔")} Set ${chalk.blue(
ctx.guild.id "Shortlinks"
)} to ${chalk.green('true')} ` )} in ${chalk.magenta(ctx.guild.id)} to ${chalk.green("true")} `
); );
Server.Shortlinks Server.Shortlinks ?
? await Servers.set(`${ctx.guild.id}.Shortlinks`, false) await Servers.set(`${ctx.guild.id}.Shortlinks`, false) :
: await Servers.set(`${ctx.guild.id}.Shortlinks`, true); await Servers.set(`${ctx.guild.id}.Shortlinks`, true);
}, },
Embeds: async function(ctx) { Embeds: async function (ctx) {
let Server = await Servers.get(ctx.guild.id); let Server = await Servers.get(ctx.guild.id);
Server.embeds Server.embeds ?
? console.log( console.log(
`${chalk.green('✔')} Set ${chalk.blue('Emdeds')} in ${chalk.magenta(ctx.guild.id)} to ${chalk.red( `${chalk.green("✔")} Set ${chalk.blue("Emdeds")} in ${chalk.magenta(
'false' ctx.guild.id
)} ` )} to ${chalk.red("false")} `
) ) :
: console.log( console.log(
`${chalk.green('✔')} Set ${chalk.blue('Embeds')} in ${chalk.magenta( `${chalk.green("✔")} Set ${chalk.blue("Embeds")} in ${chalk.magenta(
ctx.guild.id ctx.guild.id
)} to ${chalk.green('true')} ` )} to ${chalk.green("true")} `
); );
Server.embeds Server.embeds ?
? await Servers.set(`${ctx.guild.id}.embeds`, false) await Servers.set(`${ctx.guild.id}.embeds`, false) :
: await Servers.set(`${ctx.guild.id}.embeds`, true); await Servers.set(`${ctx.guild.id}.embeds`, true);
}, },
Text: async function(ctx) { Text: async function (ctx) {
let Server = await Servers.get(ctx.guild.id); let Server = await Servers.get(ctx.guild.id);
Server.rp_text Server.rp_text ?
? console.log( console.log(
`${chalk.green('✔')} Set ${chalk.blue('RP Text')} in ${chalk.magenta( `${chalk.green("✔")} Set ${chalk.blue(
ctx.guild.id "RP Text"
)} to ${chalk.red('false')} ` )} in ${chalk.magenta(ctx.guild.id)} to ${chalk.red("false")} `
) ) :
: console.log( console.log(
`${chalk.green('✔')} Set ${chalk.blue('RP Text')} in ${chalk.magenta( `${chalk.green("✔")} Set ${chalk.blue(
ctx.guild.id "RP Text"
)} to ${chalk.green('true')} ` )} in ${chalk.magenta(ctx.guild.id)} to ${chalk.green("true")} `
); );
Server.rp_text Server.rp_text ?
? await Servers.set(`${ctx.guild.id}.rp_text`, false) await Servers.set(`${ctx.guild.id}.rp_text`, false) :
: await Servers.set(`${ctx.guild.id}.rp_text`, true); await Servers.set(`${ctx.guild.id}.rp_text`, true);
}
},
blacklist: async function (user = '318044130796109825', kind, reason) {
switch (kind) {
case "add":
case "a":
let Y = await Users.set(user, {
id: user,
blacklist: {
state: true,
replied: false,
reason: reason
}
});
return Y;
break;
case "remove":
case "r":
let Z = await Users.set(user, {
id: user,
blacklist: {
state: false,
replied: false,
reason: undefined
}
});
return Z;
break;
case "check":
case "status":
case "c":
case "s":
//let X = await Users.get(user);
//console.log(X)
//if (X === null) X = DatabaseDefaults.user
//if(X.blacklist === null)
let W = await Users.get(user)
let X = DatabaseDefaults.user.blacklist
if (W === null) K = X
else if (W.blacklist === undefined || W.blacklist === null) K = X
else K = W.blacklist
//console.log(K)
return K
break;
default:
break;
} }
} }
}; };

View File

@ -15,7 +15,7 @@ module.exports = {
let hasVoted = await Users.get(`${Message.author.id}.voted`); let hasVoted = await Users.get(`${Message.author.id}.voted`);
content = Message.content; content = Message.content;
length = Message.content.length; length = Message.content.length;
if (hasVoted) d = 1; if (hasVoted) d = 1
else d = 0.01; else d = 0.01;
e = (length * d).toFixed(1); e = (length * d).toFixed(1);
return await Users.add(`${Message.author.id}.money.bank`, e); return await Users.add(`${Message.author.id}.money.bank`, e);
@ -79,18 +79,17 @@ module.exports = {
} }
}; };
if (way.hasOwnProperty(kind)) { if (way.hasOwnProperty(kind)) {
console.log(way[kind].probability);
if (way[kind].probability) { if (way[kind].probability) {
Users.add(`${User}.money.cash`, way[kind].payout); Users.add(`${User}.money.cash`, way[kind].payout);
return { return {
money: way[kind].payout, money: way[kind].payout,
text: `You got ${way[kind].payout} from doing ${kind}` text: `You got ${way[kind].payout}<:coin:574116462260912138> from doing ${kind}`
} }
} else { } else {
Users.subtract(`${User}.money.cash`, way[kind].fine); Users.subtract(`${User}.money.cash`, way[kind].fine);
return { return {
money: way[kind].fine, money: way[kind].fine,
text: `You were fined **${way[kind].fine}** by **${kind}**` text: `You were fined **${way[kind].fine}**<:coin:574116462260912138> `
} }
} }

View File

@ -70,10 +70,10 @@ module.exports = async function Shortlink(enabled, msg) {
} }
url = ShortLinks[x].replace('$link$', url); url = ShortLinks[x].replace('$link$', url);
links.push(url); links.push(`<${url}>`);
await backend.add(`Shortlink.${ShortLinkDirs[x]}`, 1); await backend.add(`Shortlink.${ShortLinkDirs[x]}`, 1);
} }
} }
msg.channel.send(links.join('\n')); msg.channel.send(links.join('\n'));
}; };

20
vars.js
View File

@ -1,24 +1,20 @@
module.exports = { module.exports = {
version: '3.0.5', version: '3.6.2',
color: '#ff995d', color: '#ff995d',
name: 'thaldr.in', name: 'thaldr.in',
hostname: '127.2.11.1', hostname: '127.2.11.1',
//hostname: 'localhost', //hostname: 'localhost',
port: '8080', port: '8080',
/* authorization: "g66(TTV&^R^&T*IV56RF$FUTyxsyu534", */
type: { type: {
beta: true, beta: true,
prod: false prod: false
}, },
prefixes: [ "'", `<@511212243015434270> `, '<@!511212243015434270> ' ], prefixes: ["'", `<@511212243015434270> `, '<@!511212243015434270> '],
developers: [ developers: [{
{ id: '318044130796109825',
id: '318044130796109825', nick: 'ry'
nick: 'ry' }],
} contributors: [{
],
contributors: [
{
id: '150745989836308480', id: '150745989836308480',
nick: 'Cyn', nick: 'Cyn',
reason: 'Shortlink Code :3' reason: 'Shortlink Code :3'
@ -41,4 +37,4 @@ module.exports = {
], ],
source: 'https://gitdab.com/r/thaldrin', source: 'https://gitdab.com/r/thaldrin',
invite: 'https://discordapp.com/oauth2/authorize?client_id=434662676547764244&scope=bot&permissions=379968' invite: 'https://discordapp.com/oauth2/authorize?client_id=434662676547764244&scope=bot&permissions=379968'
}; };