Skip to content

Commit 861b484

Browse files
authored
update missions section
1 parent 327588c commit 861b484

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,8 @@ client.UpdateUserProfileCountry("BY"); // Set country by ISO code
250250
client.UpdateUserProfileFavouriteArtists(new List<int>() { client.ArtistSearch("Camellia").First().ArtistId }); // Set favourite artists
251251
client.UpdateUserProfileFavouriteGenres(new List<int>() { client.GetMusicGenres().Where(genre => genre.MusicGenreName.ToLower() == "hardcore").First().MusicGenreId }); // Set favourite genres
252252
```
253+
### Missions
254+
The cool stuff is, now the library supports [musixmatch missions](https://curators.musixmatch.com). The implementation is pretty raw tho, so feel free to contact me and give feedback via issues page or directly either via [Discord](https://discordapp.com/users/394601924881809408) or [Telegram](https://t.me/eimaen). Here are some quick examples on how to use the API:
253255

254256
**Get mission tracks:**
255257
```C#
@@ -259,6 +261,17 @@ Mission mission = missionList.Find(m => m.Title == "The Jukebox");
259261
foreach (var track in missions.GetMissionTracks(mission.Id, "en", "en"))
260262
Console.WriteLine($"{track.Artist} - {track.Title}");
261263
```
264+
This prints out the entire mission list to your console window.
265+
266+
**Reserve a mission task:**
267+
```C#
268+
// Imagine spamming this one :clown:
269+
MissionManager missions = client.RequestMissionManager();
270+
List<Mission> missionList = missions.GetMissions();
271+
Mission mission = missionList.Find(m => m.Title == "The Jukebox");
272+
MissionTrack missionTrack = missions.GetMissionTracks(mission.Id, "en", "en").Find(t => t.Artist == "Cepheid" && t.Title == "Catch Wind");
273+
missions.ReserveTask(mission.Id, missionTrack.Id); // this reserves a Catch Wind task (it doesn't exist, example), so it appears on your "In Progress" list
274+
```
262275

263276
### Exception handling
264277
Currently this library supports only `MusixmatchRequestException`. It has a `StatusCode` property to understand the problem better.

0 commit comments

Comments
 (0)