Example #1
0
            public override async Task <bool> RunAsync(CancellationToken cancellationToken = default)
            {
                try
                {
                    if (Interactive != null && Interactive.Source?.Id != Context.User.Id)
                    {
                        return(false);
                    }

                    // remove from interactive list
                    _interactive.InteractiveMessages.TryRemove(Context.Message.Id, out _);

                    // dispose interactive object
                    Interactive?.Dispose();

                    // delete message
                    await Context.Message.DeleteAsync();

                    return(true);
                }
                catch
                {
                    return(false);
                }
            }
        private void Current_Suspending(object sender, Windows.ApplicationModel.SuspendingEventArgs e)
        {
            Interactive.Dispose();

            Interactive = null;
        }