From 0d06e9aa2569d39c3ed1fa8f5e22f1d83f84ce35 Mon Sep 17 00:00:00 2001 From: Loukious Date: Sun, 20 Aug 2023 13:43:43 +0100 Subject: [PATCH 1/4] Text to emojis + an option to select activity type --- src/config.ts | 1 + src/events/client/Ready.ts | 3 +-- src/events/player/TrackStart.ts | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/config.ts b/src/config.ts index cfc85f6ef..a809a104d 100644 --- a/src/config.ts +++ b/src/config.ts @@ -16,6 +16,7 @@ export default { maxPlaylistSize: parseInt(process.env.MAX_PLAYLIST_SIZE) || 100, botStatus: process.env.BOT_STATUS || 'online', // online, idle, dnd, invisible botActivity: process.env.BOT_ACTIVITY || 'Lavamusic', // set the bot activity + botActivityType: parseInt(process.env.BOT_ACTIVITY_TYPE || '0'), // 0..5 https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-types maxQueueSize: parseInt(process.env.MAX_QUEUE_SIZE) || 100, owners: process.env.OWNERS?.split(','), database: process.env.DATABASE_URL, diff --git a/src/events/client/Ready.ts b/src/events/client/Ready.ts index 38198310f..1b8674a70 100644 --- a/src/events/client/Ready.ts +++ b/src/events/client/Ready.ts @@ -1,6 +1,5 @@ import config from '../../config.js'; import { Event, Lavamusic } from '../../structures/index.js'; -import { ActivityType } from 'discord.js'; export default class Ready extends Event { constructor(client: Lavamusic, file: string) { super(client, file, { @@ -14,7 +13,7 @@ export default class Ready extends Event { activities: [ { name: config.botActivity, - type: ActivityType.Listening, + type: config.botActivityType, }, ], status: config.botStatus as any, diff --git a/src/events/player/TrackStart.ts b/src/events/player/TrackStart.ts index 03a2abf27..5ebcb11dd 100644 --- a/src/events/player/TrackStart.ts +++ b/src/events/player/TrackStart.ts @@ -19,16 +19,16 @@ export default class TrackStart extends Event { function buttonBuilder() { const previousButton = new ButtonBuilder() .setCustomId('previous') - .setLabel(`Previous`) + .setEmoji('⏪') .setStyle(ButtonStyle.Secondary) .setDisabled(dispatcher.previous ? false : true); const resumeButton = new ButtonBuilder() .setCustomId('resume') - .setLabel(player.paused ? `Resume` : `Pause`) + .setEmoji(player.paused ? '▶️' : '⏸️') .setStyle(player.paused ? ButtonStyle.Success : ButtonStyle.Secondary); - const stopButton = new ButtonBuilder().setCustomId('stop').setLabel(`Stop`).setStyle(ButtonStyle.Danger); - const skipButton = new ButtonBuilder().setCustomId('skip').setLabel(`Skip`).setStyle(ButtonStyle.Secondary); - const loopButton = new ButtonBuilder().setCustomId('loop').setLabel(`Loop`).setStyle(ButtonStyle.Secondary); + const stopButton = new ButtonBuilder().setCustomId('stop').setEmoji('⏹️').setStyle(ButtonStyle.Danger); + const skipButton = new ButtonBuilder().setCustomId('skip').setEmoji('⏩').setStyle(ButtonStyle.Secondary); + const loopButton = new ButtonBuilder().setCustomId('loop').setEmoji('🔁').setStyle(ButtonStyle.Secondary); return new ActionRowBuilder().addComponents( previousButton, From 288bb60b7edbcfdc126d6f13b79722cf7a9b7d15 Mon Sep 17 00:00:00 2001 From: Loukious Date: Sun, 20 Aug 2023 14:00:32 +0100 Subject: [PATCH 2/4] Updated README --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index f3c7956ba..fd552a030 100644 --- a/README.md +++ b/README.md @@ -150,6 +150,7 @@ LAVALINK_URL="lava.moebot.xyz:443" # Your lavalink url LAVALINK_AUTH="youshallnotpass" # Your lavalink password LAVALINK_NAME="Blacky" # Your lavalink name LAVALINK_SECURE= "true" # true for secure lavalink +BOT_ACTIVITY_TYPE=0 # Activity type is a number from 0 to 5 see more here https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-types ``` From 1f7419d55caafd96e735a37ace5d86c53562e490 Mon Sep 17 00:00:00 2001 From: Loukious Date: Sun, 20 Aug 2023 14:15:25 +0100 Subject: [PATCH 3/4] Made the repeat button more representative --- src/events/player/TrackStart.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/events/player/TrackStart.ts b/src/events/player/TrackStart.ts index 5ebcb11dd..0051b1dab 100644 --- a/src/events/player/TrackStart.ts +++ b/src/events/player/TrackStart.ts @@ -28,7 +28,10 @@ export default class TrackStart extends Event { .setStyle(player.paused ? ButtonStyle.Success : ButtonStyle.Secondary); const stopButton = new ButtonBuilder().setCustomId('stop').setEmoji('⏹️').setStyle(ButtonStyle.Danger); const skipButton = new ButtonBuilder().setCustomId('skip').setEmoji('⏩').setStyle(ButtonStyle.Secondary); - const loopButton = new ButtonBuilder().setCustomId('loop').setEmoji('🔁').setStyle(ButtonStyle.Secondary); + const loopButton = new ButtonBuilder() + .setCustomId('loop') + .setEmoji(dispatcher.loop === 'repeat' ? '🔂' : '🔁') + .setStyle(dispatcher.loop !== 'off' ? ButtonStyle.Success : ButtonStyle.Secondary); return new ActionRowBuilder().addComponents( previousButton, From 4753d6c62cce6711d3db92eaaee4894fe93c40f1 Mon Sep 17 00:00:00 2001 From: Blacky <77108939+brblacky@users.noreply.github.com> Date: Sun, 20 Aug 2023 20:08:58 +0530 Subject: [PATCH 4/4] Update config.ts Signed-off-by: Blacky <77108939+brblacky@users.noreply.github.com> --- src/config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/config.ts b/src/config.ts index a809a104d..76f11c990 100644 --- a/src/config.ts +++ b/src/config.ts @@ -16,7 +16,7 @@ export default { maxPlaylistSize: parseInt(process.env.MAX_PLAYLIST_SIZE) || 100, botStatus: process.env.BOT_STATUS || 'online', // online, idle, dnd, invisible botActivity: process.env.BOT_ACTIVITY || 'Lavamusic', // set the bot activity - botActivityType: parseInt(process.env.BOT_ACTIVITY_TYPE || '0'), // 0..5 https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-types + botActivityType: parseInt(process.env.BOT_ACTIVITY_TYPE || '2'), // 0 to 5 get more info - https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-types maxQueueSize: parseInt(process.env.MAX_QUEUE_SIZE) || 100, owners: process.env.OWNERS?.split(','), database: process.env.DATABASE_URL,