for serverBan := range get_server_bans(Args{server_id: trigger.server_id}) {
send_text_message(Args{
channel_id: trigger.channel_id,
message_content: "User ID: " + serverBan.user_id,
})
}
Get Server Bans
LoopUsers
Retrieve a list of banned users in a server.
Only the first 1000 bans are returned.
- Loop block: the blocks placed inside it run once for each item, and can use the current item's outputs.
Inputs
Server IDRequired
ID of the server to retrieve bans from.
Loop Body
Blocks to run for each ban.
Holds blocks
Outputs
User ID
ID of the banned user.
Reason
Reason for the ban.
Ban Reason
Reason for the ban (alias).
Build a bot using blocks like Get Server Bans
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:
get_server_bans- Loop block: write
for item := range get_server_bans(Args{...}) { ... }and read the current item's outputs fromitem. See loops.
Inputs
| Field | InventScript name | Value |
|---|---|---|
| Server ID | server_id | |
| Loop Body | body | blocks: func() { ... } |
Outputs
| Field | InventScript name | Value |
|---|---|---|
| User ID | user_id | |
| Reason | reason | |
| Ban Reason | ban_reason |
Example InventScript
More users blocks
Get UserRetrieve a Discord user's information by their ID.Create DM ChannelCreate a DM channel with a user.Get Server MemberRetrieve a Discord server member information by their ID.Get Highest Role Position of MemberRetrieve the position of the highest role of a member in a server.Get Server MembersRetrieve members of a Discord server.Kick Server MemberKick a member from a server.Ban Server MemberBan a member from a server.Unban Server MemberUnban a member from a server.Timeout Server MemberTimeout a member from a server.Assign RoleAssign a role to a user.Remove RoleRemove a role from a user.Change Member NicknameChange a member's nickname in a server.