purgeMessages := purge_discord_messages(Args{channel_id: trigger.channel_id, limit: 50})
send_text_message(Args{
channel_id: trigger.channel_id,
message_content: "Deleted Count: " + purgeMessages.deleted_count,
})
Inputs
Channel IDRequired
ID of the channel to purge messages from.
LimitRequired
Number of messages to delete (1–100).
Example: 50
Before Message ID
Only delete messages before this message ID.
After Message ID
Only delete messages after this message ID.
Outputs
Deleted Count
Number of messages actually deleted.
Example: 50
Build a bot using blocks like Purge Messages
Use this block in our visual flow editor. Bots are hosted 24/7 for free on inventor.bot.
Advanced Documentation
This documentation can be useful when using code mode. View as Markdown
ID:
purge_discord_messagesInputs
| Field | InventScript name | Value |
|---|---|---|
| Channel ID | channel_id | |
| Limit | limit | e.g. "50" |
| Before Message ID | before_id | |
| After Message ID | after_id |
Outputs
| Field | InventScript name | Value |
|---|---|---|
| Deleted Count | deleted_count | e.g. "50" |
Example InventScript
More messages blocks
Send or Edit Text MessageSend or Edit a text-only messageSend TTS MessageSend a text-to-speech message.Send Advanced MessageSend a Components v2 message.Send or Edit Embed MessageSend or edit an embed message.Get MessageFetch a single message by its ID from a channel.Get MessagesFetch recent messages from a channel and iterate over them.Search Server MessagesSearch a server's messages and iterate over the matched messages.Get Pinned MessagesFetch pinned messages from a channel and iterate over them.Forward MessageForward a message into another channel.Delete MessageDelete a message by its ID from a channel.Pin MessagePin a message in a channel.Unpin MessageUnpin a message in a channel.Publish MessagePublish an announcement message to all channels following the announcement channel.Suppress Message EmbedsSuppresses link preview embeds on a message by setting the SUPPRESS_EMBEDS flag.Poll AnswerA single answer option for a poll.Send PollSend a poll message in a channel.End PollImmediately end a poll on a message.Get Poll Answer VotersFetch users who voted for a specific poll answer and iterate over them.