Skip to content

Commit

Permalink
docs: fix lavalink example code
Browse files Browse the repository at this point in the history
  • Loading branch information
NyuwBot committed Jun 30, 2023
1 parent 107b378 commit d03882b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ else if (search.StartsWith("amsearch:"))
}

// This function gives us a result from Lavalink.
LavalinkLoadResult result = await nodeConnection.Rest.GetTracksAsync(search, type);
LavalinkLoadResult result = await guildPlayer.LoadTracksAsync(type, query);

// Internally Lavalink searches the Spotify api, and then searches YouTube for the result.
// We can now use the result and play the song.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
uid: modules_audio_lavalink_v4_commands
title: Lavalink V4 Music Commands
title: Lavalink V4 Commands
author: DisCatSharp Team
hasDiscordComponents: true
---
Expand All @@ -26,8 +26,11 @@ Next up you gotta register the ApplicationCommands module:

```cs
ApplicationCommands = Discord.UseApplicationCommands();

ApplicationCommands.RegisterGlobalCommands<MyLavalinkCommands>();
// Either as a global command
ApplicationCommands.RegisterGlobalCommands<MyFirstLavalinkCommands>();
// Or as a guild command
ulong myGuildId = 858089281214087179;
ApplicationCommands.RegisterGuildCommands<MyFirstLavalinkCommands>(myGuildId);
```

## Adding base commands
Expand Down

0 comments on commit d03882b

Please sign in to comment.