mirror of
https://github.com/darksaid98/cadence-discord-bot.git
synced 2026-12-04 14:38:49 +00:00
Merge pull request #41 from mariusbegby/make-commands-inaccessible-from-direct-messages
Make commands inaccessible from direct messages
This commit is contained in:
13 files changed
+21
-7
No files matched your search
+2
-1
@@ -16,7 +16,8 @@ const {
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
data: new SlashCommandBuilder()
|
data: new SlashCommandBuilder()
|
||||||
.setName('filters')
|
.setName('filters')
|
||||||
.setDescription('Toggle various audio filters during playback.'),
|
.setDescription('Toggle various audio filters during playback.')
|
||||||
|
.setDMPermission(false),
|
||||||
run: async ({ interaction }) => {
|
run: async ({ interaction }) => {
|
||||||
if (!interaction.member.voice.channel) {
|
if (!interaction.member.voice.channel) {
|
||||||
return await interaction.editReply({
|
return await interaction.editReply({
|
||||||
|
|||||||
+2
-1
@@ -5,7 +5,8 @@ const { embedColors } = require('../config.json');
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
data: new SlashCommandBuilder()
|
data: new SlashCommandBuilder()
|
||||||
.setName('help')
|
.setName('help')
|
||||||
.setDescription('Show a list of commands and their usage.'),
|
.setDescription('Show a list of commands and their usage.')
|
||||||
|
.setDMPermission(false),
|
||||||
run: async ({ interaction }) => {
|
run: async ({ interaction }) => {
|
||||||
return await interaction.editReply({
|
return await interaction.editReply({
|
||||||
embeds: [
|
embeds: [
|
||||||
|
|||||||
+2
-1
@@ -8,7 +8,8 @@ module.exports = {
|
|||||||
.setName('leave')
|
.setName('leave')
|
||||||
.setDescription(
|
.setDescription(
|
||||||
'Clear the track queue and remove the bot from voice channel.'
|
'Clear the track queue and remove the bot from voice channel.'
|
||||||
),
|
)
|
||||||
|
.setDMPermission(false),
|
||||||
|
|
||||||
// todo, allow command to be executed if bot is only member in voice channel
|
// todo, allow command to be executed if bot is only member in voice channel
|
||||||
run: async ({ interaction }) => {
|
run: async ({ interaction }) => {
|
||||||
|
|||||||
@@ -6,7 +6,8 @@ const { embedColors, progressBarOptions } = require('../config.json');
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
data: new SlashCommandBuilder()
|
data: new SlashCommandBuilder()
|
||||||
.setName('nowplaying')
|
.setName('nowplaying')
|
||||||
.setDescription('Show information about the track currently playing.'),
|
.setDescription('Show information about the track currently playing.')
|
||||||
|
.setDMPermission(false),
|
||||||
run: async ({ interaction }) => {
|
run: async ({ interaction }) => {
|
||||||
if (!interaction.member.voice.channel) {
|
if (!interaction.member.voice.channel) {
|
||||||
return await interaction.editReply({
|
return await interaction.editReply({
|
||||||
|
|||||||
+2
-1
@@ -6,7 +6,8 @@ const { embedColors } = require('../config.json');
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
data: new SlashCommandBuilder()
|
data: new SlashCommandBuilder()
|
||||||
.setName('pause')
|
.setName('pause')
|
||||||
.setDescription('Pause or resume the current track.'),
|
.setDescription('Pause or resume the current track.')
|
||||||
|
.setDMPermission(false),
|
||||||
run: async ({ interaction }) => {
|
run: async ({ interaction }) => {
|
||||||
if (!interaction.member.voice.channel) {
|
if (!interaction.member.voice.channel) {
|
||||||
return await interaction.editReply({
|
return await interaction.editReply({
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ module.exports = {
|
|||||||
.setDescription(
|
.setDescription(
|
||||||
'Add a track or playlist to the queue by searching or url.'
|
'Add a track or playlist to the queue by searching or url.'
|
||||||
)
|
)
|
||||||
|
.setDMPermission(false)
|
||||||
.addStringOption((option) =>
|
.addStringOption((option) =>
|
||||||
option
|
option
|
||||||
.setName('query')
|
.setName('query')
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ module.exports = {
|
|||||||
data: new SlashCommandBuilder()
|
data: new SlashCommandBuilder()
|
||||||
.setName('queue')
|
.setName('queue')
|
||||||
.setDescription('Show the list of tracks added to the queue.')
|
.setDescription('Show the list of tracks added to the queue.')
|
||||||
|
.setDMPermission(false)
|
||||||
.addNumberOption((option) =>
|
.addNumberOption((option) =>
|
||||||
option
|
option
|
||||||
.setName('page')
|
.setName('page')
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ module.exports = {
|
|||||||
data: new SlashCommandBuilder()
|
data: new SlashCommandBuilder()
|
||||||
.setName('remove')
|
.setName('remove')
|
||||||
.setDescription('Remove a specific track from the queue.')
|
.setDescription('Remove a specific track from the queue.')
|
||||||
|
.setDMPermission(false)
|
||||||
.addNumberOption((option) =>
|
.addNumberOption((option) =>
|
||||||
option
|
option
|
||||||
.setName('tracknumber')
|
.setName('tracknumber')
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ module.exports = {
|
|||||||
data: new SlashCommandBuilder()
|
data: new SlashCommandBuilder()
|
||||||
.setName('skip')
|
.setName('skip')
|
||||||
.setDescription('Skip the current track.')
|
.setDescription('Skip the current track.')
|
||||||
|
.setDMPermission(false)
|
||||||
.addNumberOption((option) =>
|
.addNumberOption((option) =>
|
||||||
option
|
option
|
||||||
.setName('tracknumber')
|
.setName('tracknumber')
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ module.exports = {
|
|||||||
data: new SlashCommandBuilder()
|
data: new SlashCommandBuilder()
|
||||||
.setName('volume')
|
.setName('volume')
|
||||||
.setDescription('Show or set the playback volume for tracks.')
|
.setDescription('Show or set the playback volume for tracks.')
|
||||||
|
.setDMPermission(false)
|
||||||
.addNumberOption((option) =>
|
.addNumberOption((option) =>
|
||||||
option
|
option
|
||||||
.setName('percentage')
|
.setName('percentage')
|
||||||
|
|||||||
@@ -20,7 +20,9 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "echo \"Error: no test specified\" && exit 1",
|
"test": "echo \"Error: no test specified\" && exit 1",
|
||||||
"start": "node ./index.js",
|
"start": "node ./index.js",
|
||||||
|
"start-pretty": "node ./index.js | pino-pretty",
|
||||||
"deploy": "node ./deploy-commands.js && node ./deploy-system-commands.js",
|
"deploy": "node ./deploy-commands.js && node ./deploy-system-commands.js",
|
||||||
|
"deploy-pretty": "node ./deploy-commands.js | pino-pretty && node ./deploy-system-commands.js | pino-pretty",
|
||||||
"eslint": "eslint ./"
|
"eslint": "eslint ./"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@@ -5,7 +5,8 @@ const { embedColors, systemServerGuildIds } = require('../config.json');
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
data: new SlashCommandBuilder()
|
data: new SlashCommandBuilder()
|
||||||
.setName('guilds')
|
.setName('guilds')
|
||||||
.setDescription('Show list of guilds where bot is added.'),
|
.setDescription('Show list of guilds where bot is added.')
|
||||||
|
.setDMPermission(false),
|
||||||
run: async ({ interaction, client }) => {
|
run: async ({ interaction, client }) => {
|
||||||
if (!systemServerGuildIds.includes(interaction.guildId)) {
|
if (!systemServerGuildIds.includes(interaction.guildId)) {
|
||||||
return await interaction.editReply({
|
return await interaction.editReply({
|
||||||
|
|||||||
@@ -8,7 +8,8 @@ const packageJson = require('../package.json');
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
data: new SlashCommandBuilder()
|
data: new SlashCommandBuilder()
|
||||||
.setName('status')
|
.setName('status')
|
||||||
.setDescription('Show bot status.'),
|
.setDescription('Show bot status.')
|
||||||
|
.setDMPermission(false),
|
||||||
run: async ({ interaction, client }) => {
|
run: async ({ interaction, client }) => {
|
||||||
if (!systemServerGuildIds.includes(interaction.guildId)) {
|
if (!systemServerGuildIds.includes(interaction.guildId)) {
|
||||||
return await interaction.editReply({
|
return await interaction.editReply({
|
||||||
|
|||||||
Reference in new issue
Block a user