# Pastebin F9mHqnTh method purge-messages($cmd-obj) {; my %payload = $cmd-obj.payload; my $channel = %payload; my $how-many = $cmd-obj.args; unless $how-many ~~ / ^\d+$ / { return content => 'You must provide an Int value for this command.'; } my @messages = $channel.messages; if @messages.elems < $how-many { @messages.push: await $channel.fetch-messages($how-many.Int - @messages.elems); } $channel.bulk-delete(@messages); return content => "Purged $how-many messages."; }