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 @@ -43,6 +43,33 @@ await context.Interaction.SendResponseAsync(
4343 var hoyolabAccount = await activeHoyolabAccountService
4444 . GetActiveHoyolabAccountAsync ( context . User . Id ) ;
4545
46+ var commands = await context . Client . Rest
47+ . GetGlobalApplicationCommandsAsync ( context . Client . Id ) ;
48+
49+ var accountCommand = commands
50+ . First ( x => x . Name == "hoyolab-accounts" ) ;
51+
52+ if ( hoyolabAccount == null && string . IsNullOrWhiteSpace ( uid ) )
53+ {
54+
55+ await context . Interaction . ModifyResponseAsync ( message =>
56+ {
57+ message . AddEmbeds ( new EmbedProperties ( )
58+ . WithTitle ( "Error" )
59+ . WithDescription (
60+ $ """
61+ You must have a Hoyolab account linked to your Discord account, or provide a UID.
62+ Please use the { accountCommand } command to link your Hoyolab account.
63+ Alternatively, you can provide a UID directly.
64+ """
65+ )
66+ . WithColor ( new NetCord . Color ( Color . Red . ToArgb ( ) ) )
67+ ) ;
68+ } ) ;
69+
70+ return ;
71+ }
72+
4673 HoyolabAuthorize ? authorize = null ;
4774 if ( hoyolabAccount != null )
4875 {
@@ -76,10 +103,15 @@ await context.Interaction.ModifyResponseAsync(message =>
76103 {
77104 message . AddEmbeds ( new EmbedProperties ( )
78105 . WithTitle ( "Error" )
79- . WithDescription ( e . Message )
106+ . WithDescription (
107+ $ """
108+ { e . Message }
109+ If the UID is your own, use the command { accountCommand } to set up your Hoyolab account.
110+ """ )
80111 . WithColor ( redColor )
81112 ) ;
82113 } ) ;
114+
83115 return ;
84116 }
85117
You can’t perform that action at this time.
0 commit comments