Comments (9)
that’s an issue on your side and with your commands. I would suggest debugging the issues with logging statements. Not sure how I can help with that issue otherwise…
from taurus.
This is what i did, it should work normally
const { SlashCommandBuilder, EmbedBuilder } = require("discord.js");
const fs = require("fs");
module.exports = {
data: new SlashCommandBuilder()
.setName("addpremium")
.setDescription("Give premium to a user.")
.addUserOption((option) =>
option.setName("user").setDescription("The user to give premium.").setRequired(true),
),
async execute(interaction) {
if (interaction.user.id !== 'OWNER_ID') {
const ownerOnlyEmbed = new EmbedBuilder()
.setDescription(":x: This command is for the bot owner only.")
.setColor("#FF0000"); // Red color for errors
return interaction.reply({ embeds: [ownerOnlyEmbed] });
}
const userId = interaction.options.getUser("user").id;
const premiumUsers = JSON.parse(fs.readFileSync("premium_users.json"));
if (premiumUsers.includes(userId)) {
const alreadyPremiumEmbed = new EmbedBuilder()
.setDescription(`<@${userId}> is already a premium user.`)
.setColor("#FF0000"); // Red color for errors
return interaction.reply({ embeds: [alreadyPremiumEmbed] });
}
premiumUsers.push(userId);
fs.writeFileSync("premium_users.json", JSON.stringify(premiumUsers));
const successEmbed = new EmbedBuilder()
.setDescription(`:white_check_mark: Premium status has been added to <@${userId}> successfully.`)
.setColor("#00FF00"); // Green color for success
await interaction.reply({ embeds: [successEmbed] });
},
};
from taurus.
Whatever command i make just does not work.
from taurus.
I am not sure, at some point, your code is not working. You can debug this with the logging statements. Custom commands do work, you can test this by creating a new command in the slash commands directory and then make it so that the bot sends a simple message when it’s executed.
from taurus.
okay trying
from taurus.
that works
from taurus.
what about the code above? why is it not working
from taurus.
i made it work. im stupid
from taurus.
glad you managed to fix the issue!
from taurus.
Related Issues (20)
- [FEATURE] Music Generation! HOT 1
- [ENHANCEMENT] History for context menu commands
- [BUG] Loading dots/timer broken
- [ENHANCEMENT] Clickable Commands in /help
- [BUG] Getting an error when running HOT 7
- [BUG] Slash commands not added | Bot replying wrong HOT 32
- [BUG] Bot replying wrong HOT 1
- [BUG] Server Commands Broken HOT 1
- [ENHANCEMENT] Retry request if token limit reached
- [ENHANCEMENT] Move utils file
- [FEATURE] Image Upscaling
- [BUG] Bot not replying when link embed
- [FEATURE] Music | TTS | Video Gen
- [BUG] getting error when using /taurusai command HOT 2
- [FEATURE] Settings Panel | V4
- [BUG] ERR_DLOPEN_FAILED
- [FEATURE] Proper Docker Support
- [FEATURE] Chat Safety Disabling/Enabling
- [FEATURE] MUSIC HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from taurus.