using NetCord; using NetCord.Services.ApplicationCommands; using StreakBot.Services; namespace StreakBot.Commands; public class EndStreakCommand : ApplicationCommandModule { private readonly StreakService _streakService; public EndStreakCommand(StreakService streakService) { _streakService = streakService; } [SlashCommand("endstreak", "!!!WARNING PERMANENT DESTRUCTIVE ACTION!!! Ends the daily streak you have with another user.")] public async Task EndStreak( [SlashCommandParameter(Name = "user", Description = "The user to end your streak with")] User user) { var initiatorId = Context.User.Id; var targetId = user.Id; if (initiatorId == targetId) { return "You can't end a streak with yourself!"; } if (user.IsBot) { return "You can't end a streak with a bot!"; } var success = await _streakService.DeleteStreakAsync(initiatorId, targetId); if (success == null) { return $"No streak found between <@{initiatorId}> and <@{targetId}>."; } return (bool)success ? $"Streak ended between <@{initiatorId}> and <@{targetId}>" : "Failed to end streak. Contact @minito for further information."; } }