Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed text to emojis and added an option to select activity type #472

Merged
merged 5 commits into from
Aug 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

```

Expand Down
1 change: 1 addition & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 || '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,
Expand Down
3 changes: 1 addition & 2 deletions src/events/client/Ready.ts
Original file line number Diff line number Diff line change
@@ -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, {
Expand All @@ -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,
Expand Down
13 changes: 8 additions & 5 deletions src/events/player/TrackStart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,19 @@ 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(dispatcher.loop === 'repeat' ? '🔂' : '🔁')
.setStyle(dispatcher.loop !== 'off' ? ButtonStyle.Success : ButtonStyle.Secondary);

return new ActionRowBuilder<ButtonBuilder>().addComponents(
previousButton,
Expand Down