Purge Command

commands.CreateCommand("purge") .Parameter("int") .Do(async (e) => { int delNo = Int32.Parse(e.GetArg("int")); Message[] mDelete; mDelete = await e.Channel.DownloadMessages(delNo); await e.Channel.DeleteMessages(mDelete); await e.Channel.SendMessage(e.User.Mention + " purged " + e.GetArg("int") + " messages."); });
// V 0.1
Added permission checker.
Added if statement to determine whether to use plural or not.
Changed output message.

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.