File tree Expand file tree Collapse file tree
src/GitcgNetCord.MainApp/Commands/Slash Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ await context.Interaction.SendResponseAsync(
6464 var redColor = new NetCord . Color ( Color . Red . ToArgb ( ) ) ;
6565
6666 HoyolabHttpClient . Responses . GcgBasicInfo . Data info ;
67-
67+
6868 try
6969 {
7070 info = await gcgBasicInfoService
@@ -121,10 +121,13 @@ await context.Interaction.ModifyResponseAsync(message =>
121121 string GetRoleEmojis ( IEnumerable < string > s )
122122 {
123123 var roles = s . Select ( url => cardRoles . Roles
124- . First ( x => x . Basic . IconSmall == url )
124+ . FirstOrDefault ( x => x . Basic . IconSmall == url )
125+ ) ;
126+ var ids = roles . Select ( x => x ? . Basic . ItemId . ToString ( ) ) ;
127+ return string . Join (
128+ separator : " " ,
129+ values : ids . Select ( id => id == null ? ":question:" : emojis [ id ] . ToString ( ) )
125130 ) ;
126- var ids = roles . Select ( x => x . Basic . ItemId . ToString ( ) ) ;
127- return string . Join ( " " , ids . Select ( id => emojis [ id ] ) ) ;
128131 }
129132
130133 string DisplayName ( string name , bool isWin )
@@ -159,4 +162,4 @@ private static string GetServerValue(
159162 _ => server
160163 } ;
161164 }
162- }
165+ }
You can’t perform that action at this time.
0 commit comments