Removed music/assignrank

This commit is contained in:
Loic Bersier 2018-09-18 20:27:49 +02:00
parent 197478b90f
commit d6db248004
4 changed files with 2 additions and 82 deletions

1
.gitignore vendored
View file

@ -4,3 +4,4 @@ package.json
.DS_Store .DS_Store
node_modules node_modules
node_modules\ node_modules\
.vscode

View file

@ -1,36 +0,0 @@
const { Command } = require('discord.js-commando');
module.exports = class AssignRankCommand extends Command {
constructor(client) {
super(client, {
name: 'assignrank',
group: 'admin',
memberName: 'assignrank',
description: 'Assign a rank to the mentionned user',
clientPermissions: ['MANAGE_ROLES'],
userPermissions: ['MANAGE_ROLES'],
guildOnly: true,
args: [
{
key: 'member',
prompt: 'Wich member should get the rank',
type: 'member',
},
{
key: 'rank',
prompt: 'Wich rank to give to the user?',
type: 'string',
}
]
});
}
async run(message, { rank, member }) {
const role = message.guild.roles.find('name', rank);
member = message.mentions.members.first();
if (!role) {
message.say("The rank you tried to assign dosent exist ( or bot have a lower rank than the one you tried to assign");
} else
member.addRole(role);
message.say(`You successfully gived the rank **${rank}** to **${member}**`);
}
};

View file

@ -1,44 +0,0 @@
const { Command } = require('discord.js-commando');
const ytdl = require('ytdl-core');
module.exports = class MusicCommand extends Command {
constructor(client) {
super(client, {
name: 'music',
aliases: ['play'],
group: 'fun',
memberName: 'music',
description: 'Play youtube link in vocal',
guildOnly: true,
args: [
{
key: 'ytblink',
prompt: 'Wich Youtube link would you like to play? (default: despacito)\nTo stop the bot just do "haha music stop"',
type: 'string',
default: 'https://www.youtube.com/watch?v=kJQP7kiw5Fk'
}
]
});
}
async run(message, { ytblink, repeat }) {
const { voiceChannel } = message.member;
// If not in voice channel ask user to join
if (!voiceChannel) {
return message.reply('please join a voice channel first!');
} else
// If user say "stop" make the bot leave voice channel
if (ytblink == 'stop') {
voiceChannel.leave()
message.say('I leaved the channel');
} else
voiceChannel.join().then(connection => {
const stream = ytdl(ytblink, { filter: 'audioonly' });
const dispatcher = connection.playStream(stream);
// End at then end of the audio stream
dispatcher.on('end', () => voiceChannel.leave());
message.say('Music ended, Leaved the channel');
});
}
}

View file

@ -1,5 +1,4 @@
const { Command } = require('discord.js-commando'); const { Command } = require('discord.js-commando');
const responseObject = require("../../randVid.json");
module.exports = class sayCommand extends Command { module.exports = class sayCommand extends Command {
constructor(client) { constructor(client) {
super(client, { super(client, {