mirror of
https://github.com/ahmadk953/poixpixel-discord-bot.git
synced 2025-05-10 10:43:06 +00:00
Added Drizzle ORM for Database Connection and Basic Member Command
This commit is contained in:
parent
f1e6e05345
commit
9030fbcdcb
11 changed files with 1955 additions and 154 deletions
24
src/commands/members.ts
Normal file
24
src/commands/members.ts
Normal file
|
@ -0,0 +1,24 @@
|
|||
import { SlashCommandBuilder, CommandInteraction, EmbedBuilder } from "discord.js";
|
||||
import { getAllMembers } from "../util/db.js";
|
||||
|
||||
interface Command {
|
||||
data: Omit<SlashCommandBuilder, "addSubcommand" | "addSubcommandGroup">;
|
||||
execute: (interaction: CommandInteraction) => Promise<void>;
|
||||
}
|
||||
|
||||
const command: Command = {
|
||||
data: new SlashCommandBuilder()
|
||||
.setName("members")
|
||||
.setDescription("Lists all non-bot members of the server"),
|
||||
execute: async (interaction) => {
|
||||
const members = await getAllMembers();
|
||||
const memberList = members.map(m => `**${m.discordUsername}** (${m.discordId})`).join("\n");
|
||||
const membersEmbed = new EmbedBuilder()
|
||||
.setTitle("Members")
|
||||
.setDescription(memberList)
|
||||
.setColor(0x0099ff);
|
||||
await interaction.reply({ embeds: [membersEmbed] });
|
||||
},
|
||||
};
|
||||
|
||||
export default command;
|
Loading…
Add table
Add a link
Reference in a new issue