-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
100 changed files
with
5,337 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
const { getVoiceConnection, joinVoiceChannel } = require('@discordjs/voice'); | ||
|
||
module.exports = { | ||
handleVoiceChannel(guildId, channelId, adapterCreator) { | ||
const connection = getVoiceConnection(guildId); | ||
|
||
if (!connection) { | ||
try { | ||
joinVoiceChannel({ | ||
channelId: channelId, | ||
guildId: guildId, | ||
adapterCreator: adapterCreator, | ||
}); | ||
console.log('Joined voice channel:', channelId); | ||
} catch (error) { | ||
console.error('Error joining voice channel:', error); | ||
} | ||
} else { | ||
console.log('Already in a voice channel:', connection.joinConfig.channelId); | ||
} | ||
}, | ||
|
||
handleVoiceChannelLeave(guildId) { | ||
const connection = getVoiceConnection(guildId); | ||
|
||
if (connection) { | ||
try { | ||
connection.destroy(); | ||
console.log('Left voice channel'); | ||
} catch (error) { | ||
console.error('Error destroying voice connection:', error); | ||
} | ||
} else { | ||
console.log('Not in a voice channel'); | ||
} | ||
}, | ||
}; |
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,30 @@ | ||
const { Message, EmbedBuilder, Embed } = require('discord.js') | ||
const DB = require("../../Schemas/AFKSystem") | ||
|
||
module.exports = { | ||
name: "messageCreate", | ||
once: false, | ||
/** | ||
* @param {Message} message | ||
*/ | ||
async execute(message) { | ||
if(message.author.bot) return; | ||
|
||
//await DB.deleteOne({ GuildID: message.guild.id, UserID: message.author.id }) | ||
|
||
if(message.mentions.members) { | ||
const Response = new EmbedBuilder() | ||
.setColor(0xff5454) | ||
|
||
message.mentions.members.forEach((m) => { | ||
DB.findOne({GuildID: message.guild.id, UserID: m.id}, async(err, data) => { | ||
if(err) throw err; | ||
|
||
if(data) | ||
Response.setDescription(`${m} went AFK <t:${data.Time}:R>\n **Status:** ${data.Status}`); | ||
return message.reply({embeds: [Response]}) | ||
}) | ||
}) | ||
} | ||
} | ||
} |
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,35 @@ | ||
const { Events, Guilds, Client, EmbedBuilder, ButtonStyle, ActionRowBuilder, ButtonBuilder } = require('discord.js'); | ||
|
||
module.exports = { | ||
name: 'guildCreate', | ||
once: false, | ||
async execute(guild) { | ||
const channel = guild.channels.cache.random(); | ||
if (!channel) return; | ||
|
||
const but = new ActionRowBuilder() | ||
.addComponents( | ||
new ButtonBuilder() | ||
.setLabel("Support") | ||
.setStyle(ButtonStyle.Link) | ||
.setURL('https://discord.gg/GEEkNWvsP3'), | ||
|
||
new ButtonBuilder() | ||
.setLabel("Vote") | ||
.setStyle(ButtonStyle.Link) | ||
.setURL('https://top.gg/bot/1023810715250860105') | ||
|
||
) | ||
|
||
const emb = new EmbedBuilder() | ||
.addFields({ name: 'Guidelines', value: '> • I am only running on **slash commands**. \n> • Find my all commands by using </help:1080512943021633594> command. \n> • Use </report-bug:1234> if you found any **bug**. \n\n🎟️ **If you need any help feel free to join our support server**. \n⚠️ **Make sure to give my required permissions.**', inline: false }) | ||
.setDescription('**Advanced futuristic discord bot with many amazing high functional features like MiniGames, Giveaways, Counting system and many more.**') | ||
.setAuthor({ name: '❤️ Thanks for adding me!' }) | ||
.setTitle('Hi, I am XEpert.') | ||
.setFooter({ text: '©XEpert - 2023' }) | ||
.setTimestamp() | ||
.setColor('Blue') | ||
|
||
channel.send({ embeds: [emb], components: [but] }); | ||
} | ||
}; |
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,45 @@ | ||
const { | ||
Events, | ||
EmbedBuilder, | ||
ButtonStyle, | ||
ButtonBuilder, | ||
ActionRowBuilder, | ||
} = require("discord.js"); | ||
|
||
module.exports = { | ||
name: Events.MessageCreate, | ||
|
||
async execute(message, client, interaction) { | ||
if (message.author.bot) return; | ||
if (message.content.includes("<@1023810715250860105")) { //your bot id | ||
|
||
|
||
const pingEmbed = new EmbedBuilder() | ||
|
||
.setColor("DarkerGrey") | ||
.setTitle("🏓 • Who mentioned me??") | ||
.setDescription( | ||
`Hey there ${message.author.username}!, here is some useful information about me.\n⁉️ • **How to view all commands?**\nEither use **/help** or do / to view a list of all the commands!` | ||
) | ||
|
||
.addFields({ name: `**🏡 • Servers:**`, value: `${client.guilds.cache.size}`, inline: true }) | ||
.addFields({ name: `**👥 • Users:**`, value: `${client.users.cache.size}`, inline: true}) | ||
.addFields({ name: `**💣 • Commands:**`, value: `${client.commands.size}`, inline: true}) | ||
.setTimestamp() | ||
//.setThumbnail(`https://images-ext-2.discordapp.net/external/kYZ9-W_VdGxOB7cRlOO-2-IH2fJrAVjLQhPczBBRDzk/%3Fsize%3D1024/https/cdn.discordapp.com/avatars/1023810715250860105/593d6d98f5169db7a0ba28464846ed29.png?width=656&height=656`) / any image you would like | ||
.setFooter({text: `Requested by ${message.author.username}.`}) | ||
const buttons = new ActionRowBuilder().addComponents( | ||
new ButtonBuilder() | ||
.setEmoji("➕") | ||
.setLabel("Invite") | ||
.setURL( | ||
"https://discord.com/api/oauth2/authorize?client_id=1023810715250860105&permissions=8&scope=applications.commands%20bot" //your bot invite link | ||
) | ||
.setStyle(ButtonStyle.Link) | ||
); | ||
|
||
return message.reply({ embeds: [pingEmbed], components: [buttons] }); | ||
} | ||
}, | ||
}; | ||
|
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,51 @@ | ||
const { EmbedBuilder } = require('discord.js'); | ||
const Birthday = require('../../Models/birthdayschema'); | ||
|
||
module.exports = async (client) => { | ||
setInterval(async () => { | ||
console.log('Checking for birthdays...'); | ||
const today = new Date(); | ||
const start = new Date(Date.UTC(today.getUTCFullYear(), today.getUTCMonth(), today.getUTCDate())); | ||
const end = new Date(Date.UTC(today.getUTCFullYear(), today.getUTCMonth(), today.getUTCDate() + 1)); | ||
|
||
|
||
console.log('Start date:', start); | ||
console.log('End date:', end); | ||
|
||
const birthdays = await Birthday.find({ | ||
$expr: { | ||
$and: [ | ||
{ $eq: [{ $month: '$birthday' }, start.getMonth() + 1] }, | ||
{ $eq: [{ $dayOfMonth: '$birthday' }, start.getDate()] }, | ||
], | ||
}, | ||
}); | ||
|
||
console.log(`Found ${birthdays.length} birthdays`); | ||
|
||
const channel = client.channels.cache.get('1091345968827486210'); // Replace CHANNEL_ID with the actual ID of the channel | ||
|
||
if (!channel) { | ||
console.error(`Error: could not find channel with ID ${channelId}`); | ||
return; | ||
} | ||
|
||
for (const bday of birthdays) { | ||
const user = await client.users.fetch(bday.userId); | ||
let birthdayimage = ["https://media.tenor.com/WIW4f9FjCuMAAAAC/birthday-eyelashes.gif"]; | ||
|
||
const embed = new EmbedBuilder() | ||
.setTitle(`Happy Birthday, ${user.username}! 🎉🎂🎈`) | ||
.setImage(`${birthdayimage}`) | ||
.setDescription(`May your day be filled with joy and happiness!`) | ||
.setColor('#AD1457'); | ||
|
||
try { | ||
await channel.send({ embeds: [embed] }); | ||
} catch (err) { | ||
console.error(`Error sending birthday message to channel ${channelId}: ${err}`); | ||
} | ||
} | ||
}, 24 * 60 * 60 * 1000); | ||
}; | ||
//credits to me! @Maryna4556 |
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,49 @@ | ||
const { EmbedBuilder, AttachmentBuilder, GuildMember } = require("discord.js"); | ||
|
||
const logDatabase = require("../../Schemas/logs"); | ||
|
||
async function commandlogSend({ time, place, command }, interaction) { | ||
try { | ||
const data = await logDatabase.findOne({ Guild: interaction?.guild?.id }); | ||
if (!data) return; | ||
|
||
const attachment = new AttachmentBuilder("/home/container/picture.gif"); | ||
|
||
const channel = interaction.guild.channels.cache.get(data.logChannel); | ||
|
||
const commandEmbed = new EmbedBuilder() | ||
.setTitle("💬 Command Log 💬") | ||
.setAuthor({ | ||
name: `${interaction.user.tag} | ${interaction.user.id}`, | ||
iconURL: interaction.user.displayAvatarURL({ dynamic: true }), | ||
}) | ||
.setColor("Green") | ||
.setThumbnail("attachment://picture.gif") | ||
.addFields( | ||
{ | ||
name: "👤 User:", | ||
value: `${interaction.user}`, | ||
}, | ||
{ | ||
name: "💬 Command:", | ||
value: `${command}`, | ||
}, | ||
{ | ||
name: "❔ Channel:", | ||
value: ` ${place}`, | ||
}, | ||
{ | ||
name: "⏲️ Command Executed:", | ||
value: `<t:${time}:D> | <t:${time}:R>`, | ||
} | ||
) | ||
.setFooter({ text: "📩 Command Executed" }) | ||
.setTimestamp(); | ||
|
||
channel.send({ embeds: [commandEmbed], files: [attachment] }); | ||
} catch (error) { | ||
console.error(error); | ||
} | ||
} | ||
|
||
module.exports = { commandlogSend }; |
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,40 @@ | ||
const { EmbedBuilder, AttachmentBuilder } = require("discord.js"); | ||
|
||
async function cooldownSend({ user, command, time, left }, interaction) { | ||
const attachment = new AttachmentBuilder("/home/container/picture.gif"); | ||
|
||
const errorEmbed = new EmbedBuilder() | ||
.setAuthor({ | ||
name: `${interaction.user.tag} | ${interaction.user.id}`, | ||
iconURL: interaction.user.displayAvatarURL({ dynamic: true }), | ||
}) | ||
.setDescription( | ||
`⚠️ Alert: Please wait ${left} Seconds before running this command again.` | ||
) | ||
.setColor("Red") | ||
.setThumbnail("attachment://picture.gif") | ||
.addFields( | ||
{ | ||
name: "👤 User:", | ||
value: `${user}`, | ||
}, | ||
{ | ||
name: "💬 Command:", | ||
value: `${command}`, | ||
}, | ||
{ | ||
name: "⏲️ Command Executed:", | ||
value: `<t:${time}:D> | <t:${time}:R>`, | ||
} | ||
) | ||
.setFooter({ text: "⏱️ Cooldown Alert" }) | ||
.setTimestamp(); | ||
|
||
await interaction.reply({ | ||
embeds: [errorEmbed], | ||
files: [attachment], | ||
ephemeral: true, | ||
}); | ||
} | ||
|
||
module.exports = { cooldownSend }; |
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,74 @@ | ||
const { EmbedBuilder } = require('discord.js'); | ||
const countingSchema = require('../../Schemas/countingSchema'); | ||
|
||
module.exports = { | ||
name: 'messageCreate', | ||
async execute(message) { | ||
if (message.author.bot) return; | ||
|
||
const countingData = await countingSchema.findOne({ Guild: message.guild.id }); | ||
if (!countingData) return; | ||
|
||
if (message.channel.id !== countingData.Channel) return; | ||
|
||
const number = parseInt(message.content); | ||
|
||
if (isNaN(number) || number.toString() !== message.content) return; | ||
|
||
if (countingData.Count === 0) { | ||
if (number !== 1) { | ||
const errorEmbed = new EmbedBuilder() | ||
.setTitle('Incorrect Number') | ||
.setDescription('You must type 1 before continuing onto other numbers.') | ||
.setTimestamp() | ||
.setFooter({ text: `Incorrect Number At` }) | ||
.setColor('Red'); | ||
|
||
await message.channel.send({ embeds: [errorEmbed] }); | ||
return; | ||
} | ||
} | ||
|
||
if (number === countingData.Count + 1) { | ||
countingData.Count++; | ||
await countingData.save(); | ||
|
||
const response = new EmbedBuilder() | ||
.setTitle(`Current number: ${countingData.Count}`) | ||
.setColor('Green'); | ||
|
||
const reaction = await message.channel.send({ embeds: [response] }); | ||
await reaction.react('<:SW_Icons_rverification:1106291119563735080>'); | ||
|
||
// Check if the maximum count has been reached | ||
if (countingData.Count === countingData.MaxCount) { | ||
const congratulationsEmbed = new EmbedBuilder() | ||
.setTitle('Congratulations!') | ||
.setDescription(`${message.author.username}, you have reached the goal of **${countingData.MaxCount}**! Well done!`) | ||
.setTimestamp() | ||
.setFooter({ text: `Game Complete` }) | ||
.setColor('Gold'); | ||
|
||
|
||
const congratsReact = await message.channel.send({ embeds: [congratulationsEmbed] }); | ||
congratsReact.react('🏆') | ||
|
||
|
||
countingData.Count = 0; // Reset count to 0 | ||
await countingData.save(); | ||
} | ||
} else { | ||
const wrongNumberEmbed = new EmbedBuilder() | ||
.setTitle('Wrong Number') | ||
.setDescription(`${message.author.username} has ruined the fun at number **${countingData.Count}**.`) | ||
.setColor('Red') | ||
.setTimestamp() | ||
.setFooter({ text: `Wrong Number` }) | ||
|
||
await message.channel.send({ embeds: [wrongNumberEmbed] }); | ||
|
||
countingData.Count = 0; // Reset count to 0 | ||
await countingData.save(); | ||
} | ||
}, | ||
}; |
Oops, something went wrong.