Closing a invitation diaglog box

I am coding a bot hat send a invitation to the other users to join in a chat room. I want to set a invitation timeout if there is no reply from the user i will invite some one else. I am having the problem of withdrawing the invitation. The dialog box on the user end refuses to close on its own.

I don’'t think the MUC API has a command for that.