System Bot
System Bot
const commands = [
new SlashCommandBuilder()
.setName('slot')
.setDescription('Create a slot channel')
.addStringOption(option =>
option
.setName('name')
.setDescription('The start of the channel name: slot-busso slot- is the
name')
.setRequired(true)
)
.addUserOption(option =>
option
.setName('user')
.setDescription('User to mention')
.setRequired(true)
)
.addStringOption(option =>
option
.setName('expiration')
.setDescription('Expiration example: lifetime')
.setRequired(true)
)
.addStringOption(option =>
option
.setName('pings')
.setDescription('Pings example: 2x everyone')
.setRequired(true)
)
.addStringOption(option =>
option
.setName('categoryid')
.setDescription('Category ID')
.setRequired(true)
),
new SlashCommandBuilder()
.setName('sendembed')
.setDescription('sends an embed')
.setDefaultMemberPermissions(PermissionsBitField.BanMembers)
.addStringOption(option =>
option
.setName('title')
.setDescription('title of the embed')
.setRequired(true))
.addStringOption(option =>
option
.setName("description")
.setDescription("the description of the embed")
.setRequired(true))
.addChannelOption(option =>
option
.setName("channel")
.setDescription("the channel where to send the embed")
.setRequired(true)),
new SlashCommandBuilder()
.setName("memberscount")
.setDescription("sends the amount of the members that are in the server"),
new SlashCommandBuilder()
.setName("ping")
.setDescription("Shows The Current Ms Of The Bot"),
new SlashCommandBuilder()
.setName("support-server")
.setDescription("shows the link of the support discord server!"),
new SlashCommandBuilder()
.setName("addrole")
.setDescription("adds a role to an user")
.addRoleOption(option => option
.setName("role")
.setDescription("the Role to add ")
.setRequired(true))
.addUserOption(option => option
.setName("user")
.setDescription("The User To add The role")
.setRequired(true)),
new SlashCommandBuilder()
.setName('productsend')
.setDescription('Send a product information')
.addUserOption(option =>
option
.setName('user')
.setDescription('User to send the product information')
.setRequired(true)
)
.addStringOption(option =>
option
.setName('product')
.setDescription('Product information')
.setRequired(true)
)
.addStringOption(option =>
option
.setName('thanksmessage')
.setDescription('Thanks message')
.setRequired(false)
),
new SlashCommandBuilder()
.setName('avatar')
.setDescription('Show the avatar of a user')
.addUserOption(option =>
option
.setName('user')
.setDescription('The user to show the avatar')
.setRequired(true)),
new SlashCommandBuilder()
.setName('free-premium')
.setDescription('tutorial on how to get free premium access'),
new SlashCommandBuilder()
.setName('percentage')
.setDescription('Calculate the percentage')
.addNumberOption(option =>
option.setName('percentage')
.setDescription('The Percentage You Want To calculate, Like: 10% (insert only
the number like 10 not 10%')
.setRequired(true))
.addNumberOption(option =>
option.setName('number')
.setDescription('The Number To Calculate The Percentage like 529 so 10% of
529 for example')
.setRequired(true)),
(async () => {
try {
console.log('Started refreshing application (/) commands.');
await rest.put(
Routes.applicationCommands(clientId),
{ body: commands },
);
rest.delete(Routes.applicationCommand(clientId, '1188497566346793051'))
.then(() => console.log('Successfully deleted application command'))
.catch(console.error);
}
})();
try {
const channel = client.channels.cache.get(statusChannelId);
const message = await channel.messages.fetch(statusMessageId);
message.edit({ embeds: [embed] });
} catch (error) {
console.error('Error updating status message:', error);
}
};
client.on('ready', () => {
console.log(`Logged in as ${client.user.tag}`);
client.user.setActivity({
name: "#1 SHOP BOT",
type: ActivityType.Game
});
// Uncomment the line below if you want to update the status message on bot
startup
updateStatusMessage();
setInterval(updateStatusMessage, 2 * 60 * 1000);
});
if (!role || !member) {
return interaction.reply({ content: 'Invalid role or member.', ephemeral:
true });
}
if (!interaction.member.permissions.has(PermissionsBitField.Flags.ManageRoles))
{
return interaction.reply({ content: 'You do not have permission to manage
roles', ephemeral: true });
}
try {
await member.roles.add(role);
interaction.reply({ content: `Role ${role.name} added to $
{member.user.username}.`, ephemeral: true });
} catch (error) {
console.error('Error adding role:', error);
interaction.reply({ content: 'An error occurred while adding the role.',
ephemeral: true });
}
}
if (!role || !member) {
return interaction.reply({ content: 'Invalid role or member.', ephemeral:
true });
}
if (!interaction.member.permissions.has(PermissionsBitField.Flags.ManageRoles))
{
return interaction.reply({ content: 'You do not have permission to manage
roles', ephemeral: true });
}
try {
await member.roles.remove(role);
interaction.reply({ content: `Role ${role.name} removed from $
{member.user.username}.`, ephemeral: true });
} catch (error) {
console.error('Error removing role:', error);
interaction.reply({ content: 'An error occurred while removing the role.',
ephemeral: true });
}
}
user.send({
embeds: [new EmbedBuilder()
.setTitle(`PRODUCT FROM ${guild.name}`)
.setDescription(thanksMessage)
.setColor(0x000000)
.setTimestamp()
.setFooter({ text: 'Powered By OS Devs', iconURL:
'https://cdn.discordapp.com/attachments/1136960027454877778/1185539625628995664/
image.png?
ex=658ffad1&is=657d85d1&hm=43f31add8e3c4d2c924927b27e624ab4f466da2a07c1713924790705
2553d501&' }),
],
});
}
if (interaction.commandName === 'percentage') {
const percentage = interaction.options.getNumber('percentage');
const number = interaction.options.getNumber('number');
if (isNaN(percentage) || isNaN(number)) {
return interaction.reply({ content: 'Invalid input. Please provide valid
numbers.', ephemeral: true });
}
client.login('MTE4NjcwNTQzNjM5MzYwMzEwMg.Gdq7pc.zpqQSIOHerZpeSnlm32IAD-
NrKKZX_zVuU3yOc');