View on GitHub

LinqToTwitter

LINQ Provider for the Twitter API (C# Twitter Library)

Deleting Direct Message Events

Learning how to delete a direct message event.

Requires Authentication: Yes Rate Limited: Yes

Signature:
async Task DeleteDirectMessageEventAsync(
    ulong directMessageID, CancellationToken cancelToken = default(CancellationToken));
Parameters/Filters:
Name Purpose Type Required
directMessageID ID of direct message to delete. ulong yes
cancelToken Async cancellation token. bool no

Return Type: None

v4.x+ Example:
            Console.Write("Which DM would you like to delete? (please enter DM ID): ");
            string dmInput = Console.ReadLine();

            ulong.TryParse(dmInput, out ulong dmID);

            try
            {
                await twitterCtx.DeleteDirectMessageEventAsync(dmID);
                Console.WriteLine("\nDM Deleted");
            }
            catch (TwitterQueryException tqEx)
            {
                Console.WriteLine($"\nProblem deleting DM: ({tqEx.ErrorCode}) - {tqEx.ReasonPhrase}");
            }

Twitter API: direct_messages/events/destroy