General Updates

This commit is contained in:
Ahmad 2024-03-03 17:43:26 -05:00
parent a67829c6f1
commit cdb82b771e
No known key found for this signature in database
GPG key ID: 8FD8A93530D182BF
10 changed files with 161 additions and 129 deletions

View file

@ -1,4 +1,4 @@
import { SlashCommandBuilder, CommandInteraction } from 'discord.js';
import { SlashCommandBuilder, CommandInteraction } from "discord.js";
interface Command {
data: Omit<SlashCommandBuilder, "addSubcommand" | "addSubcommandGroup">;
@ -7,11 +7,11 @@ interface Command {
const command: Command = {
data: new SlashCommandBuilder()
.setName('ping')
.setDescription('Replies with Pong!'),
.setName("ping")
.setDescription("Check the latency of the bot"),
execute: async (interaction) => {
await interaction.reply(`Pong!`);
await interaction.reply(`Pong! Latency: ${Date.now() - interaction.createdTimestamp}ms`);
},
};
export default command;
export default command;

View file

@ -2,6 +2,7 @@ import {
SlashCommandBuilder,
CommandInteraction,
EmbedBuilder,
CommandInteractionOptionResolver ,
} from "discord.js";
interface Command {
@ -12,19 +13,34 @@ interface Command {
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.")
.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
{
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",
iconURL:
"https://cdn.discordapp.com/avatars/1052017329376071781/922947c726d7866d313744186c42ef49.webp",
});
const command: Command = {
@ -34,7 +50,7 @@ const command: Command = {
execute: async (interaction) => {
const channel = interaction.channel;
channel?.send({ embeds: [rulesEmbed] });
await interaction.reply(`Here are the server rules:`);
await interaction.reply({ content: 'The Rules Were Sent in the Current Channel', ephemeral: true });
},
};

View file

@ -1,17 +1,19 @@
import { SlashCommandBuilder, CommandInteraction } from 'discord.js';
import { SlashCommandBuilder, CommandInteraction } from "discord.js";
interface Command {
data: Omit<SlashCommandBuilder, "addSubcommand" | "addSubcommandGroup">;
execute: (interaction: CommandInteraction) => Promise<void>;
data: Omit<SlashCommandBuilder, "addSubcommand" | "addSubcommandGroup">;
execute: (interaction: CommandInteraction) => Promise<void>;
}
const command: Command = {
data: new SlashCommandBuilder()
.setName('server')
.setDescription('Provides information about the server.'),
execute: async (interaction) => {
await interaction.reply(`This server is ${interaction?.guild?.name} and has ${interaction?.guild?.memberCount} members.`);
},
data: new SlashCommandBuilder()
.setName("server")
.setDescription("Provides information about the server."),
execute: async (interaction) => {
await interaction.reply(
`The server name is ${interaction?.guild?.name} and it has ${interaction?.guild?.memberCount} members.`
);
},
};
export default command;
export default command;

View file

@ -1,21 +1,29 @@
import { SlashCommandBuilder, CommandInteraction, GuildMember } from 'discord.js';
import {
SlashCommandBuilder,
CommandInteraction,
GuildMember,
} from "discord.js";
interface Command {
data: Omit<SlashCommandBuilder, "addSubcommand" | "addSubcommandGroup">;
execute: (interaction: CommandInteraction) => Promise<void>;
data: Omit<SlashCommandBuilder, "addSubcommand" | "addSubcommandGroup">;
execute: (interaction: CommandInteraction) => Promise<void>;
}
const command: Command = {
data: new SlashCommandBuilder()
.setName('user')
.setDescription('Provides information about the user.'),
execute: async (interaction) => {
if (interaction.member instanceof GuildMember) {
await interaction.reply(`This command was run by ${interaction.user.username}, who joined on ${interaction.member.joinedAt}.`);
} else {
await interaction.reply(`This command was run by ${interaction.user.username}.`);
}
},
data: new SlashCommandBuilder()
.setName("user")
.setDescription("Provides information about the user."),
execute: async (interaction) => {
if (interaction.member instanceof GuildMember) {
await interaction.reply(
`This command was run by ${interaction.user.username}, who joined this server on ${interaction.member.joinedAt}.`
);
} else {
await interaction.reply(
`This command was run by ${interaction.user.username}.`
);
}
},
};
export default command;
export default command;