-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed help commands and improved Fixed music play and currenty disable updated event with embed Co-Authored-By: Vipulbhai Chaudhary <152608930+nexos-crafter@users.noreply.github.com>
- Loading branch information
1 parent
6115428
commit 43301af
Showing
12 changed files
with
112 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,49 @@ | ||
const { EmbedBuilder } = require('discord.js'); | ||
|
||
module.exports = { | ||
name: 'help', | ||
description: 'List all commands or info about a specific command.', | ||
execute(message, args) { | ||
const data = []; | ||
const { commands } = message.client; | ||
|
||
if (!args.length) { | ||
data.push('Here\'s a list of all my commands:'); | ||
data.push(commands.map(command => command.name).join(', ')); | ||
data.push(`\nYou can send \`${process.env.BOT_PREFIX}help [command name]\` to get info on a specific command!`); | ||
|
||
return message.channel.send(data, { split: true }); | ||
} | ||
|
||
const name = args[0].toLowerCase(); | ||
const command = commands.get(name) || commands.find(c => c.aliases && c.aliases.includes(name)); | ||
|
||
if (!command) { | ||
return message.reply('That\'s not a valid command!'); | ||
} | ||
|
||
data.push(`**Name:** ${command.name}`); | ||
|
||
if (command.description) data.push(`**Description:** ${command.description}`); | ||
if (command.usage) data.push(`**Usage:** ${process.env.BOT_PREFIX}${command.name} ${command.usage}`); | ||
|
||
message.channel.send(data, { split: true }); | ||
name: 'help', | ||
description: 'List all commands or info about a specific command.', | ||
options: [ | ||
{ | ||
name: 'command', | ||
type: 'STRING', | ||
description: 'The command to get information about', | ||
required: false, | ||
}, | ||
}; | ||
|
||
], | ||
execute(message, args) { | ||
const { commands } = message.client; | ||
|
||
if (!args.length) { | ||
const helpEmbed = new EmbedBuilder() | ||
.setColor('#0099ff') | ||
.setTitle('Help - List of Commands') | ||
.setDescription('Here\'s a list of all my commands:') | ||
.addFields( | ||
{ name: 'Commands', value: commands.map(command => `\`${command.name}\`: ${command.description}`).join('\n') }, | ||
{ name: 'Usage', value: `You can send \`${process.env.BOT_PREFIX}help [command name]\` to get info on a specific command!` } | ||
) | ||
.setFooter({ text: 'Bot Help Command', iconURL: 'https://i.imgur.com/wSTFkRM.png' }); | ||
|
||
return message.channel.send({ embeds: [helpEmbed] }); | ||
} | ||
|
||
const name = args[0].toLowerCase(); | ||
const command = commands.get(name) || commands.find(c => c.aliases && c.aliases.includes(name)); | ||
|
||
if (!command) { | ||
return message.reply('That\'s not a valid command!'); | ||
} | ||
|
||
const commandEmbed = new EmbedBuilder() | ||
.setColor('#0099ff') | ||
.setTitle(`Command: ${command.name}`) | ||
.addFields( | ||
{ name: 'Description', value: command.description || 'No description available.' }, | ||
{ name: 'Usage', value: `\`${process.env.BOT_PREFIX}${command.name} ${command.usage || ''}\`` } | ||
) | ||
.setFooter({ text: 'Nexos Creator', iconURL: 'https://i.imgur.com/wSTFkRM.png' }); | ||
|
||
message.channel.send({ embeds: [commandEmbed] }); | ||
}, | ||
}; |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
const { SlashCommandBuilder } = require('discord.js'); | ||
|
||
module.exports = { | ||
data: new SlashCommandBuilder() | ||
.setName('warn') | ||
.setDescription('Warn a user') | ||
.addUserOption(option => option.setName('user').setDescription('The user to warn').setRequired(true)) | ||
.addStringOption(option => option.setName('reason').setDescription('The reason for the warnning').setRequired(true)), | ||
async execute(interaction) { | ||
const user = interaction.options.getUser('user'); | ||
const reason = interaction.options.getString('reason'); | ||
await interaction.reply(`${user.tag} has been warned for: ${reason}`); | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
const Parser = require('rss-parser'); | ||
|
||
const rssParser = new Parser(); | ||
|
||
// Array of RSS feed URLs to monitor | ||
const rssFeeds = [ | ||
'https://example.com/feed/rss', | ||
'https://anotherwebsite.com/rss.xml' | ||
]; | ||
|
||
async function checkFeeds() { | ||
try { | ||
for (const feedUrl of rssFeeds) { | ||
const feed = await rssParser.parseURL(feedUrl); | ||
if (feed && feed.items && feed.items.length > 0) { | ||
const latestItem = feed.items[0]; | ||
const message = `**New Post on ${feed.title}**\n${latestItem.title}\n${latestItem.link}`; | ||
postToDiscord(message); | ||
} | ||
} | ||
} catch (error) { | ||
console.error('Error fetching or parsing RSS feed:', error.message); | ||
} | ||
} | ||
|
||
function postToDiscord(content) { | ||
const channel = client.channels.cache.get('your_channel_id_here'); // Replace with your channel ID | ||
if (channel) { | ||
channel.send(content); | ||
} else { | ||
console.error('Invalid channel ID or missing permissions'); | ||
} | ||
} |