You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
awaitctx.RespondAsync($"{Program.cfgjson.Emoji.Success} Successfully updated the note for {user.Mention} (run again with no note to unwatch):\n> {note}");
awaitctx.RespondAsync($"{Program.cfgjson.Emoji.Success} Now watching for joins/leaves of {user.Mention} to send to the investigations channel"
53
-
+(note==""?"!":$" with the following note:\n>>> {note}"));
54
-
}
19
+
awaitctx.RespondAsync($"{Program.cfgjson.Emoji.Error} This command is deprecated and no longer works; all joinwatches have been converted to notes. To add a note for this user, please use `/note add user:{user.Id} note:{(string.IsNullOrEmpty(note)?"<context>":note)} show_on_join_and_leave:True`; to remove one, use `/note delete user:{user.Id} note:<note>`.");
55
20
}
56
21
57
22
[Command("add")]
@@ -60,84 +25,23 @@ public async Task JoinwatchAdd(CommandContext ctx,
60
25
[Parameter("user"),Description("The user to watch for joins and leaves of.")]DiscordUseruser,
61
26
[Parameter("note"),Description("An optional note for context.")]stringnote="")
awaitctx.RespondAsync($"{Program.cfgjson.Emoji.Success} Now watching for joins/leaves of {user.Mention} to send to the investigations channel"
98
-
+(note==""?"!":$" with the following note:\n>>> {note}"));
99
-
}
28
+
awaitctx.RespondAsync($"{Program.cfgjson.Emoji.Error} This command is deprecated and no longer works; all joinwatches have been converted to notes. Please use `/note add` instead, like this: `/note add user:{user.Id} note:{(string.IsNullOrEmpty(note)?"<context>":note)} show_on_join_and_leave:True`");
100
29
}
101
30
102
31
[Command("remove")]
103
32
[Description("Stop watching for joins and leaves of a user.")]
104
33
publicasyncTaskJoinwatchRemove(CommandContextctx,
105
34
[Parameter("user"),Description("The user to stop watching for joins and leaves of.")]DiscordUseruser)
awaitctx.RespondAsync($"{Program.cfgjson.Emoji.Error} This command is deprecated and no longer works; all joinwatches have been converted to notes. Please use `/note delete` instead, like this: `/note delete user:{user.Id} note:<note>`");
119
37
}
120
38
121
39
[Command("status")]
122
40
[Description("Check the joinwatch status for a user.")]
123
41
publicasyncTaskJoinwatchStatus(CommandContextctx,
124
42
[Parameter("user"),Description("The user whose joinwatch status to check.")]DiscordUseruser)
awaitctx.RespondAsync($"{Program.cfgjson.Emoji.Information}{user.Mention} is currently being watched, but no note is set.");
134
-
else
135
-
awaitctx.RespondAsync($"{Program.cfgjson.Emoji.Information}{user.Mention} is currently being watched with the following note:\n> {note}");
136
-
}
137
-
else
138
-
{
139
-
awaitctx.RespondAsync($"{Program.cfgjson.Emoji.Error}{user.Mention} is not being watched!");
140
-
}
44
+
awaitctx.RespondAsync($"{Program.cfgjson.Emoji.Error} This command is deprecated and no longer works; all joinwatches have been converted to notes. Please use `/note list user:{user.Id}` to show all of this user's notes, or `/note details user:{user.Id} note:<note>` for details on a specific note, instead. Notes with \"Show on Join & Leave\" enabled will behave like joinwatches.");
Copy file name to clipboardexpand all lines: Commands/TrackingCmds.cs
+79-1
Original file line number
Diff line number
Diff line change
@@ -10,12 +10,89 @@ public class TrackingSlashCommands
10
10
{
11
11
[Command("add")]
12
12
[Description("Track a users messages.")]
13
-
publicasyncTaskTrackingAddSlashCmd(SlashCommandContextctx,[Parameter("member"),Description("The member to track.")]DiscordUserdiscordUser)
13
+
publicasyncTaskTrackingAddSlashCmd(SlashCommandContextctx,[Parameter("member"),Description("The member to track.")]DiscordUserdiscordUser,[Parameter("channels"),Description("Optional channels to filter to. Use IDs or mentions, and separate with commas or spaces.")]stringchannels="")
14
14
{
15
15
awaitctx.DeferResponseAsync(ephemeral:false);
16
+
17
+
varchannelsUpdated=false;
18
+
19
+
// Resolve list of filter channels
20
+
List<ulong>filterChannels=new();
21
+
if(!string.IsNullOrEmpty(channels))
22
+
{
23
+
channels=Regex.Replace(channels,", +",",").Trim();// "#general-chat, #lounge" ~> "#general-chat,#lounge" & trim
awaitctx.FollowupAsync(newDiscordFollowupMessageBuilder().WithContent($"{Program.cfgjson.Emoji.Error} I couldn't parse \"{channel}\" as a channel ID or mention! Please double-check it and try again."));
43
+
return;
44
+
}
45
+
}
46
+
}
47
+
48
+
// If we were passed nothing, filterChannels remains an empty List. Otherwise, it is populated with the parsed channel IDs
49
+
50
+
// Compare to db; if there is a mismatch, replace whatever is already in the db with what was passed to this command
0 commit comments