Deleting Direct Messages

Jan 24, 2015 at 12:25 AM
Hi All, is there a way to delete all direct messages received?
I've tried the below but it just throws an exception
            var user = User.GetLoggedUser();
            var Messages = user.GetLatestMessagesReceived();
            foreach (var messagereceived in Messages)
            {
                messagereceived.Destroy();
            }
Jan 30, 2015 at 7:02 PM
I worked this out the other day, for future reference the solution is
                var user = User.GetLoggedUser();
                var Messages = user.GetLatestMessagesReceived(200);
                foreach (var messagereceived in Messages)
                {
                    Tweetinvi.Message.DestroyMessage(messagereceived.Id);
                }
Marked as answer by N0G on 1/30/2015 at 12:05 PM
Coordinator
Feb 12, 2015 at 10:41 AM
Hi,

I am currently working on your bug. Would you please give me the details of the Exception as I cannot reproduce this bug.

Thanks,
Linvi
Feb 12, 2015 at 11:55 AM
Hi Linvi,
This was a while back and I've slept since but I think this is caused by the line
messagereceived.Destroy();
Unless you specify that you want to destroy this.message.Id it fails, maybe a default value issue?
Coordinator
Feb 17, 2015 at 7:41 PM
Hi again,

I know it has been a while that you encountered this issue but could you please try and confirm that this error is still occuring for you.
Also could you please give me the version of Tweetinvi you are using.

Linvi