Lingo.Helper.Role (Lingo v0.4.2)

Copy Markdown View Source

Whether the bot can manage a role, and how roles rank.

Answered from the cache, which needs guilds, channels, roles and the bot's own user and member enabled (see Lingo.Cache). Anything missing gives false, 0 or nil.

Summary

Functions

Compares two roles' positions in the hierarchy: :gt, :lt or :eq, or nil if either isn't cached.

Whether the bot can edit or assign a role: it has Manage Roles, and the role is below its highest role, not @everyone and not managed by an integration.

Functions

compare(guild_id, role_id_a, role_id_b)

Compares two roles' positions in the hierarchy: :gt, :lt or :eq, or nil if either isn't cached.

editable?(guild_id, role_id)

Whether the bot can edit or assign a role: it has Manage Roles, and the role is below its highest role, not @everyone and not managed by an integration.