Skip to content

Commit

Permalink
- remove languageext
Browse files Browse the repository at this point in the history
  • Loading branch information
Pannoniae committed Dec 8, 2023
1 parent 8e35436 commit 4b30238
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 16 deletions.
18 changes: 9 additions & 9 deletions CommandHandlers/MusicModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public async Task StopJazzAsync(CommandContext ctx) {
public async Task PlayAsync(CommandContext ctx,
[Description("URL to play from.")] Uri uri) {
var trackLoad = await Music.GetTracksAsync(uri);
var tracks = toSeq(trackLoad.Tracks);
var tracks = trackLoad.Tracks.ToList();
if (trackLoad.LoadResultType == LavalinkLoadResultType.LoadFailed || !tracks.Any()) {
await common.respond(ctx, "No tracks were found at specified link.");
return;
Expand All @@ -160,7 +160,7 @@ public async Task PlayAsync(CommandContext ctx,
if (trackLoad.LoadResultType == LavalinkLoadResultType.PlaylistLoaded &&
trackLoad.PlaylistInfo.SelectedTrack > 0) {
var index = trackLoad.PlaylistInfo.SelectedTrack;
tracks = tracks.Skip(index).Concat(tracks.Take(index));
tracks = tracks.Skip(index).Concat(tracks.Take(index)).ToList();
}

var trackCount = tracks.Count();
Expand Down Expand Up @@ -197,7 +197,7 @@ public async Task PlayJazzAsync(CommandContext ctx,

var interactivity = ctx.Client.GetInteractivity();

var results = (await GuildMusic.getJazz("*" + term + "*")).ToSeq();
var results = (await GuildMusic.getJazz("*" + term + "*")).ToList();
if (!results.Any()) {
await common.respond(ctx, "Nothing was found.");
return;
Expand All @@ -206,7 +206,7 @@ public async Task PlayJazzAsync(CommandContext ctx,
if (results.Count() == 1) {
// only one result
var el_ = results.First();
var tracks_ = el_.Tracks.ToSeq();
var tracks_ = el_.Tracks.ToList();
if (el_.LoadResultType == LavalinkLoadResultType.LoadFailed || !tracks_.Any()) {
await common.respond(ctx, "No tracks were found at specified link.");
return;
Expand Down Expand Up @@ -287,15 +287,15 @@ await common.respond(ctx,
}

var el = results.ElementAt(elInd - 1);
var tracks = el.Tracks.ToSeq();
var tracks = el.Tracks.ToList();


if (el.LoadResultType == LavalinkLoadResultType.LoadFailed || !tracks.Any()) {
await common.modify(ctx, msg, "No tracks were found at specified link.");
return;
}

var trackCount = tracks.Count();
var trackCount = tracks.Count;
foreach (var track in tracks)
GuildMusic.queue.Enqueue(track);

Expand All @@ -318,7 +318,7 @@ public async Task PlayAsync(CommandContext ctx,
string term) {
var interactivity = ctx.Client.GetInteractivity();

var results = (await YouTube.SearchAsync(term)).ToSeq();
var results = (await YouTube.SearchAsync(term)).ToList();
if (!results.Any()) {
await common.respond(ctx, "Nothing was found.");
return;
Expand Down Expand Up @@ -365,13 +365,13 @@ public async Task PlayAsync(CommandContext ctx,
var url = new Uri($"https://youtu.be/{el.Id}");

var trackLoad = await Music.GetTracksAsync(url);
var tracks = trackLoad.Tracks.ToSeq();
var tracks = trackLoad.Tracks.ToList();
if (trackLoad.LoadResultType == LavalinkLoadResultType.LoadFailed || !tracks.Any()) {
await common.modify(ctx, msg, "No tracks were found at specified link.");
return;
}

var trackCount = tracks.Count();
var trackCount = tracks.Count;
foreach (var track in tracks) {
GuildMusic.queue.Enqueue(track);
}
Expand Down
1 change: 0 additions & 1 deletion EconomyBot.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
<PackageReference Include="DSharpPlus.VoiceNext" Version="5.0.0-nightly-01907" />
<PackageReference Include="FuzzierSharp" Version="3.0.1" />
<PackageReference Include="JetBrains.Annotations" Version="2023.3.0" />
<PackageReference Include="LanguageExt.Core" Version="4.4.7" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
Expand Down
6 changes: 1 addition & 5 deletions Program.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
global using LanguageExt;
global using static LanguageExt.Prelude;
using System.Collections;
using System.Diagnostics;
using System.Globalization;
using System.Globalization;
using System.Net;
using System.Text.RegularExpressions;
using DetectLanguage;
Expand Down
1 change: 0 additions & 1 deletion runtimeconfig.template.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"configProperties": {

}
}

0 comments on commit 4b30238

Please sign in to comment.