added command argument usage for sendlog (mobile support)

This commit is contained in:
ayeuhugyu 2023-09-24 10:53:21 -07:00
parent b52b23d495
commit ba443111c8
17 changed files with 53 additions and 21 deletions

View file

@ -18,6 +18,7 @@ clean up p/vileimagery, its horrendous
**_Note:_** _versions before this were not uploaded to the repo, this is not the first version._
1.9 - added p/eulogy and the capability for command arguments
1.9.1 - added command argument usage for sendlog (mobile support)
---

View file

@ -14,6 +14,7 @@ module.exports = {
name: "addguildmember",
description:
"manually adds a guild member to the members list, whitelist required",
arguments: "none",
execute(message, args) {
if (whitelist.includes(message.author.id)) {
if (message.author.bot) return;

View file

@ -2,7 +2,8 @@ const { EmbedBuilder } = require("discord.js");
const fs = require("fs");
module.exports = {
name: "commands",
description: "commands list",
description: "displays commands list",
arguments: "none",
execute(message, args) {
let text = "";
@ -11,7 +12,7 @@ module.exports = {
.filter((file) => file.endsWith(".js"));
for (const file of commandFiles) {
const command = require(`./${file}`);
text += `p/${command.name} - ${command.description}\n`;
text += `p/${command.name} - ${command.description} - command arguments: ${command.arguments}\n \n`;
}
const embed = new EmbedBuilder();

View file

@ -4,6 +4,7 @@ const fs = require("fs");
module.exports = {
name: "crash",
description: "crashes the bot (throws an error), requires whitelist",
arguments: "none",
execute(message, args) {
if (whitelist.includes(message.author.id)) {
message.reply("crashing bot...");

View file

@ -60,6 +60,7 @@ const whitelist = ["440163494529073152", "436321340304392222"];
module.exports = {
name: "createreactionrole",
description: "creates reaction role, requires whitelist",
arguments: "emoji, user",
execute(message, args) {
if (whitelist.includes(message.author.id)) {
let emojis = getEmojis(message);

View file

@ -11,6 +11,7 @@ function delay(time) {
module.exports = {
name: "dmuser",
description: "forces bot to dm a user something (this will ghost ping them)",
arguments: "user, message",
execute(message, args) {
const user = message.mentions.users.first();
const guild = message.guild;

View file

@ -6,6 +6,7 @@ const prefix = process.env.PREFIX;
module.exports = {
name: "eulogy",
description: "generates a eulogy",
arguments: "name",
execute(message, args) {
const msgnoprefix = message.content.slice(prefix.length + this.name.length);
const name = msgnoprefix.slice(0, 2000);

View file

@ -2,6 +2,7 @@ module.exports = {
name: "guildmembers",
description:
"sends a file including all past guild members (may not be accurrate, is mostly manually updated) -- note: also includes allies",
arguments: "none",
execute(message, args) {
const path = `../pepperbot/data/guildmembers.log`;
message.channel.send({

View file

@ -2,6 +2,7 @@ const { EmbedBuilder } = require("discord.js");
module.exports = {
name: "links",
description: 'posts "important" links',
arguments: "none",
execute(message, args) {
const embed = new EmbedBuilder();
embed.setTitle("very imphortance linkers");

View file

@ -1,7 +1,10 @@
module.exports = {
name: 'mymovie',
description: 'posts my movie',
execute(message, args){
message.reply('https://cdn.discordapp.com/attachments/755150633191080073/1149158052784775219/My_Movie.mp4')
}
}
name: "mymovie",
description: "posts my movie",
arguments: "none",
execute(message, args) {
message.reply(
"https://cdn.discordapp.com/attachments/755150633191080073/1149158052784775219/My_Movie.mp4"
);
},
};

View file

@ -1,6 +1,7 @@
module.exports = {
name: "openpepper",
description: "posts open pepper repo",
arguments: "none",
execute(message, args) {
message.reply("https://git.reidlab.online/ayeuhugyu/OpenPepper");
},

View file

@ -4,6 +4,7 @@ const fs = require("fs");
module.exports = {
name: "pepper",
description: "RPG (random pepper generator)",
arguments: "none",
execute(message, args) {
const peppers = fs.readdirSync("../pepperbot/resources/peppers");
const maxRan = peppers.length;

View file

@ -11,6 +11,7 @@ function delay(time) {
module.exports = {
name: "say",
description: "forces bot to say something",
arguments: "message",
execute(message, args) {
if (message.author.bot) return;
const msgnoprefix = message.content.slice(prefix.length + this.name.length);

View file

@ -1,15 +1,22 @@
const { Options } = require("discord.js");
const { Collection } = require("discord.js");
const prefix = process.env.PREFIX;
const ignore = [];
const ignore = ["console.log"];
const fs = require("fs");
module.exports = {
name: "sendlog",
description: "sends log file (if the file is valid)",
arguments: "m, mobile",
execute(message, args) {
let msgnoprefix = message.content.slice(
prefix.length + this.name.length + 1
);
let mobileMode = false;
if (args.includes("m") || args.includes("mobile")) {
mobileMode = true;
}
//let msgnoprefix = message.content.slice(
//prefix.length + this.name.length + 1,
//);
let msgnoprefix = args[0];
if (!msgnoprefix.endsWith(".log")) {
msgnoprefix += ".log";
}
@ -23,6 +30,7 @@ module.exports = {
}
if (ignore.includes(msgnoprefix)) return;
const path = `../pepperbot/logs/${msgnoprefix}`;
if (!mobileMode) {
message.channel.send({
files: [
{
@ -31,5 +39,12 @@ module.exports = {
},
],
});
} else {
const filestring = fs.readFileSync(path, "utf8");
console.log(typeof filestring);
message.channel.send(
filestring.slice(filestring.length - 500, filestring.length)
);
}
},
};

View file

@ -3,6 +3,7 @@ const log = require("../util/log.js").execute;
module.exports = {
name: "test",
description: "test command",
arguments: "all",
execute(message, args) {
let text =
"command arguments test \nthis list should include all arguments you included in the command \n";

View file

@ -5,6 +5,7 @@ const prefix = process.env.PREFIX;
module.exports = {
name: "vileimagery",
description: "Do NOT run.",
arguments: "file name",
execute(message, args) {
let proposedfilename = message.content.slice(
prefix.length + this.name.length + 1

View file

@ -60,7 +60,7 @@ module.exports.execute = function (message, client) {
"commands.log",
message,
__filename,
`use of command: ${command} by: ${message.author.username} (${message.author})"`,
`use of command: ${command} by: ${message.author.username} (\`${message.author}\`)"`,
true
);
commands.get(command).execute(message, args, client);