This page shows you how to use the purge command
/purge <amount>
--before=<message_id>
--after=<message_id>
/purge <amount> --flag=<message_id>