-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Discord.js v14 and added some commands.
- Loading branch information
Showing
93 changed files
with
7,744 additions
and
2,526 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,4 +1,5 @@ | ||
.env | ||
.vs | ||
.vscode | ||
|
||
node_modules/ |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,23 @@ | ||
const { SlashCommandBuilder } = require('discord.js'); | ||
module.exports = { | ||
name: 'kill', | ||
data: new SlashCommandBuilder() | ||
.setName('kill') | ||
.setDescription('kills the mentioned member') | ||
.addUserOption(option => | ||
option.setName('target') | ||
.setDescription('mention a user to kill.') | ||
.setRequired(true) | ||
), | ||
|
||
async execute(client, interaction, Discord) { | ||
const weapons = ['AK47', 'M24', 'Chopper', 'knife', 'sword', 'hammer', 'crusher', 'ball', 'punch', 'joke', 'cringe face'] | ||
const randomIndex = Math.floor(Math.random() * weapons.length); | ||
const user = interaction.options.getUser('target'); | ||
const embedmsg = new Discord.MessageEmbed() | ||
.setTitle("**Killed**") | ||
.setDescription(`You killed ${user} with a ${weapons[randomIndex]}.`) | ||
.setColor('#fc03fc') | ||
interaction.reply({ embeds: [embedmsg] }); | ||
} | ||
} |
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,106 @@ | ||
const { SlashCommandBuilder } = require('discord.js'); | ||
const mongo = require('../schemas/mongo') | ||
const giftSchema = require('../schemas/giftSchema') | ||
module.exports = { | ||
name: 'gift', | ||
data: new SlashCommandBuilder() | ||
.setName('gift') | ||
.setDescription('Sends a gift to a user!') | ||
.addUserOption(option => | ||
option.setName('target') | ||
.setDescription('The user to send the gift') | ||
.setRequired(true) | ||
) | ||
.addStringOption(option => | ||
option.setName('gifts') | ||
.setDescription('The gift you want to send') | ||
.setRequired(true) | ||
.addChoices( | ||
{ name: 'Cake', value: 'cake' }, | ||
{ name: 'ToyCar', value: 'toyCar' }, | ||
{ name: 'ChessBoard', value: 'chessBoard' }, | ||
{ name: 'ToyTrain', value: 'toyTrain' }, | ||
{ name: 'Vibe check', value: 'vibeCheck' }, | ||
{ name: 'PS-4', value: 'PS4' } | ||
) | ||
), | ||
|
||
async execute(client, interaction, Discord) { | ||
await interaction.deferReply(); | ||
const rateMap = new Map() | ||
rateMap.set('cake', 23) | ||
rateMap.set('toyCar', 50) | ||
rateMap.set('toyTrain', 84) | ||
rateMap.set('chessBoard', 56) | ||
rateMap.set('vibeCheck', 86) | ||
rateMap.set('PS4', 97) | ||
const target = interaction.options.getUser('target') | ||
const gift = interaction.options.getString('gifts') | ||
const userID = interaction.user.id | ||
const colors = ['#ff9645', '#ffeb6b', '#e6ff6b', '#baff6b', '#6bff95', '#6bffc4', '#6bfffd', '#6bd0ff', '#6b9cff', '#726bff', '#936bff', '#ae6bff', '#ce6bff', '#e96bff', '#ff6bee', '#ff3bc4', '#ff2495', '#ff2469'] | ||
const randomIndex = Math.floor(Math.random() * colors.length); | ||
|
||
const giftRate = rateMap.get(gift) | ||
let totalPoints = { | ||
total: parseInt('0', 10), | ||
totalGifts: parseInt('0', 10) | ||
} | ||
await mongo().then(async mongoose => { | ||
|
||
try { | ||
const giftsPoints = await giftSchema.findOne({ userID }) | ||
if (giftsPoints !== null) { | ||
|
||
|
||
const { total, totalGifts } = giftsPoints.gifts[0] | ||
if (total <= giftRate) { | ||
return interaction.editReply('You didnt have enough coins to buy and send this item.') | ||
} | ||
const tot = total - giftRate | ||
let totalGiftsSent = totalGifts + 1 | ||
await mongo().then(async mongoose => { | ||
try { | ||
await giftSchema.findOneAndUpdate({ | ||
userID | ||
}, { | ||
userID, | ||
$pull: { | ||
gifts: giftsPoints.gifts[0] | ||
} | ||
}) | ||
} finally { | ||
mongoose.connection.close() | ||
} | ||
}) | ||
|
||
totalPoints = { total: tot, totalGifts: totalGiftsSent } | ||
} else { | ||
return interaction.editReply('You didn\'t have enough coins use ``!collect`` (yes its not a slash command) command to collect some coins.') | ||
} | ||
await mongo().then(async mongoose => { | ||
try { | ||
await giftSchema.findOneAndUpdate({ | ||
userID | ||
}, { | ||
userID, | ||
$push: { | ||
gifts: totalPoints | ||
} | ||
}, { | ||
upsert: true | ||
}) | ||
} finally { | ||
mongoose.connection.close() | ||
} | ||
}) | ||
} finally { | ||
mongoose.connection.close() | ||
} | ||
}) | ||
const embed = new Discord.MessageEmbed() | ||
.setTitle('Gift received') | ||
.setColor(`${colors[randomIndex]}`) | ||
.setDescription(`<@${userID}> has send you a ${gift} which is ${giftRate}CCs(chistmas coins).`) | ||
await interaction.editReply({ content: `<@${target.id}>`, embeds: [embed] }); | ||
} | ||
} |
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,12 @@ | ||
module.exports = { | ||
name: 'crypace', | ||
aliases: ['crypace', 'game'], | ||
|
||
execute (client, message, args, Discord){ | ||
const embedMsg = new Discord.EmbedBuilder() | ||
.setTitle('Found an easter egg 😁:') | ||
.setDescription('Crypace is a sci-fi game being developed by some people in Atelier server.\nAnd those people has created dreamspace games.\n') | ||
.setColor('#3d86fc') | ||
message.channel.send({embeds: [embedMsg]}) | ||
} | ||
} |
Oops, something went wrong.