11using Discord ;
22using Discord . Interactions ;
33using System . Text ;
4- using System . Text . RegularExpressions ;
54
65namespace CFDiscordBot . Commands
76{
@@ -33,63 +32,10 @@ int projectId
3332 return ;
3433 }
3534
36- //var modFiles = new List<CurseForge.APIClient.Models.Files.File>();
37-
38- //var files = await apiClient.GetModFilesAsync(projectId, pageSize: 50);
39- //modFiles.AddRange(files.Data);
40-
41- //var index = files.Pagination.Index;
42- //while (modFiles.Count < files.Pagination.TotalCount)
43- //{
44- // files = await apiClient.GetModFilesAsync(projectId, index: index++, pageSize: 50);
45- // modFiles.AddRange(files.Data);
46- //}
47-
4835 var summaryText = new StringBuilder ( ) ;
49- var haveExtraLinebreak = false ;
5036
5137 summaryText . AppendLine ( mod . Summary ) ;
5238
53- if ( mod . LatestFilesIndexes ? . Count > 0 )
54- {
55- var gameVersionList = new List < string > ( ) ;
56- var modloaderList = new List < string > ( ) ;
57-
58- /*foreach (var modFile in modFiles)
59- {
60- if (modFile?.IsAvailable ?? true)
61- {
62- if (!string.IsNullOrWhiteSpace(file.GameVersion))
63- {
64- gameVersionList.Add(file.GameVersion);
65- }
66- if (!string.IsNullOrWhiteSpace(file.ModLoader?.ToString()))
67- {
68- modloaderList.Add(file.ModLoader.Value.ToString());
69- }
70- }
71- }*/
72-
73- var gameVersions = string . Join ( ", " , gameVersionList . Distinct ( ) . OrderBy ( gvt => Regex . Replace ( gvt , "\\ d+" , m => m . Value . PadLeft ( 10 , '0' ) ) ) ) ;
74- var modLoaders = string . Join ( ", " , modloaderList . Distinct ( ) . OrderBy ( gvt => Regex . Replace ( gvt , "\\ d+" , m => m . Value . PadLeft ( 10 , '0' ) ) ) ) ;
75-
76- if ( ( ! string . IsNullOrWhiteSpace ( gameVersions ) || ! string . IsNullOrWhiteSpace ( modLoaders ) ) && ! haveExtraLinebreak )
77- {
78- summaryText . AppendLine ( ) ;
79- haveExtraLinebreak = true ;
80- }
81-
82- if ( ! string . IsNullOrWhiteSpace ( gameVersions ) )
83- {
84- summaryText . AppendLine ( $ "Game version(s): { gameVersions } ") ;
85- }
86-
87- if ( ! string . IsNullOrWhiteSpace ( modLoaders ) )
88- {
89- summaryText . AppendLine ( $ "Modloader(s): { modLoaders } ") ;
90- }
91- }
92-
9339 var projectEmbed = new EmbedBuilder
9440 {
9541 Title = "Project information" ,
@@ -116,6 +62,7 @@ int projectId
11662 new ( ) { Name = "Released" , Value = $ "<t:{ mod . DateReleased . ToUnixTimeSeconds ( ) } :F>", IsInline = true } ,
11763 new ( ) { Name = "Downloads" , Value = mod . DownloadCount . ToString ( "n0" ) , IsInline = true } ,
11864 new ( ) { Name = "Mod Distribution" , Value = mod . AllowModDistribution ?? true ? "Allowed" : "Not allowed" , IsInline = true } ,
65+ new ( ) { Name = "Is available" , Value = mod . IsAvailable ? "Yes" : "No" , IsInline = true }
11966 } ;
12067
12168 if ( ! string . IsNullOrWhiteSpace ( categories ) )
0 commit comments