Created
July 27, 2021 01:33
-
-
Save DarrenOfficial/569a760ba3da082cc3520084b0a9c35e to your computer and use it in GitHub Desktop.
DiscordJS Poker
This file contains hidden or 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
const { MessageEmbed } = require("discord.js"); | |
module.exports = { | |
name: "poker", | |
description: "start the gambling game baby! Discord Poker Night.", | |
usage: "", | |
permissions: { | |
channel: ["VIEW_CHANNEL", "SEND_MESSAGES", "EMBED_LINKS"], | |
member: [], | |
}, | |
aliases: ["discordpoker", "gamble"], | |
/** | |
* | |
* @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("755827207812677713")//Made using discordjs-activity package | |
let embed = new MessageEmbed() | |
.setAuthor("Poker Night", "https://cdn.discordapp.com/attachments/824153602418278420/869391392458309692/839989105785307167.png") | |
.setColor("#FF0000") | |
.setDescription(` | |
Using **Poker Night** you can play Poker with your friends (*friends are not included.*) in a Voice Channel. Click *Join The Gambling session* to join in! | |
__**[Join The Gambling session, with Da boys! or girls.](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("755827207812677713")//Made using discordjs-activity package | |
let embed = new MessageEmbed() | |
.setAuthor("Poker Night", "https://cdn.discordapp.com/attachments/824153602418278420/869391392458309692/839989105785307167.png") | |
.setColor("#FF0000") | |
.setDescription(` | |
Using **Poker Night** you can play Poker with your friends (*friends are not included.*) in a Voice Channel. Click *Join The Gambling session* to join in! | |
__**[Join The Gambling session, with Da boys! or girls.](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