if member_role_has_permissions(Args{
check_type: "Member",
server_id: trigger.server_id,
user_or_role_id: "...",
permissions: "Add Reactions",
}) {
send_text_message(Args{channel_id: trigger.channel_id, message_content: "Yes"})
}
Member/Role Has Permissions
ConditionUtilities
Check if a member or role has specific permissions.
- Condition block: the blocks placed inside it only run when the condition is met.
Inputs
Check TypeRequired
Whether to check a member or a role.
OptionsMemberRole
Server IDRequired
The server to check permissions in.
User or Role IDRequired
The member's user ID or the role ID to check.
PermissionsRequired
Permissions to check for.
OptionsAdd ReactionsAdministratorAttach FilesBan MembersBypass SlowmodeChange NicknameConnectCreate EventsCreate ExpressionsCreate Instant InviteCreate Private ThreadsCreate Public ThreadsDeafen MembersEmbed LinksKick MembersManage ChannelsManage EventsManage ExpressionsManage MessagesManage NicknamesManage RolesManage ServerManage ThreadsManage WebhooksMention EveryoneMove MembersMute MembersPin MessagesPriority SpeakerRead Message HistoryRequest to SpeakSend MessagesSend Messages in ThreadsSend PollsSend TTS MessagesSend Voice MessagesSet Voice Channel StatusSpeakStreamTimeout MembersUse Application CommandsUse Embedded ActivitiesUse External AppsUse External EmojisUse External SoundsUse External StickersUse SoundboardUse VADView Audit LogView ChannelView Creator Monetization AnalyticsView Guild Insights
Has Permissions
Blocks to run when the member/role has all selected permissions.
Holds blocks
Missing Permissions
Blocks to run when the member/role is missing one or more selected permissions.
Holds blocks
Outputs
Result
Whether the member/role has all selected permissions.
Example: true
Build a bot using blocks like Member/Role Has Permissions
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:
member_role_has_permissions- Condition block: write
if member_role_has_permissions(Args{...}) { ... }, or use it as a"true"/"false"value. See conditions.
Inputs
| Field | InventScript name | Value |
|---|---|---|
| Check Type | check_type | "Member", "Role" |
| Server ID | server_id | |
| User or Role ID | user_or_role_id | |
| Permissions | permissions | "Add Reactions", "Administrator", "Attach Files", "Ban Members", "Bypass Slowmode", "Change Nickname", "Connect", "Create Events", "Create Expressions", "Create Instant Invite", "Create Private Threads", "Create Public Threads", "Deafen Members", "Embed Links", "Kick Members", "Manage Channels", "Manage Events", "Manage Expressions", "Manage Messages", "Manage Nicknames", "Manage Roles", "Manage Server", "Manage Threads", "Manage Webhooks", "Mention Everyone", "Move Members", "Mute Members", "Pin Messages", "Priority Speaker", "Read Message History", "Request to Speak", "Send Messages", "Send Messages in Threads", "Send Polls", "Send TTS Messages", "Send Voice Messages", "Set Voice Channel Status", "Speak", "Stream", "Timeout Members", "Use Application Commands", "Use Embedded Activities", "Use External Apps", "Use External Emojis", "Use External Sounds", "Use External Stickers", "Use Soundboard", "Use VAD", "View Audit Log", "View Channel", "View Creator Monetization Analytics", "View Guild Insights" |
| Has Permissions | if_true | blocks: func() { ... } |
| Missing Permissions | if_false | blocks: func() { ... } |
Outputs
| Field | InventScript name | Value |
|---|---|---|
| Result | result | e.g. "true" |
Example InventScript
More utilities blocks
Log ErrorLog an error to the errors dashboard.Get Error DetailsRetrieve details of a logged error.Discord API PingMeasure current patency to the Discord API.Change Bot StatusUpdate the bot's presence and status text.Get Server CountGet the number of servers the bot is in.Custom LoopLoop over a customized range of numbers.Check PermissionCheck if a permission exists in a bitfield.Redact SecretRedact a secret (e.g. example -> e*****e).Get Bot DetailsGet cached details of the current branch's bot user.Generate Snowflake IDGenerate a unique Snowflake-like ID.Update Local VariableSet a local variable to a new value.Append New Line to Local VariableAppend text to a local variable on a new line.CommentAdd a note or comment to your flow. This block does nothing when run.Increment or Decrement Local VariableIncrement or decrement a numeric local variable by a value.