public void NoRepatedEventNames() { //Example for event starting at 6am utc, repeating every day string userInput = "Genshin3; 13 March 2021, 06:00AM; 1:0:0:0"; NotifyEventManager.AddEvent(userInput); Assert.Throws <ArgumentException>(() => NotifyEventManager.AddEvent(userInput)); Assert.Equal(1, NotifyEventManager.NotifyEventCount()); }
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")); }
public async Task EventCreate(CommandContext ctx, [RemainingText] string args) { logger.Info("Create Event Command", Useful.GetDiscordName(ctx)); string message; try { NotifyEventManager.AddEvent(args); message = "Event added. Now activate it manually"; } catch (Exception ex) { message = "Event not created, error: " + ex.Message; } await ctx.Message.RespondAsync(message).ConfigureAwait(false); }