From 978f5270ed42e980b153525d43292bfc05ad834c Mon Sep 17 00:00:00 2001 From: Ahmad <103906421+ahmadk953@users.noreply.github.com> Date: Sat, 6 Jan 2024 22:12:47 -0500 Subject: [PATCH] Updated README and Security Policy and Updated Rules Command. --- README.md | 5 ++++- SECURITY.md | 5 +++-- source/commands/rules.ts | 41 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 48 insertions(+), 3 deletions(-) create mode 100644 source/commands/rules.ts diff --git a/README.md b/README.md index e0165cd..386c858 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,9 @@ -# poixpixel-discord-bot +# Poixpixel's Discord Bot + > [!WARNING] > This project **IS NOT** ready for production use and is still very buggy. This is just a **early prototype** and most things **will change in the future**. +> [!INFO] +> Want to see the bot in action? Join the [Poixpixel Discord Server](https://discord.gg/KRTGjxx7gY) Install: ``yarn install`` diff --git a/SECURITY.md b/SECURITY.md index fb420e1..58051b9 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -1,7 +1,8 @@ # Security Policy -# NOTE: Expect this polocy to change +> [!NOTE] +> Expect this policy to change in the future. ## Reporting a Vulnerability -If you notice a vulnerability in the project, please imidiatly report it to [me](mailto:ahmad.khan60@outlook.com) +If you notice a vulnerability in the project, please immediately report it to [me](mailto:ahmad.khan60@outlook.com) diff --git a/source/commands/rules.ts b/source/commands/rules.ts new file mode 100644 index 0000000..1623b2c --- /dev/null +++ b/source/commands/rules.ts @@ -0,0 +1,41 @@ +import { + SlashCommandBuilder, + CommandInteraction, + EmbedBuilder, +} from "discord.js"; + +interface Command { + data: Omit; + execute: (interaction: CommandInteraction) => Promise; +} + +const rulesEmbed = new EmbedBuilder() + .setColor(0x0099ff) + .setTitle("Server Rules") + .setAuthor({ name: "Poixixel", iconURL: "https://cdn.discordapp.com/avatars/1052017329376071781/922947c726d7866d313744186c42ef49.webp" }) + .setDescription("These are the rules for the server. Please read and follow them carefully.") + .addFields( + { name: "Rule #1: Be respectful", value: "This means no mean, rude, or harassing comments. Treat others the way you want to be treated." }, + { name: '\u200B', value: '\u200B' }, + { name: "Rule #2: No inappropriate language", value: "All profanity language is prohibited in this server. Any derogatory language towards any user is prohibited. Swearing is not permitted in any channels." }, + { name: '\u200B', value: '\u200B' } + //TODO Add all the rest of Poixpixel's rules here + ) + .setTimestamp() + .setFooter({ + text: "Sent by the Poixpixel Bot", + iconURL: "https://cdn.discordapp.com/avatars/1052017329376071781/922947c726d7866d313744186c42ef49.webp", + }); + +const command: Command = { + data: new SlashCommandBuilder() + .setName("rules") + .setDescription("Sends the server rules"), + execute: async (interaction) => { + const channel = interaction.channel; + channel?.send({ embeds: [rulesEmbed] }); + await interaction.reply(`Here are the server rules:`); + }, +}; + +export default command;