public async Task EventSubscribe(CommandContext ctx, [RemainingText] string eventName) { logger.Info("Event Subscribe Command", Useful.GetDiscordName(ctx)); bool result = NotifyEventManager.SubscribeUserToEvent(ctx.User.Id, ctx.Guild.Id, eventName); string message = result ? "Added sucessfully to " + eventName : "Error"; await ctx.Message.RespondAsync(message).ConfigureAwait(false); }
public void NoRepeatedUserSubscriber() { //Example for event starting at 6am utc, repeating every day string userInput = "Genshin2; 13 March 2021, 06:00AM; 1:0:0:0"; NotifyEventManager.AddEvent(userInput); ulong userID = 132; ulong userGuild = 321; NotifyEventManager.SubscribeUserToEvent(userID, userGuild, "Genshin2"); Assert.False(NotifyEventManager.SubscribeUserToEvent(userID, userGuild, "Genshin2")); }