guess who forgot to add files

pull/5/head
pineafan 4 years ago
parent dd1155eb3d
commit 4f164f3adb
No known key found for this signature in database
GPG Key ID: 0BC8D3DCC20E96FE

@ -0,0 +1,27 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"command": "npm run dev",
"name": "Run npm start",
"request": "launch",
"type": "node-terminal"
},
{
"type": "pwa-node",
"request": "launch",
"name": "Launch Program",
"skipFiles": [
"<node_internals>/**"
],
"program": "${workspaceFolder}/dist/index.js",
"preLaunchTask": "tsc: build - tsconfig.json",
"outFiles": [
"${workspaceFolder}/dist/**/*.js"
]
}
]
}

@ -0,0 +1,19 @@
import { CommandInteraction } from "discord.js";
import { SlashCommandBuilder } from "@discordjs/builders";
import { WrappedCheck } from "jshaiku";
const command = new SlashCommandBuilder()
.setName("help")
.setDescription("Shows help for commands")
const callback = (interaction: CommandInteraction) => {
interaction.reply("hel p");
}
const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
return true;
}
export { command };
export { callback };
export { check };

@ -0,0 +1,4 @@
const name = "mod";
const description = "Perform moderator actions";
export { name, description };

@ -0,0 +1,98 @@
import Discord, { CommandInteraction, GuildMember } from "discord.js";
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
import { WrappedCheck } from "jshaiku";
import getEmojiByName from "../../utils/getEmojiByName.js";
import confirmationMessage from "../../utils/confirmationMessage.js";
import EmojiEmbed from "../../utils/generateEmojiEmbed.js";
import keyValueList from "../../utils/generateKeyValueList.js";
const command = (builder: SlashCommandSubcommandBuilder) =>
builder
.setName("ban")
.setDescription("Bans a user from the server")
.addUserOption(option => option.setName("user").setDescription("The user to ban").setRequired(true))
.addStringOption(option => option.setName("reason").setDescription("The reason for the ban").setRequired(false))
.addStringOption(option => option.setName("notify").setDescription("If the user should get a message when they are banned | Default yes").setRequired(false)
.addChoices([["Yes", "yes"], ["No", "no"]])
)
.addIntegerOption(option => option.setName("delete").setDescription("The days of messages to delete | Default 0").setMinValue(0).setMaxValue(7).setRequired(false))
const callback = async (interaction: CommandInteraction) => {
// TODO:[Modals] Replace this with a modal
if (await new confirmationMessage(interaction)
.setEmoji("PUNISH.BAN")
.setTitle("Ban")
.setDescription(keyValueList({
"user": `<@!${(interaction.options.getMember("user") as GuildMember).id}> (${(interaction.options.getMember("user") as GuildMember).user.username})`,
"reason": `\n> ${interaction.options.getString("reason") ? interaction.options.getString("reason") : "*No reason provided*"}`
})
+ `The user **will${interaction.options.getString("notify") === "no" ? ' not' : ''}** be notified\n`
+ `${interaction.options.getInteger("delete") ? interaction.options.getInteger("delete") : 0} day${interaction.options.getInteger("delete") === 1 || interaction.options.getInteger("delete") === null ? "s" : ""} of messages will be deleted\n\n` // TODO:[s addition]
+ `Are you sure you want to ban <@!${(interaction.options.getMember("user") as GuildMember).id}>?`)
.setColor("Danger")
// pluralize("day", interaction.options.getInteger("delete"))
// const pluralize = (word: string, count: number) => { return count === 1 ? word : word + "s" }
.send()) {
let dmd = false
try {
if (interaction.options.getString("notify") != "no") {
await (interaction.options.getMember("user") as GuildMember).send({
embeds: [new EmojiEmbed()
.setEmoji("MEMBER.BAN")
.setTitle("Banned")
.setDescription(`You have been banned in ${interaction.guild.name}` +
(interaction.options.getString("reason") ? ` for:\n> ${interaction.options.getString("reason")}` : " with no reason provided."))
.setStatus("Danger")
]
})
dmd = true
}
} catch {}
try {
(interaction.options.getMember("user") as GuildMember).ban({
days: Number(interaction.options.getInteger("delete") ?? 0),
reason: interaction.options.getString("reason")
})
let failed = (dmd == false && interaction.options.getString("notify") != "no")
await interaction.editReply({embeds: [new EmojiEmbed()
.setEmoji(`PUNISH.${failed ? "SOFT" : ""}BAN`) // TODO: Add green ban icon for success
.setTitle(`Ban`)
.setDescription("The member was banned" + (failed ? ", but the user could not be messaged" : ""))
.setStatus(failed ? "Warning" : "Success")
], components: []})
} catch {
await interaction.editReply({embeds: [new EmojiEmbed()
.setEmoji("MEMBER.BAN")
.setTitle(`Ban`)
.setDescription("Something went wrong and the user was not banned")
.setStatus("Danger")
], components: []})
}
} else {
await interaction.editReply({embeds: [new EmojiEmbed()
.setEmoji("MEMBER.UNBAN")
.setTitle(`Ban`)
.setDescription("No changes were made")
.setStatus("Success")
], components: []})
}
}
const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
// Check if Nucleus can ban the member
if (! (interaction.guild.me.roles.highest.position > (interaction.member as GuildMember).roles.highest.position)) throw "I do not have a role higher than that member"
// Check if Nucleus has permission to ban
if (! interaction.guild.me.permissions.has("BAN_MEMBERS")) throw "I do not have the `ban_members` permission";
// Do not allow banning Nucleus
if ((interaction.member as GuildMember).id == interaction.guild.me.id) throw "I cannot ban myself"
// Allow the owner to ban anyone
if ((interaction.member as GuildMember).id == interaction.guild.ownerId) return true
// Check if the user has ban_members permission
if (! (interaction.member as GuildMember).permissions.has("BAN_MEMBERS")) throw "You do not have the `ban_members` permission";
// Check if the user is below on the role list
if (! ((interaction.member as GuildMember).roles.highest.position > (interaction.options.getMember("user") as GuildMember).roles.highest.position)) throw "You do not have a role higher than that member"
// Allow ban
return true
}
export { command, callback, check };

@ -0,0 +1,20 @@
import { CommandInteraction } from "discord.js";
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
import { WrappedCheck } from "jshaiku";
const command = (builder: SlashCommandSubcommandBuilder) =>
builder
.setName("clear")
.setDescription("Clears a users messages in a channel")
const callback = (interaction: CommandInteraction) => {
interaction.reply("Command incomplete [mod/clear]");
}
const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
return true;
}
export { command };
export { callback };
export { check };

@ -0,0 +1,20 @@
import { CommandInteraction } from "discord.js";
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
import { WrappedCheck } from "jshaiku";
const command = (builder: SlashCommandSubcommandBuilder) =>
builder
.setName("kick")
.setDescription("Clears a users messages in a channel")
const callback = (interaction: CommandInteraction) => {
interaction.reply("Command incomplete [mod/kick]");
}
const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
return true;
}
export { command };
export { callback };
export { check };

@ -0,0 +1,20 @@
import { CommandInteraction } from "discord.js";
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
import { WrappedCheck } from "jshaiku";
const command = (builder: SlashCommandSubcommandBuilder) =>
builder
.setName("lock")
.setDescription("Manages a lock on a channel")
const callback = (interaction: CommandInteraction) => {
interaction.reply("Command incomplete [mod/lock]");
}
const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
return true;
}
export { command };
export { callback };
export { check };

@ -0,0 +1,20 @@
import { CommandInteraction } from "discord.js";
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
import { WrappedCheck } from "jshaiku";
const command = (builder: SlashCommandSubcommandBuilder) =>
builder
.setName("purge")
.setDescription("Clears messages in a channel")
const callback = (interaction: CommandInteraction) => {
interaction.reply("Command incomplete [mod/purge]");
}
const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
return true;
}
export { command };
export { callback };
export { check };

@ -0,0 +1,20 @@
import { CommandInteraction } from "discord.js";
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
import { WrappedCheck } from "jshaiku";
const command = (builder: SlashCommandSubcommandBuilder) =>
builder
.setName("slowmode")
.setDescription("Manages slowmode in a channel")
const callback = (interaction: CommandInteraction) => {
interaction.reply("Command incomplete [mod/slowmode]");
}
const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
return true;
}
export { command };
export { callback };
export { check };

@ -0,0 +1,20 @@
import { CommandInteraction } from "discord.js";
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
import { WrappedCheck } from "jshaiku";
const command = (builder: SlashCommandSubcommandBuilder) =>
builder
.setName("softban")
.setDescription("Softbans a user")
const callback = (interaction: CommandInteraction) => {
interaction.reply("Command incomplete [mod/softban]");
}
const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
return true;
}
export { command };
export { callback };
export { check };

@ -0,0 +1,20 @@
import { CommandInteraction } from "discord.js";
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
import { WrappedCheck } from "jshaiku";
const command = (builder: SlashCommandSubcommandBuilder) =>
builder
.setName("unban")
.setDescription("Unbans a user")
const callback = (interaction: CommandInteraction) => {
interaction.reply("Command incomplete [mod/unban]");
}
const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
return true;
}
export { command };
export { callback };
export { check };

@ -0,0 +1,20 @@
import { CommandInteraction } from "discord.js";
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
import { WrappedCheck } from "jshaiku";
const command = (builder: SlashCommandSubcommandBuilder) =>
builder
.setName("viewas")
.setDescription("View the server as a specific member")
const callback = (interaction: CommandInteraction) => {
interaction.reply("Command incomplete [mod/viewas]");
}
const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
return true;
}
export { command };
export { callback };
export { check };

@ -0,0 +1,20 @@
import { CommandInteraction } from "discord.js";
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
import { WrappedCheck } from "jshaiku";
const command = (builder: SlashCommandSubcommandBuilder) =>
builder
.setName("warn")
.setDescription("Warns a user")
const callback = (interaction: CommandInteraction) => {
interaction.reply("Command incomplete [mod/warn]");
}
const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
return true;
}
export { command };
export { callback };
export { check };

@ -0,0 +1,4 @@
const name = "nucleus";
const description = "Commands relating to Nucleus itself";
export { name, description };

@ -0,0 +1,20 @@
import { CommandInteraction } from "discord.js";
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
import { WrappedCheck } from "jshaiku";
const command = (builder: SlashCommandSubcommandBuilder) =>
builder
.setName("ping")
.setDescription("Gets the bot's ping time")
const callback = (interaction: CommandInteraction) => {
interaction.reply("Command incomplete [nucleus/ping]");
}
const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
return true;
}
export { command };
export { callback };
export { check };

@ -0,0 +1,20 @@
import { CommandInteraction } from "discord.js";
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
import { WrappedCheck } from "jshaiku";
const command = (builder: SlashCommandSubcommandBuilder) =>
builder
.setName("stats")
.setDescription("Gets the bot's statse")
const callback = (interaction: CommandInteraction) => {
interaction.reply("Command incomplete [nucleus/stats]");
}
const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
return true;
}
export { command };
export { callback };
export { check };

@ -0,0 +1,20 @@
import { CommandInteraction } from "discord.js";
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
import { WrappedCheck } from "jshaiku";
const command = (builder: SlashCommandSubcommandBuilder) =>
builder
.setName("suggest")
.setDescription("Sends a suggestion to the developers")
const callback = (interaction: CommandInteraction) => {
interaction.reply("Command incomplete [nucleus/suggest]");
}
const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
return true;
}
export { command };
export { callback };
export { check };

@ -0,0 +1,19 @@
import { CommandInteraction } from "discord.js";
import { SlashCommandBuilder } from "@discordjs/builders";
import { WrappedCheck } from "jshaiku";
const command = new SlashCommandBuilder()
.setName("privacy")
.setDescription("Shows info about Nucleus' privacy options")
const callback = (interaction: CommandInteraction) => {
interaction.reply("Command incomplete [privacy]");
}
const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
return true;
}
export { command };
export { callback };
export { check };

@ -0,0 +1,4 @@
const name = "role";
const description = "Change roles for users";
export { name, description };

@ -0,0 +1,20 @@
import { CommandInteraction } from "discord.js";
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
import { WrappedCheck } from "jshaiku";
const command = (builder: SlashCommandSubcommandBuilder) =>
builder
.setName("all")
.setDescription("Gives or removes a role from everyone")
const callback = (interaction: CommandInteraction) => {
interaction.reply("Command incomplete [role/all]");
}
const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
return true;
}
export { command };
export { callback };
export { check };

@ -0,0 +1,20 @@
import { CommandInteraction } from "discord.js";
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
import { WrappedCheck } from "jshaiku";
const command = (builder: SlashCommandSubcommandBuilder) =>
builder
.setName("user")
.setDescription("Gives or removes a role form someone")
const callback = (interaction: CommandInteraction) => {
interaction.reply("Command incomplete [role/user]");
}
const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
return true;
}
export { command };
export { callback };
export { check };

@ -0,0 +1,4 @@
const name = "settings";
const description = "Change bot settings";
export { name, description };

@ -0,0 +1,20 @@
import { CommandInteraction } from "discord.js";
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
import { WrappedCheck } from "jshaiku";
const command = (builder: SlashCommandSubcommandBuilder) =>
builder
.setName("all")
.setDescription("Shows a full UI of all settings")
const callback = (interaction: CommandInteraction) => {
interaction.reply("Command incomplete [settings/all]");
}
const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
return true;
}
export { command };
export { callback };
export { check };

@ -0,0 +1,20 @@
import { CommandInteraction } from "discord.js";
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
import { WrappedCheck } from "jshaiku";
const command = (builder: SlashCommandSubcommandBuilder) =>
builder
.setName("automation")
.setDescription("Shows all automation options")
const callback = (interaction: CommandInteraction) => {
interaction.reply("Command incomplete [settings/automation]");
}
const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
return true;
}
export { command };
export { callback };
export { check };

@ -0,0 +1,4 @@
const name = "log";
const description = "Settings for logging";
export { name, description };

@ -0,0 +1,20 @@
import { CommandInteraction } from "discord.js";
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
import { WrappedCheck } from "jshaiku";
const command = (builder: SlashCommandSubcommandBuilder) =>
builder
.setName("channel")
.setDescription("Sets the log channel")
const callback = (interaction: CommandInteraction) => {
interaction.reply("Command incomplete [settings/log/channel]");
}
const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
return true;
}
export { command };
export { callback };
export { check };

@ -0,0 +1,20 @@
import { CommandInteraction } from "discord.js";
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
import { WrappedCheck } from "jshaiku";
const command = (builder: SlashCommandSubcommandBuilder) =>
builder
.setName("events")
.setDescription("Sets what events should be logged")
const callback = (interaction: CommandInteraction) => {
interaction.reply("Command incomplete [settings/log/events]");
}
const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
return true;
}
export { command };
export { callback };
export { check };

@ -0,0 +1,20 @@
import { CommandInteraction } from "discord.js";
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
import { WrappedCheck } from "jshaiku";
const command = (builder: SlashCommandSubcommandBuilder) =>
builder
.setName("ignore")
.setDescription("Sets which users, channels and roles should be ignored")
const callback = (interaction: CommandInteraction) => {
interaction.reply("Command incomplete [settings/log/ignore]");
}
const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
return true;
}
export { command };
export { callback };
export { check };

@ -0,0 +1,20 @@
import { CommandInteraction } from "discord.js";
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
import { WrappedCheck } from "jshaiku";
const command = (builder: SlashCommandSubcommandBuilder) =>
builder
.setName("ignored")
.setDescription("Gets the ignored users, channels and roles")
const callback = (interaction: CommandInteraction) => {
interaction.reply("Command incomplete [settings/log/ignored]");
}
const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
return true;
}
export { command };
export { callback };
export { check };

@ -0,0 +1,4 @@
const name = "announcements";
const description = "Settings for mod messages";
export { name, description };

@ -0,0 +1,20 @@
import { CommandInteraction } from "discord.js";
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
import { WrappedCheck } from "jshaiku";
const command = (builder: SlashCommandSubcommandBuilder) =>
builder
.setName("channel")
.setDescription("Sets the channel for staff messages to go to")
const callback = (interaction: CommandInteraction) => {
interaction.reply("Command incomplete [settings/mod/channel]");
}
const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
return true;
}
export { command };
export { callback };
export { check };

@ -0,0 +1,20 @@
import { CommandInteraction } from "discord.js";
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
import { WrappedCheck } from "jshaiku";
const command = (builder: SlashCommandSubcommandBuilder) =>
builder
.setName("events")
.setDescription("Sets which events mods should be notified about")
const callback = (interaction: CommandInteraction) => {
interaction.reply("Command incomplete [settings/mod/events]");
}
const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
return true;
}
export { command };
export { callback };
export { check };

@ -0,0 +1,20 @@
import { CommandInteraction } from "discord.js";
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
import { WrappedCheck } from "jshaiku";
const command = (builder: SlashCommandSubcommandBuilder) =>
builder
.setName("tickets")
.setDescription("Shows settings for tickets")
const callback = (interaction: CommandInteraction) => {
interaction.reply("Command incomplete [settings/tickets]");
}
const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
return true;
}
export { command };
export { callback };
export { check };

@ -0,0 +1,4 @@
const name = "verify";
const description = "Settings for verification";
export { name, description };

@ -0,0 +1,20 @@
import { CommandInteraction } from "discord.js";
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
import { WrappedCheck } from "jshaiku";
const command = (builder: SlashCommandSubcommandBuilder) =>
builder
.setName("channel")
.setDescription("Sets the verify channel")
const callback = (interaction: CommandInteraction) => {
interaction.reply("Command incomplete [settings/verify/channel]");
}
const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
return true;
}
export { command };
export { callback };
export { check };

@ -0,0 +1,20 @@
import { CommandInteraction } from "discord.js";
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
import { WrappedCheck } from "jshaiku";
const command = (builder: SlashCommandSubcommandBuilder) =>
builder
.setName("role")
.setDescription("Sets the role given after verifying")
const callback = (interaction: CommandInteraction) => {
interaction.reply("Command incomplete [settings/verify/role]");
}
const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
return true;
}
export { command };
export { callback };
export { check };

@ -0,0 +1,19 @@
import { CommandInteraction } from "discord.js";
import { SlashCommandBuilder } from "@discordjs/builders";
import { WrappedCheck } from "jshaiku";
const command = new SlashCommandBuilder()
.setName("tag")
.setDescription("Get and manage the servers tags")
const callback = (interaction: CommandInteraction) => {
interaction.reply("Command incomplete [tag]");
}
const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
return true;
}
export { command };
export { callback };
export { check };

@ -0,0 +1,4 @@
const name = "ticket";
const description = "Manage modmail tickets";
export { name, description };

@ -0,0 +1,20 @@
import { CommandInteraction } from "discord.js";
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
import { WrappedCheck } from "jshaiku";
const command = (builder: SlashCommandSubcommandBuilder) =>
builder
.setName("close")
.setDescription("Closes a ticket")
const callback = (interaction: CommandInteraction) => {
interaction.reply("Command incomplete [ticket/close]");
}
const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
return true;
}
export { command };
export { callback };
export { check };

@ -0,0 +1,20 @@
import { CommandInteraction } from "discord.js";
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
import { WrappedCheck } from "jshaiku";
const command = (builder: SlashCommandSubcommandBuilder) =>
builder
.setName("create")
.setDescription("Creates a new modmail ticket")
const callback = (interaction: CommandInteraction) => {
interaction.reply("Command incomplete [ticket/create]");
}
const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
return true;
}
export { command };
export { callback };
export { check };

@ -0,0 +1,20 @@
import { CommandInteraction } from "discord.js";
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
import { WrappedCheck } from "jshaiku";
const command = (builder: SlashCommandSubcommandBuilder) =>
builder
.setName("delete")
.setDescription("Deletes a ticket")
const callback = (interaction: CommandInteraction) => {
interaction.reply("Command incomplete [ticket/delete]");
}
const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
return true;
}
export { command };
export { callback };
export { check };

@ -0,0 +1,4 @@
const name = "user";
const description = "Commands for user info";
export { name, description };

@ -0,0 +1,20 @@
import { CommandInteraction } from "discord.js";
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
import { WrappedCheck } from "jshaiku";
const command = (builder: SlashCommandSubcommandBuilder) =>
builder
.setName("about")
.setDescription("Shows info about a user")
const callback = (interaction: CommandInteraction) => {
interaction.reply("Command incomplete [user/about]");
}
const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
return true;
}
export { command };
export { callback };
export { check };

@ -0,0 +1,20 @@
import { CommandInteraction } from "discord.js";
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
import { WrappedCheck } from "jshaiku";
const command = (builder: SlashCommandSubcommandBuilder) =>
builder
.setName("avatar")
.setDescription("Shows a users avatar")
const callback = (interaction: CommandInteraction) => {
interaction.reply("Command incomplete [user/avatar]");
}
const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
return true;
}
export { command };
export { callback };
export { check };

@ -0,0 +1,19 @@
import { CommandInteraction } from "discord.js";
import { SlashCommandBuilder } from "@discordjs/builders";
import { WrappedCheck } from "jshaiku";
const command = new SlashCommandBuilder()
.setName("verify")
.setDescription("Get verified in the server")
const callback = (interaction: CommandInteraction) => {
interaction.reply("Command incomplete [verify]");
}
const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
return true;
}
export { command };
export { callback };
export { check };

@ -0,0 +1,268 @@
{
"NUCLEUS": {
"INFO":{
"HELP":"751751467014029322",
"ABOUT":"751762088346517504",
"COMMANDS": "751762088229339136",
"SUPPORT":"751762087780286495"
},
"COMMANDS": {
"RAID":"777143043711172608",
"LOCK":"776848800995868682",
"IGNORE":"777520659270074389"
}
},
"ICONS": {
"LOADING": "a777130727925219358",
"ADD": "826823514904330251",
"REMOVE": "826823515268186152",
"OPP": {
"ADD":"837355918831124500",
"REMOVE":"837355918420869162"
},
"CHANNEL": {
"TEXT":"752971441351426089",
"VOICE":"752971441586307091",
"STORE":"853668786925469706",
"ANNOUNCEMENT":"853668786493063169",
"STAGE":"853668786842763294"
}
},
"CONTROL": {
"TICK":"729064531107774534",
"CROSS":"729064530310594601",
"LEFT":"877471438263697459",
"RIGHT":"877471438532132874",
"PILL": {
"TICK":"753314339082993832",
"CROSS":"753314339389309100"
}
},
"STATUS":{
"ONLINE":"729064530084102166",
"IDLE":"729064531577536582",
"DND":"729064531057311886",
"STREAMING":"729764055082074153",
"OFFLINE":"729064531271221289"
},
"CHANNEL": {
"TEXT": {
"CREATE":"729066924943737033",
"DELETE":"729064529211686922"
},
"VOICE": {
"CREATE":"729064530830950530",
"DELETE":"729064530981683200"
},
"STORE": {
"CREATE":"729064530709315715",
"DELETE":"729064530768035922"
},
"CATEGORY": {
"CREATE":"787987508465238026",
"EDIT":"787987508565770300",
"DELETE":"787987508507967488"
},
"PURGE":"729064530797133875",
"TITLEUPDATE":"729763053620691044",
"TOPICUPDATE":"729763053477953536",
"SLOWMODE": {
"ON":"777138171301068831",
"OFF":"777138171447869480"
},
"NSFW": {
"ON":"729064531208175736",
"OFF":"729381430991388752"
}
},
"MEMBER": {
"JOIN":"729066519337762878",
"LEAVE":"729064531170558575",
"BOT": {
"JOIN":"729064528666689587",
"LEAVE":"729064528998039633"
},
"KICK":"729263536785850458",
"BAN":"729263536643112991",
"UNBAN":"729263536840114216",
"NICKNAME":"729064531019694090"
},
"INVITE": {
"CREATE":"729064529274601482",
"DELETE":"729064531103580230"
},
"WEBHOOK": {
"CREATE":"752070251906203679",
"UPDATE":"752073772823216191",
"DELETE":"752070251948146768"
},
"MESSAGE": {
"EDIT":"729065958584614925",
"DELETE":"729064530432360461",
"PIN":"729064530755190894",
"REACTION":{
"ADD":"",
"REMOVE":"",
"CLEAR":"729064531468353606"
},
"PING": {
"MASS":"729620608408879124",
"EVERYONE":"729064531073957909",
"ROLE":"729263536915742770"
}
},
"PUNISH": {
"WARN":"729764054897524768",
"KICK":"729764053794422896",
"BAN":"729764053861400637",
"MUTE":"729764053865463840",
"SOFTBAN":"729764053941223476",
"VOICEMUTE":"729764054855450697",
"CLEARHISTORY":"729764062270980096"
},
"BADGES": {
"NUCLEUSDEVELOPER":"775783766147858534",
"CLICKSDEVELOPER":"776140126156881950",
"HYPESQUAD": {
"BRILLIANCE":"775783766152577095",
"BRAVERY":"775783765930016789",
"BALANCE":"775783766303440937",
"EVENTS":"775783766194126908"
},
"EARLYSUPPORTER":"775783766055452693",
"BUGHUNTER":[null, "775783766252847154", "775783766130950234"],
"BOOSTER":"775783766131605545",
"PARTNER":"775783766178005033",
"STAFF":"775783766383788082",
"VERIFIEDBOTDEVELOPER":"775783766425600060",
"NITRO":"776149266775146546",
"BOT":"776375959108190239"
},
"VOICE": {
"CONNECT":"784785219391193138",
"CHANGE":"784785219353968670",
"LEAVE":"784785219432480808",
"MUTE":"784785219613360149",
"UNMUTE":"784785219441524766",
"DEAFEN":"784785219424747550",
"UNDEAFEN":"784785219324346378",
"STREAM": {
"START":"853519659775819787",
"STOP":"853519660116213780"
},
"VIDEO": {
"START":"853519659945295873",
"STOP":"853519660116738078"
}
},
"GUILD": {
"EMOJIS":"729066518549233795",
"GRAPHS":"752214059159650396",
"SETTINGS":"752570111063228507",
"ICONCHANGE":"729763053612302356",
"MODERATIONUPDATE":"729763053352124529",
"MODMAIL": {
"OPEN":"853245836331188264",
"CLOSE":"853580122506133505",
"ARCHIVE":"853580122636025856"
},
"ROLES": {
"CREATE":"729064530763579413",
"DELETE":"729064530885476392",
"EDIT":"776109664793919489",
"MEMBERS": "752570111281594509",
"MESSAGES": "752570111373606942",
"VOICE": "752570111088525354"
}
},
"MOD": {
"IMAGES": {
"SWEARING":"730438422627614810",
"INVISIBLE":"730438422690398238",
"TOOBIG":"730438422921084998",
"TOOSMALL":"730438422921216150"
},
"SWEARING":"730438422816096377",
"SPAM":"730438422853845042"
},
"NUMBERS": [
{
"NORMAL": "753259024404840529",
"GREEN": "753312608378945648",
"RED": "753312608890650664"
},
{
"NORMAL": "753259025990418515",
"GREEN": "753312608550912112",
"RED": "753312609075462246"
},
{
"NORMAL": "753259024409034896",
"GREEN": "753312608513294366",
"RED": "753312608680935446"
},
{
"NORMAL": "753259024358703205",
"GREEN": "753312608815284426",
"RED": "753312609377320966"
},
{
"NORMAL": "753259024555835513",
"GREEN": "753312608735461457",
"RED": "753312609255686223"
},
{
"NORMAL": "753259024744579283",
"GREEN": "753312608630604017",
"RED": "753312609138376777"
},
{
"NORMAL": "753259024354639994",
"GREEN": "753312608656031806",
"RED": "753312609465270412"
},
{
"NORMAL": "753259024530800661",
"GREEN": "753312608718815322",
"RED": "753312609104822313"
},
{
"NORMAL": "753259024895574037",
"GREEN": "753312608790249646",
"RED": "753312609477984319"
},
{
"NORMAL": "753259024681533553",
"GREEN": "753312608899170365",
"RED": "753312609557545089"
}
],
"BOTS": {
"GPS":"878919163937185803",
"NUCLEUS":"878919163597439016",
"CLICKSFORMS":"878919163337388073",
"CASTAWAY":"878919164255944726",
"CMPING":"878919164125929502",
"HOOKY":"878919164121731082"
},
"CFSERVICE": {
"VERIFIED":"881984571242053642",
"UNVERIFIED":"881984571258847232"
}
}

@ -0,0 +1,11 @@
{
"token": "your-token-here",
"developmentToken": "Nzc5Mzg4ODU2NTM2NTMwOTg0.X7f0bw.yzZg659UsLtHTfmeTsDXZa7O8K8",
"managementGuildID": "your-management-guild-id-here",
"developmentGuildID": "864185037078790195",
"enableDevelopment": true,
"owners": [
"317731855317336067",
"438733159748599813"
]
}

@ -0,0 +1,60 @@
import Discord, { CommandInteraction, MessageActionRow, Message } from "discord.js";
import EmojiEmbed from "./generateEmojiEmbed.js"
class confirmationMessage {
interaction: CommandInteraction;
title: string;
emoji: string;
description: string;
color: string;
constructor(interaction: CommandInteraction) {
this.interaction = interaction;
this.title = "";
this.emoji = "";
this.description = "";
this.color = "";
}
setTitle(title: string) { this.title = title; return this }
setEmoji(emoji: string) { this.emoji = emoji; return this }
setDescription(description: string) { this.description = description; return this }
setColor(color: string) { this.color = color; return this }
async send() {
let m = await this.interaction.reply({
embeds: [
new EmojiEmbed()
.setEmoji(this.emoji)
.setTitle(this.title)
.setDescription(this.description)
.setStatus(this.color)
],
components: [
new MessageActionRow().addComponents([
new Discord.MessageButton()
.setCustomId("yes")
.setLabel("Yes")
.setStyle("SUCCESS"),
new Discord.MessageButton()
.setCustomId("no")
.setLabel("Cancel") // TODO:
.setStyle("DANGER")
])
],
ephemeral: true,
fetchReply: true
})
let component;
try {
component = await (m as Message).awaitMessageComponent({filter: (m) => m.user.id === this.interaction.user.id, time: 2.5 * 60 * 1000});
} catch (e) {
return false; // TODO: Check the type of the error; change the error message here
}
return component.customId === "yes"
}
}
export default confirmationMessage;

@ -0,0 +1,29 @@
import Discord, { CommandInteraction, ColorResolvable, MessageEmbed } from "discord.js";
import getEmojiByName from "./getEmojiByName.js";
const colors = {
"Danger": 0xF27878,
"Warning": 0xF2D478,
"Success": 0x68D49E
}
class EmojiEmbed extends MessageEmbed {
_title: string;
_emoji: string;
// @ts-ignore
// This *is* meant to be an accessor rather than a property
get title() {
return `${getEmojiByName(this._emoji)} ${this._title}`;
}
set title(title: string) {
this._title = title;
}
setTitle(title: string) { this._title = title; return this }
setEmoji(emoji: string) { this._emoji = emoji; return this }
setStatus(color: string) { this.setColor(colors[color]); return this }
}
export default EmojiEmbed;

@ -0,0 +1,14 @@
function capitalize(s)
{
return s[0].toUpperCase() + s.slice(1);
}
function keyValueList(data) {
let out = "";
Object.entries(data).map(([key, value]) => {
out += `**${capitalize(key)}:** ${value}\n`
})
return out;
}
export default keyValueList;

@ -0,0 +1,12 @@
import emojis from '../config/emojis.json' assert {type: 'json'};
function getEmojiByName(name: string): string {
let split = name.split(".");
let id = emojis
split.forEach(part => {
id = id[part];
});
return `<:a:${id}>`;
}
export default getEmojiByName;
Loading…
Cancel
Save