|
| 1 | +const { MessageEmbed } = require("discord.js"); |
| 2 | + |
| 3 | +module.exports = { |
| 4 | + name: "youtube", |
| 5 | + description: "Starts a YouTube Together session", |
| 6 | + usage: "", |
| 7 | + permissions: { |
| 8 | + channel: ["VIEW_CHANNEL", "SEND_MESSAGES", "EMBED_LINKS"], |
| 9 | + member: [], |
| 10 | + }, |
| 11 | + aliases: ["yt"], |
| 12 | + /** |
| 13 | + * |
| 14 | + * @param {import("../structures/DiscordMusicBot")} client |
| 15 | + * @param {require("discord.js").Message} message |
| 16 | + * @param {string[]} args |
| 17 | + * @param {*} param3 |
| 18 | + */ |
| 19 | + run: async (client, message, args, { GuildDB }) => { |
| 20 | + if (!message.member.voice.channel) return client.sendTime(message.channel, "❌ | **You must be in a voice channel to play something!**"); |
| 21 | + if(!message.member.voice.channel.permissionsFor(message.guild.me).has("CREATE_INSTANT_INVITE"))return client.sendTime(message.channel, "❌ | **Bot doesn't have Create Invite Permission**"); |
| 22 | + |
| 23 | + let Invite = await message.member.voice.channel.activityInvite("755600276941176913")//Made using discordjs-activity package |
| 24 | + let embed = new MessageEmbed() |
| 25 | + .setAuthor("YouTube Together", "https://cdn.discordapp.com/emojis/749289646097432667.png?v=1") |
| 26 | + .setColor("#FF0000") |
| 27 | + .setDescription(` |
| 28 | +Using **YouTube Together** you can watch YouTube with your friends in a Voice Channel. Click *Join YouTube Together* to join in! |
| 29 | +
|
| 30 | +__**[Join YouTube Together](https://discord.com/invite/${Invite.code})**__ |
| 31 | +
|
| 32 | +⚠ **Note:** This only works in Desktop |
| 33 | +`) |
| 34 | + message.channel.send(embed) |
| 35 | + }, |
| 36 | + SlashCommand: { |
| 37 | + options: [ |
| 38 | + ], |
| 39 | + /** |
| 40 | + * |
| 41 | + * @param {import("../structures/DiscordMusicBot")} client |
| 42 | + * @param {import("discord.js").Message} message |
| 43 | + * @param {string[]} args |
| 44 | + * @param {*} param3 |
| 45 | + */ |
| 46 | + run: async (client, interaction, args, { GuildDB }) => { |
| 47 | + const guild = client.guilds.cache.get(interaction.guild_id); |
| 48 | + const member = guild.members.cache.get(interaction.member.user.id); |
| 49 | + |
| 50 | + if (!member.voice.channel) return client.sendTime(interaction, "❌ | You must be in a voice channel to use this command."); |
| 51 | + if(!member.voice.channel.permissionsFor(guild.me).has("CREATE_INSTANT_INVITE"))return client.sendTime(interaction, "❌ | **Bot doesn't have Create Invite Permission**"); |
| 52 | + |
| 53 | + let Invite = await member.voice.channel.activityInvite("755600276941176913")//Made using discordjs-activity package |
| 54 | + let embed = new MessageEmbed() |
| 55 | + .setAuthor("YouTube Together", "https://cdn.discordapp.com/emojis/749289646097432667.png?v=1") |
| 56 | + .setColor("#FF0000") |
| 57 | + .setDescription(` |
| 58 | +Using **YouTube Together** you can watch YouTube with your friends in a Voice Channel. Click *Join YouTube Together* to join in! |
| 59 | +
|
| 60 | +__**[Join YouTube Together](https://discord.com/invite/${Invite.code})**__ |
| 61 | +
|
| 62 | +⚠ **Note:** This only works in Desktop |
| 63 | +`) |
| 64 | + interaction.send(embed.toJSON()) |
| 65 | + }, |
| 66 | + }, |
| 67 | +}; |
0 commit comments