Basic User and Guild registration

This commit is contained in:
2022-04-17 16:07:57 +02:00
parent be2991cd50
commit 3dddae6dca
7 changed files with 142 additions and 6 deletions

24
commands/userlist.js Normal file
View File

@@ -0,0 +1,24 @@
const { SlashCommandBuilder } = require("@discordjs/builders");
const { User } = require("../models");
module.exports = {
data: new SlashCommandBuilder()
.setName("userlist")
.setDescription("List all users"),
async execute(interaction) {
let users = await User.findAll();
let userList = "";
for (let i = 0; i < users.length; i++) {
let username = await interaction.client.users.fetch(users[i].userID);
userList += `${username.username}#${username.discriminator}`;
}
if (userList === "") {
userList = "No users found";
}
interaction.reply({
content: userList,
ephemeral: false
});
}
}