updated all requires to use import instead
This commit is contained in:
parent
ba443111c8
commit
7d5d32fec1
25 changed files with 109 additions and 98 deletions
|
@ -1,5 +1,4 @@
|
|||
const fs = require("fs");
|
||||
|
||||
import fs from "fs";
|
||||
const prefix = process.env.PREFIX;
|
||||
|
||||
function delay(time) {
|
||||
|
@ -10,11 +9,11 @@ function delay(time) {
|
|||
|
||||
const whitelist = ["440163494529073152", "611625001950380032"];
|
||||
|
||||
module.exports = {
|
||||
export default {
|
||||
name: "addguildmember",
|
||||
description:
|
||||
"manually adds a guild member to the members list, whitelist required",
|
||||
arguments: "none",
|
||||
arguments: "member",
|
||||
execute(message, args) {
|
||||
if (whitelist.includes(message.author.id)) {
|
||||
if (message.author.bot) return;
|
||||
|
|
|
@ -1,27 +1,30 @@
|
|||
const { EmbedBuilder } = require("discord.js");
|
||||
const fs = require("fs");
|
||||
module.exports = {
|
||||
import { EmbedBuilder } from "discord.js";
|
||||
import fs from "fs";
|
||||
|
||||
export default {
|
||||
name: "commands",
|
||||
description: "displays commands list",
|
||||
arguments: "none",
|
||||
execute(message, args) {
|
||||
let text = "";
|
||||
(async () => {
|
||||
let text = "";
|
||||
|
||||
const commandFiles = fs
|
||||
.readdirSync("src/commands/")
|
||||
.filter((file) => file.endsWith(".js"));
|
||||
for (const file of commandFiles) {
|
||||
const command = require(`./${file}`);
|
||||
text += `p/${command.name} - ${command.description} - command arguments: ${command.arguments}\n \n`;
|
||||
}
|
||||
const commandFiles = fs
|
||||
.readdirSync("src/commands/")
|
||||
.filter((file) => file.endsWith(".js"));
|
||||
|
||||
const embed = new EmbedBuilder();
|
||||
embed.setTitle("PepperBot Commands");
|
||||
embed.setDescription(text);
|
||||
embed.setColor(0xff0000);
|
||||
embed.setThumbnail(
|
||||
"https://cdn.discordapp.com/attachments/755150633191080073/1149152214850469908/Map_Icon.png"
|
||||
);
|
||||
message.reply({ embeds: [embed] });
|
||||
for (const file of commandFiles) {
|
||||
const command = await import(`./${file}`);
|
||||
text += `p/${command.default.name} - ${command.default.description} - command arguments: ${command.default.arguments}\n \n`;
|
||||
}
|
||||
const embed = new EmbedBuilder();
|
||||
embed.setTitle("PepperBot Commands");
|
||||
embed.setDescription(text);
|
||||
embed.setColor(0xff0000);
|
||||
embed.setThumbnail(
|
||||
"https://cdn.discordapp.com/attachments/755150633191080073/1149152214850469908/Map_Icon.png"
|
||||
);
|
||||
message.reply({ embeds: [embed] });
|
||||
})();
|
||||
},
|
||||
};
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
const whitelist = ["440163494529073152"];
|
||||
const fs = require("fs");
|
||||
import fs from "fs";
|
||||
|
||||
module.exports = {
|
||||
export default {
|
||||
name: "crash",
|
||||
description: "crashes the bot (throws an error), requires whitelist",
|
||||
arguments: "none",
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
const { EmbedBuilder } = require("discord.js");
|
||||
const emojiRegex = require("emoji-regex");
|
||||
const irregularsRegex = require("../util/irregularsRegex.js");
|
||||
const irregulars = require("../util/irregulars.json");
|
||||
const fs = require("fs");
|
||||
const log = require("../util/log.js").execute;
|
||||
import discord from "discord.js";
|
||||
//const emojiRegex = require("emoji-regex");
|
||||
//const irregularsRegex = require("../util/irregularsRegex.js");
|
||||
//const irregulars = require("../util/irregulars.json");
|
||||
import fs from "fs";
|
||||
import { default as log } from "../util/log.js";
|
||||
|
||||
const getEmojis = (message) => {
|
||||
/*const getEmojis = (message) => {
|
||||
const { content } = message;
|
||||
const result = [];
|
||||
// Normal emojis
|
||||
|
@ -51,13 +51,13 @@ const getEmojis = (message) => {
|
|||
});
|
||||
}
|
||||
return result;
|
||||
};
|
||||
};*/
|
||||
|
||||
let collectors = [];
|
||||
|
||||
const whitelist = ["440163494529073152", "436321340304392222"];
|
||||
|
||||
module.exports = {
|
||||
export default {
|
||||
name: "createreactionrole",
|
||||
description: "creates reaction role, requires whitelist",
|
||||
arguments: "emoji, user",
|
||||
|
@ -75,7 +75,7 @@ module.exports = {
|
|||
return;
|
||||
}
|
||||
|
||||
const embed = new EmbedBuilder();
|
||||
const embed = new discord.EmbedBuilder();
|
||||
|
||||
embed.setThumbnail(
|
||||
"https://cdn.discordapp.com/attachments/755150633191080073/1149152214850469908/Map_Icon.png"
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
const log = require("../util/log.js").execute;
|
||||
import { default as log } from "../util/log.js";
|
||||
import * as dotenv from "dotenv";
|
||||
dotenv.config();
|
||||
|
||||
const prefix = process.env.PREFIX;
|
||||
|
||||
|
@ -8,7 +10,7 @@ function delay(time) {
|
|||
});
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
export default {
|
||||
name: "dmuser",
|
||||
description: "forces bot to dm a user something (this will ghost ping them)",
|
||||
arguments: "user, message",
|
||||
|
@ -38,7 +40,7 @@ module.exports = {
|
|||
log(
|
||||
"forcesay.log",
|
||||
message,
|
||||
__filename,
|
||||
import.meta.url,
|
||||
`${message.author.username} (${message.author}) attempted to force bot to dm ${user} "${msg}"`
|
||||
);
|
||||
ableToSend = false;
|
||||
|
@ -50,7 +52,7 @@ module.exports = {
|
|||
log(
|
||||
"forcesay.log",
|
||||
message,
|
||||
__filename,
|
||||
import.meta.url,
|
||||
`${message.author.username} (${message.author}) forced bot to dm ${user.username} (${user}) "${msg}"`
|
||||
);
|
||||
}
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
const fs = require("fs");
|
||||
require("dotenv").config();
|
||||
import fs from "fs";
|
||||
import * as dotenv from "dotenv";
|
||||
dotenv.config();
|
||||
|
||||
const prefix = process.env.PREFIX;
|
||||
|
||||
module.exports = {
|
||||
export default {
|
||||
name: "eulogy",
|
||||
description: "generates a eulogy",
|
||||
arguments: "name",
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module.exports = {
|
||||
export default {
|
||||
name: "guildmembers",
|
||||
description:
|
||||
"sends a file including all past guild members (may not be accurrate, is mostly manually updated) -- note: also includes allies",
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
const { EmbedBuilder } = require("discord.js");
|
||||
module.exports = {
|
||||
import { EmbedBuilder } from "discord.js";
|
||||
export default {
|
||||
name: "links",
|
||||
description: 'posts "important" links',
|
||||
arguments: "none",
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module.exports = {
|
||||
export default {
|
||||
name: "mymovie",
|
||||
description: "posts my movie",
|
||||
arguments: "none",
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module.exports = {
|
||||
export default {
|
||||
name: "openpepper",
|
||||
description: "posts open pepper repo",
|
||||
arguments: "none",
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
const { EmbedBuilder } = require("discord.js");
|
||||
const fs = require("fs");
|
||||
import { EmbedBuilder } from "discord.js";
|
||||
import fs from "fs";
|
||||
|
||||
module.exports = {
|
||||
export default {
|
||||
name: "pepper",
|
||||
description: "RPG (random pepper generator)",
|
||||
arguments: "none",
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
const log = require("../util/log.js").execute;
|
||||
import { default as log } from "../util/log.js";
|
||||
|
||||
const prefix = process.env.PREFIX;
|
||||
|
||||
|
@ -8,7 +8,7 @@ function delay(time) {
|
|||
});
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
export default {
|
||||
name: "say",
|
||||
description: "forces bot to say something",
|
||||
arguments: "message",
|
||||
|
@ -25,7 +25,7 @@ module.exports = {
|
|||
log(
|
||||
"forcesay.log",
|
||||
message,
|
||||
__filename,
|
||||
import.meta.url,
|
||||
`${message.author.username} (${message.author}) forced bot to say "${msg}"`
|
||||
);
|
||||
}
|
||||
|
|
|
@ -1,10 +1,7 @@
|
|||
const { Options } = require("discord.js");
|
||||
const { Collection } = require("discord.js");
|
||||
const prefix = process.env.PREFIX;
|
||||
const ignore = ["console.log"];
|
||||
const fs = require("fs");
|
||||
import fs from "fs";
|
||||
|
||||
module.exports = {
|
||||
export default {
|
||||
name: "sendlog",
|
||||
description: "sends log file (if the file is valid)",
|
||||
arguments: "m, mobile",
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
const log = require("../util/log.js").execute;
|
||||
|
||||
module.exports = {
|
||||
export default {
|
||||
name: "test",
|
||||
description: "test command",
|
||||
arguments: "all",
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
const { EmbedBuilder } = require("discord.js");
|
||||
const fs = require("fs");
|
||||
import { EmbedBuilder } from "discord.js";
|
||||
import fs from "fs";
|
||||
const prefix = process.env.PREFIX;
|
||||
|
||||
module.exports = {
|
||||
export default {
|
||||
name: "vileimagery",
|
||||
description: "Do NOT run.",
|
||||
arguments: "file name",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue