File tree Expand file tree Collapse file tree 1 file changed +33
-1
lines changed
src/GitcgNetCord.MainApp/Commands/Slash Expand file tree Collapse file tree 1 file changed +33
-1
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,33 @@ await context.Interaction.SendResponseAsync(
43
43
var hoyolabAccount = await activeHoyolabAccountService
44
44
. GetActiveHoyolabAccountAsync ( context . User . Id ) ;
45
45
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
+
46
73
HoyolabAuthorize ? authorize = null ;
47
74
if ( hoyolabAccount != null )
48
75
{
@@ -76,10 +103,15 @@ await context.Interaction.ModifyResponseAsync(message =>
76
103
{
77
104
message . AddEmbeds ( new EmbedProperties ( )
78
105
. 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
+ """ )
80
111
. WithColor ( redColor )
81
112
) ;
82
113
} ) ;
114
+
83
115
return ;
84
116
}
85
117
You can’t perform that action at this time.
0 commit comments