Skip to content

implemented all the commands#8

Open
ftrapture wants to merge 5 commits into
lavalink-devs:masterfrom
ftrapture:master
Open

implemented all the commands#8
ftrapture wants to merge 5 commits into
lavalink-devs:masterfrom
ftrapture:master

Conversation

@ftrapture

Copy link
Copy Markdown
Contributor

No description provided.

@topi314

topi314 commented Aug 18, 2025

Copy link
Copy Markdown
Member

you should rebase your master branch.
That's why you should develope on feature branches instead

Comment thread commands/disconnect.go
Comment on lines +15 to +18
player := c.Lavalink.ExistingPlayer(*e.GuildID())
if player != nil {
player.Destroy(ctx)
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the player is automatically destroyed on disconnect

Comment thread commands/forward.go
func (c *Commands) Forward(data discord.SlashCommandInteractionData, e *handler.CommandEvent) error {
ctx, cancel := context.WithTimeout(e.Ctx, 10*time.Second)
defer cancel()
player := c.Lavalink.ExistingPlayer(*e.GuildID())

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

player can be nil

Comment thread commands/forward.go
Comment on lines +15 to +16
ctx, cancel := context.WithTimeout(e.Ctx, 10*time.Second)
defer cancel()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can move this down where you actually use it

Comment thread commands/forward.go
Comment on lines +32 to +37
if nPos == cPos {
return e.CreateMessage(discord.MessageCreate{
Content: "The player is already at position **`" + res.FormatDuration(lavalink.Duration(cPos)) + "`**",
Flags: discord.MessageFlagEphemeral,
})
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just forward anyway tbh

Comment thread commands/join.go
var vcID snowflake.ID

ch, ok := data.OptChannel("channel")
if ok && ch.Type == discord.ChannelTypeGuildVoice {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it could be a stage too

Comment thread commands/rewind.go
"github.com/lavalink-devs/lavalink-bot/internal/res"
)

func (c *Commands) Rewind(data discord.SlashCommandInteractionData, e *handler.CommandEvent) error {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comments as with forward command

Comment thread commands/swap.go
"github.com/disgoorg/disgo/handler"
)

func (c *Commands) SwapAutocomplete(e *handler.AutocompleteEvent) error {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same things as with remove/move

Comment thread handlers/lavalink.go
}
})
if voiceStates <= 1 {
if atomic.LoadInt32(&voiceStates) <= 1 {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what?

Comment thread handlers/lavalink.go
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
if !event.Reason.MayStartNext() {
p.Destroy(ctx)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why? we can stay connected

Comment thread handlers/lavalink.go
}
track, ok := h.MusicQueue.Next(p.GuildID())
if !ok {
p.Destroy(ctx)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why? we can stay connected

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants