mirror of
https://github.com/danbulant/Shasha
synced 2026-06-07 08:32:16 +00:00
remove experiment commands
This commit is contained in:
parent
82dda92d68
commit
5644c02710
7 changed files with 0 additions and 218 deletions
|
|
@ -1,22 +0,0 @@
|
||||||
'use strict';
|
|
||||||
|
|
||||||
const { trySend } = require("../../resources/functions");
|
|
||||||
|
|
||||||
const commando = require("@iceprod/discord.js-commando"),
|
|
||||||
{ database } = require("../../database/mongo"),
|
|
||||||
col = database.collection("Experiment");
|
|
||||||
|
|
||||||
module.exports = class dropexp extends commando.Command {
|
|
||||||
constructor(client) {
|
|
||||||
super(client, {
|
|
||||||
name: "dropexp",
|
|
||||||
memberName: "dropexp",
|
|
||||||
group: "experiment",
|
|
||||||
description: "description",
|
|
||||||
ownerOnly:true
|
|
||||||
});
|
|
||||||
}
|
|
||||||
run(msg, arg) {
|
|
||||||
col.drop().then(trySend(this.client, msg, "cleared")).catch(e => trySend(this.client, msg, `\`\`\`js\n${e.stack}\`\`\``));
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
@ -1,35 +0,0 @@
|
||||||
'use strict';
|
|
||||||
|
|
||||||
const commando = require("@iceprod/discord.js-commando");
|
|
||||||
const { errLog, trySend, ranLog } = require("../../resources/functions");
|
|
||||||
const { database } = require("../../database/mongo");
|
|
||||||
const exp = database.collection("Experiment");
|
|
||||||
|
|
||||||
module.exports = class mydatabase extends commando.Command {
|
|
||||||
constructor(client) {
|
|
||||||
super(client, {
|
|
||||||
name: "mydatabase",
|
|
||||||
memberName: "mydatabase",
|
|
||||||
group: "experiment",
|
|
||||||
description: "Show all document collection.",
|
|
||||||
ownerOnly:true
|
|
||||||
});
|
|
||||||
}
|
|
||||||
async run(msg) {
|
|
||||||
if (!msg.guild?.member(msg.author).hasPermission("MANAGE_GUILD")) {
|
|
||||||
return trySend(this.client, msg, "No");
|
|
||||||
}
|
|
||||||
const data = msg.guild ? "Guild" : "User";
|
|
||||||
const doc = msg.guild?.id ?? msg.author.id,
|
|
||||||
dbExp = await exp.find({}).toArray();
|
|
||||||
database.collection(data).find({document: doc}).toArray(async (e, fetched) => {
|
|
||||||
if (e) {
|
|
||||||
return errLog(e, msg, this.client);
|
|
||||||
}
|
|
||||||
let mes = `Fetched documents for ${msg.guild ? `server **${msg.guild.name}**` : `**${msg.author.tag}**`}`;
|
|
||||||
mes = `${mes}\`\`\`js\n${JSON.stringify(fetched, null, 2)}\`\`\`` + `\`\`\`js\n${JSON.stringify(dbExp, null, 2)}\`\`\``;
|
|
||||||
trySend(this.client, msg, {content:mes,split:{maxLength:2000,append:",```",prepend:"```js\n",char:","}});
|
|
||||||
return ranLog(msg, "mydatabase", fetched);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
@ -1,32 +0,0 @@
|
||||||
'use strict';
|
|
||||||
|
|
||||||
const { trySend, cleanMentionID } = require("../../resources/functions");
|
|
||||||
|
|
||||||
const commando = require("@iceprod/discord.js-commando"),
|
|
||||||
{ database } = require("../../database/mongo"),
|
|
||||||
col = database.collection("Experiment");
|
|
||||||
|
|
||||||
module.exports = class regive extends commando.Command {
|
|
||||||
constructor(client) {
|
|
||||||
super(client, {
|
|
||||||
name: "regive",
|
|
||||||
memberName: "regive",
|
|
||||||
group: "experiment",
|
|
||||||
description: "description"
|
|
||||||
});
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {commando.CommandoMessage} msg
|
|
||||||
* @param {*} arg
|
|
||||||
*/
|
|
||||||
async run(msg, arg ) {
|
|
||||||
const args = arg.split(" "),
|
|
||||||
member = msg.guild.member(cleanMentionID(args[0])),
|
|
||||||
doc = await col.findOne({"rolesScreenshot.name":member.id}).catch(e => trySend(this.client, msg, "```js\n" + e.stack + "```")),
|
|
||||||
test = doc.rolesScreenshot.data;
|
|
||||||
await member.roles.add(test.map(r => r)).catch(e => trySend(this.client, msg, "```js\n" + e.stack + "```"));
|
|
||||||
await member.roles.remove("772114626720432128").catch(e => trySend(this.client, msg, "```js\n" + e.stack + "```"))
|
|
||||||
trySend(this.client, msg, "Success!"+"```js\n"+JSON.stringify(test, null, 2)+"```");
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
@ -1,29 +0,0 @@
|
||||||
'use strict';
|
|
||||||
|
|
||||||
const commando = require("@iceprod/discord.js-commando");
|
|
||||||
const { cleanMentionID, trySend } = require("../../resources/functions");
|
|
||||||
|
|
||||||
module.exports = class replace extends commando.Command {
|
|
||||||
constructor(client) {
|
|
||||||
super(client, {
|
|
||||||
name: "replace",
|
|
||||||
memberName: "replace",
|
|
||||||
group: "experiment",
|
|
||||||
description: "replace test"
|
|
||||||
});
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {commando.CommandoMessage} msg
|
|
||||||
* @param {*} arg
|
|
||||||
*/
|
|
||||||
async run(msg, arg) {
|
|
||||||
const args = arg.split(" "),
|
|
||||||
targetID = cleanMentionID(args[0]),
|
|
||||||
targetUser = msg.guild.member(targetID);
|
|
||||||
await targetUser.roles.remove(targetUser.roles.cache.array()).catch(e => trySend(this.client, msg, "```js\n" + e.stack + "```"));
|
|
||||||
await targetUser.roles.add("772114626720432128").catch(e => trySend(this.client, msg, "```js\n" + e.stack + "```"));
|
|
||||||
//trySend(this.client, msg, "```js\n"+JSON.stringify(mes, null, 2)+"```");
|
|
||||||
trySend(this.client, msg, "Replaced!");
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
@ -1,40 +0,0 @@
|
||||||
'use strict';
|
|
||||||
|
|
||||||
const commando = require("@iceprod/discord.js-commando");
|
|
||||||
const { ranLog, trySend, errLog } = require("../../resources/functions");
|
|
||||||
const { database } = require("../../database/mongo");
|
|
||||||
|
|
||||||
module.exports = class resetdatabase extends commando.Command {
|
|
||||||
constructor(client) {
|
|
||||||
super(client, {
|
|
||||||
name: "resetdatabase",
|
|
||||||
memberName: "resetdatabase",
|
|
||||||
group: "experiment",
|
|
||||||
description: "Reset your server/private database.",
|
|
||||||
ownerOnly:true
|
|
||||||
});
|
|
||||||
}
|
|
||||||
async run(msg) {
|
|
||||||
if (!msg.guild?.member(msg.author).hasPermission("MANAGE_GUILD")) {
|
|
||||||
return trySend(this.client, msg, "No");
|
|
||||||
}
|
|
||||||
const doc = msg.guild?.id ?? msg.author.id;
|
|
||||||
const col = database.collection(msg.guild ? "Guild" : "User");
|
|
||||||
trySend(this.client, msg, "Are you sure? You will lose every saved settings. This process can't be undone. Type `yes` in 30 seconds to confirm.");
|
|
||||||
const confirm = msg.channel.createMessageCollector(() => true, {time:30000});
|
|
||||||
confirm.on("collect", h => {
|
|
||||||
if (h.author === msg.author) {
|
|
||||||
if (h.content.trim() === "yes") {
|
|
||||||
col.findOneAndDelete({document: doc})
|
|
||||||
.then(
|
|
||||||
trySend(this.client, msg, "Wiped!"))
|
|
||||||
.catch(e => errLog(e, msg, this.client));
|
|
||||||
} else {
|
|
||||||
trySend(this.client, msg, "Request aborted.");
|
|
||||||
}
|
|
||||||
confirm.stop();
|
|
||||||
return ranLog(msg, "resetdatabase", h.content);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
@ -1,28 +0,0 @@
|
||||||
'use strict';
|
|
||||||
|
|
||||||
const commando = require("@iceprod/discord.js-commando"),
|
|
||||||
{ database } = require("../../database/mongo");
|
|
||||||
const { trySend } = require("../../resources/functions"),
|
|
||||||
col = database.collection("Guild");
|
|
||||||
|
|
||||||
module.exports = class resetinfractions extends commando.Command {
|
|
||||||
constructor(client) {
|
|
||||||
super(client, {
|
|
||||||
name: "resetinfractions",
|
|
||||||
memberName: "resetinfractions",
|
|
||||||
group: "experiment",
|
|
||||||
description: "description",
|
|
||||||
guildOnly:true,
|
|
||||||
ownerOnly:true
|
|
||||||
});
|
|
||||||
}
|
|
||||||
run(msg) {
|
|
||||||
col.updateOne({document:msg.guild.id}, {$set:{"moderation.infractions":[]}}, {upsert:true}, (e, r) => {
|
|
||||||
if (e) {
|
|
||||||
return trySend(this.client, msg, "```js\n"+e.stack+"```");
|
|
||||||
}
|
|
||||||
col.updateOne({document:msg.guild.id}, {$set:{"moderation.settings.mute": {}}});
|
|
||||||
return trySend(this.client, msg, "Wiped!");
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
@ -1,32 +0,0 @@
|
||||||
'use strict';
|
|
||||||
|
|
||||||
const { cleanMentionID, trySend } = require("../../resources/functions");
|
|
||||||
|
|
||||||
const commando = require("@iceprod/discord.js-commando"),
|
|
||||||
{ database } = require("../../database/mongo"),
|
|
||||||
dbExp = database.collection("Experiment");
|
|
||||||
|
|
||||||
module.exports = class screenshot extends commando.Command {
|
|
||||||
constructor(client) {
|
|
||||||
super(client, {
|
|
||||||
name: "screenshot",
|
|
||||||
memberName: "screenshot",
|
|
||||||
group: "experiment",
|
|
||||||
description: "description"
|
|
||||||
});
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {commando.CommandoMessage} msg
|
|
||||||
* @param {*} arg
|
|
||||||
*/
|
|
||||||
async run(msg, arg) {
|
|
||||||
const args = arg.split(" "),
|
|
||||||
targetID = cleanMentionID(args[0]),
|
|
||||||
targetUser = msg.guild.member(targetID),
|
|
||||||
test = targetUser.roles.cache.map(r => r.id);
|
|
||||||
//trySend(this.client,msg,{content:`\`\`\`js\n${test}\`\`\``,split:true})
|
|
||||||
await dbExp.insertOne({ rolesScreenshot: { name: targetUser.id, data: test }}).catch(e => trySend(this.client, msg, "```js\n" + e.stack + "```"));
|
|
||||||
trySend(this.client, msg, "Sceenshoted!")
|
|
||||||
}
|
|
||||||
};
|
|
||||||
Loading…
Reference in a new issue