Skip to content

Instantly share code, notes, and snippets.

@DarrenOfficial
Created July 29, 2021 13:43
Show Gist options
  • Save DarrenOfficial/9c6de572060e95f8b91170e816b6cfa3 to your computer and use it in GitHub Desktop.
Save DarrenOfficial/9c6de572060e95f8b91170e816b6cfa3 to your computer and use it in GitHub Desktop.
chess.js
const { MessageEmbed } = require("discord.js");
module.exports = {
name: "chess",
description: "Play chess with your friends! or bots.",
usage: "",
permissions: {
channel: ["VIEW_CHANNEL", "SEND_MESSAGES", "EMBED_LINKS"],
member: [],
},
aliases: ["chessbubz", "darrendevgonnalosethis"],
/**
*
* @param {import("../structures/DiscordMusicBot")} client
* @param {require("discord.js").Message} message
* @param {string[]} args
* @param {*} param3
*/
run: async (client, message, args, { GuildDB }) => {
if (!message.member.voice.channel) return client.sendTime(message.channel, "❌ | **You must be in a voice channel to play something!**");
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**");
let Invite = await message.member.voice.channel.activityInvite("832012774040141894")//Made using discordjs-activity package
let embed = new MessageEmbed()
.setAuthor("Chess", "https://discord.com/assets/22bbea32f8826e963038329aee825bc1.svg")
.setColor("#56D950")
.setDescription(`
Play **chess** with your friends or girlfriend! (*friend and/or girlfriend is not included*) Click the ***Play Chess*** To join in!
__**[Play Chess](https://discord.com/invite/${Invite.code})**__
⚠ **Note:** This only works in Desktop
`)
message.channel.send(embed)
},
SlashCommand: {
options: [
],
/**
*
* @param {import("../structures/DiscordMusicBot")} client
* @param {import("discord.js").Message} message
* @param {string[]} args
* @param {*} param3
*/
run: async (client, interaction, args, { GuildDB }) => {
const guild = client.guilds.cache.get(interaction.guild_id);
const member = guild.members.cache.get(interaction.member.user.id);
if (!member.voice.channel) return client.sendTime(interaction, "❌ | You must be in a voice channel to use this command.");
if(!member.voice.channel.permissionsFor(guild.me).has("CREATE_INSTANT_INVITE"))return client.sendTime(interaction, "❌ | **Bot doesn't have Create Invite Permission**");
let Invite = await member.voice.channel.activityInvite("832012774040141894")//Made using discordjs-activity package
let embed = new MessageEmbed()
.setAuthor("Chess", "https://discord.com/assets/22bbea32f8826e963038329aee825bc1.svg")
.setColor("#56D950")
.setDescription(`
Play **chess** with your friends or girlfriend! (*friend and/or girlfriend is not included*) Click the ***Play Chess*** To join in!
__**[Play Chess](https://discord.com/invite/${Invite.code})**__
⚠ **Note:** This only works in Desktop
`)
interaction.send(embed.toJSON())
},
},
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment