예제 #1
0
        static void ImprintNotification(object sender, EventArgs args)
        {
            ImprintService       timer   = sender as ImprintService;
            SocketCommandContext context = timer.Context as SocketCommandContext;

            context.Channel.SendMessageAsync(context.User.Mention + "Your " + timer.name + " is ready to imprint!");
        }
예제 #2
0
        public async Task newImprint(string name, int minutes)
        {
            var timer = new ImprintService(name, minutes, Context);

            timer.Interval  = 1000 * 60 * minutes;
            timer.Elapsed  += ImprintNotification;
            timer.AutoReset = false;
            timer.Start();
            await Context.Channel.SendMessageAsync(Context.User.Mention + "Timer has been start for: " + minutes + " minutes");
        }