Skip to content

Commit

Permalink
Merge pull request #57 from Mightypotatoast/master
Browse files Browse the repository at this point in the history
random things
  • Loading branch information
Ayrox authored Nov 11, 2021
2 parents f0e9f86 + 903bb12 commit 37f00f6
Show file tree
Hide file tree
Showing 7 changed files with 136 additions and 9 deletions.
28 changes: 28 additions & 0 deletions src/Commands/Fun/pileouface.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
const { joinVoiceChannel } = require('@discordjs/voice');
const { MessageEmbed } = require('discord.js');
module.exports = {

name: "coinflip",
description: "Flip a coin",
permission: "ADMINISTRATOR",
active : true,

async execute(message) {


try{
let coin = Math.floor(Math.random() * 2)

const coinEmbed = new MessageEmbed()
.setColor('#E1A741')
.setAuthor("Flip a coin", "https://www.pngall.com/wp-content/uploads/4/Dollar-Gold-Coin-PNG.png")
.setDescription(`${message.user} flipped a coin and got a ${coin === 0 ? "Pile" : "Face"}`)
.setTimestamp()

message.reply({embeds: [coinEmbed]})
} catch (error) {
console.log(error)
message.reply({ embeds: [errorEmbed().setDescription(`${error}`)], ephemeral: true })
}
}
}
35 changes: 35 additions & 0 deletions src/Commands/Fun/roll.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
const { joinVoiceChannel } = require('@discordjs/voice');
const { MessageEmbed } = require('discord.js');
module.exports = {

name: "roll",
description: "roll a dice",
permission: "ADMINISTRATOR",
active : true,

options: [
{
name: "dice",
description: `Max number of you dice`,
type: "STRING",
required: false,
}
],
async execute(message) {

try{
let dice = message.options.getString('dice')
if (dice==null) dice = "100";
const roll = Math.floor(Math.random() * dice) + 1
const embed = new MessageEmbed()
.setColor("#FF0000")
.setAuthor("Roll your dice", "https://upload.wikimedia.org/wikipedia/commons/5/53/Six_sided_dice.png")
.setDescription(`${message.user} rolled a ${roll} (0-${dice})`)

message.reply({embeds: [embed]})
} catch (error) {
console.log(error)
message.reply({ embeds: [errorEmbed().setDescription(`${error}`)], ephemeral: true })
}
}
}
24 changes: 24 additions & 0 deletions src/Commands/Fun/shrex.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
const { errorEmbed, musicEmbed} = require("../../util/Embeds")



function codeblock(code) {
return `\`\`\`${code}\`\`\``;
}


module.exports = {

name: "shrex",
description: "Display Shrex in chat",
permission: "ADMINISTRATOR",
active: true,

async execute(message, client) {
try{
message.reply(codeblock("⣿⣿⣿⣿⠋⢩⢹⣿⣿⣿⣿⣽⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿\n⣿⣿⣿⡧⣦⠄⢧⡙⢿⣟⢁⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠟⢿\n⣿⣿⣿⣷⣶⣶⣦⡈⠂⠄⠸⠿⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠉⠰⢠⣼\n⣿⣿⣿⣿⣿⣿⣿⣿⠄⠄⠄⢒⣂⠄⠙⢿⣿⣿⡿⠛⢛⣻⣿⣿⡟⢁⣠⣴⣶⣶\n⣿⣿⣿⣿⣿⣿⣿⠇⢇⡄⣆⣤⣀⣦⡄⢈⣉⣛⣭⡀⠙⠭⡛⠿⣿⣻⣿⣿⣿⣿\n⣿⣿⣿⣿⣿⣿⣿⠄⠄⣿⣿⣿⣿⣿⢃⣿⣿⣿⣿⣿⣶⣷⡾⣼⣿⠈⠉⠄⠄⠈\n⣿⣿⣿⣿⣿⣿⡇⠄⠄⢿⣿⣿⣿⣥⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣄⠄⠄⠄⠄\n⣿⣿⣿⣿⡿⠋⠄⠄⠄⢸⣿⡿⠿⠄⠈⠛⢟⣿⣿⣿⣿⣿⣿⣿⣿⣿⣆⠄⠄⠄\n⣿⣿⣿⠟⠁⠄⠄⠄⠄⠄⢠⣄⣀⡲⢦⣤⣼⣿⡿⣿⣿⣿⣿⣿⣿⣿⣿⡀⠄⠄\n⠛⠋⠄⠄⠄⠄⠄⠄⠄⠄⠈⢿⣟⠻⠿⣿⣿⣿⣷⣾⣿⣿⣿⣿⢿⣿⣿⡇⠄⠄\n⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠈⠻⣷⣶⣾⣿⣿⣿⣿⣿⣿⠟⢡⣿⣿⣿⡟⠄⠄\n⣦⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⣉⣹⣿⣿⣿⣿⠟⠁⣰⣿⣿⣿⣿⡇⠄⠄\n⣿⣧⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠈⠉⠉⠙⠛⠉⠁⢀⣼⣿⣿⣿⣿⡟⠄⠄⠄"))
} catch (e) {
message.reply({ embeds: [errorEmbed().setDescription(`${e}`)], ephemeral: true })
}
}
}
36 changes: 33 additions & 3 deletions src/Commands/music/nowplaying.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,33 @@
const { errorEmbed, musicEmbed} = require("../../util/Embeds")
const { musicButtonRow } = require("../../util/buttonLayout")



function generateProgressBar(currentTime, duration) {

//make a ASCII progress bar |------🔴--------|
let progressBar = "|"
let progressBarLength = 25
let progressBarMax = duration
let progressBarCurrent = currentTime
let progressBarPercent = (progressBarCurrent / progressBarMax) * 100
let progressBarPercentRounded = Math.round(progressBarPercent/(100/progressBarLength))
for (let i = 0; i < progressBarLength; i++) {
if (i < progressBarPercentRounded) {
progressBar = progressBar.concat("─")
} else if (i == progressBarPercentRounded) {
progressBar = progressBar.concat("🔹")
} else {
progressBar = progressBar.concat("─")
}
}
progressBar = progressBar.concat("|")
return progressBar

}



module.exports = {

name: "nowplaying",
Expand All @@ -19,12 +46,15 @@ module.exports = {

try {
let playingSong = queue.songs[0]
console.log(playingSong.uploader.name);
message.reply({ embeds: [musicEmbed()




await message.reply({ embeds: [musicEmbed()
.setTitle(`Playing ${playingSong.name}`)
.setURL(`${playingSong.url}`)
.setThumbnail(`${playingSong.thumbnail}`)
.setDescription(`${queue.formattedCurrentTime} **|-----------------------------|** ${playingSong.formattedDuration}`)
.setDescription(`${queue.formattedCurrentTime} **${generateProgressBar(queue.currentTime, playingSong.duration )}** ${playingSong.formattedDuration}`)
.addField(`Requester`, `${playingSong.member}`, true)
.addField(`Author`, `[${playingSong.uploader.name}](${playingSong.uploader.url})`, true)
.addField(`Volume`, `${queue.volume}%`, true)
Expand Down
11 changes: 9 additions & 2 deletions src/Commands/music/play.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const { Message} = require('discord.js')
const { joinVoiceChannel } = require('@discordjs/voice');
const { errorEmbed, musicEmbed} = require("../../util/Embeds")
const { musicButtonRow } = require("../../util/buttonLayout")
module.exports = {
Expand Down Expand Up @@ -32,6 +33,14 @@ module.exports = {
.setDescription("⏳ Searching ...")
]
})

var channel = message.member.voice.channel;
await joinVoiceChannel({
channelId: channel.id,
guildId: message.guild.id,
adapterCreator: message.guild.voiceAdapterCreator
})

if (music.startsWith('http')) {
try{
await client.distube.playVoiceChannel(channel, music, {options: message.user})
Expand All @@ -44,8 +53,6 @@ module.exports = {
message.editReply({ embeds: [errorEmbed().setDescription(`${e}`)], ephemeral: true })
}



} else {
try {
YTBsearch = await client.distube.search(music)
Expand Down
8 changes: 5 additions & 3 deletions src/Events/guild/guildMemberAdd.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,12 @@ module.exports = {
.setColor(0x00ff00)
.setDescription(`Bonjour ${member} et bienvenue sur le serveur **${member.guild.name}**. Nous sommes maintenant **${member.guild.memberCount}** sur ce serveur.`)
.setImage("attachment://welcome-image.png")

member.guild.channels.cache.get(config.channel.bienvenueID).send({ embeds : [Addembed], files: [CanvasAttachment] });


try {

member.guild.channels.cache.get(config.channel.bienvenueID).send({ embeds : [Addembed], files: [CanvasAttachment] });



var rol = member.guild.roles.cache.find(role => role.name === "Les Louveteaux");
member.roles.add(rol);
Expand Down
3 changes: 2 additions & 1 deletion src/util/Embeds.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ module.exports = {
return new MessageEmbed()
.setColor("#FF0000")
.setTitle("⛔ **Error**: ⛔")
.setTimestamp()

},

Expand All @@ -16,7 +17,7 @@ module.exports = {
return new MessageEmbed()
.setColor("#7F00FF")
.setAuthor("Spotifion", "https://www.iconsdb.com/icons/preview/violet/spotify-xxl.png")

.setTimestamp()
},
//!---------------------- POKEMON -------------------------------
pokemonEmbed: () => {
Expand Down

0 comments on commit 37f00f6

Please sign in to comment.