Sonoran Bot
SupportServer HostingAbout
  • Sonoran Bot
  • Other Products
    • ⌨️Sonoran CAD
    • 📝Sonoran CMS
    • 📡Sonoran Radio
    • 🖥️Sonoran Servers
  • Tutorials
    • Getting Started
    • Sonoran CMS Integration
      • Account Link
      • Role Mapping
      • Import Discord Roles
      • Calendar Event Sync
      • Discord Sync Logic
    • Sonoran CAD Integration
    • Usage
      • Settings
      • Commands
      • Moderation
  • Other
    • Report A Bug
    • Contact Us!
Powered by GitBook
On this page
  • About
  • CMS -> Discord Events
  • User Discord Link
  • User Discord Unlink
  • User CMS Join
  • User CMS Leave
  • User CMS Ban
  • Discord -> CMS Events
  • Account Join
  • Account Leave
  • Account Role Added
  • Account Role Removed
  • Account Manual Sync
  • Account Kicked
  • Account Banned

Was this helpful?

Edit on GitHub
  1. Tutorials
  2. Sonoran CMS Integration

Discord Sync Logic

Learn more about how Sonoran Bot syncs permissions with Discord.

PreviousCalendar Event SyncNextSonoran CAD Integration

Last updated 20 hours ago

Was this helpful?

About

The Sonoran Bot offers automated permission syncing by "mapping" CMS ranks to Discord roles.

There are several different cases where these permissions are continually synced.

CMS -> Discord Events

User Discord Link

When a user newly links their Discord account in the CMS:

  • CMS requests all existing Discord roles that the user has

  • CMS adds all associated "mapped" CMS ranks based on existing Discord roles

User Discord Unlink

When a user has their Discord account unlinked from their CMS account:

  • CMS removes all associated "mapped" ranks

  • Bot removes all associated "mapped" roles

This ensures a user cannot unlink their Discord account from CMS prior to a ban, and keep their Discord roles.

User CMS Join

When a user joins the CMS community:

  • CMS checks for a linked Discord account

  • CMS requests all existing Discord roles that the user has

  • CMS adds all associated "mapped" CMS ranks based on existing Discord roles

User CMS Leave

When a user leaves the CMS community:

  • CMS removes all ranks for the user

  • CMS informs the bot of a user leaving the CMS community

  • Bot removes all associated "mapped" Discord roles

User CMS Ban

When a user is banned in the CMS community:

  • CMS removes all ranks for the user

  • CMS informs the bot of a user ban

  • Bot removes all associated "mapped" Discord roles

Discord -> CMS Events

Account Join

When an account joins a Discord Guild:

  • Bot requests any existing CMS ranks the user has

  • Bot applies any associated "mapped" roles from the existing CMS ranks

Account Leave

When an account leaves a Discord Guild:

    • The user will be kicked from the CMS

    • The user will be kicked from any remaining Discord Guilds

  • Bot checks for remaining "mapped" roles in any other linked Discord Guilds

    • Any mapped ranks in remaining other Discord Guilds will remain unchanged

    • Any mapped ranks that no longer remain in any Discord Guild will be removed

Account Role Added

When a new Discord role is added to a user:

  • Bot informs the CMS of the new role

  • The associated "mapped" rank is applied in CMS

  • Bot applies all associated "mapped" roles to all additional Discord Guilds

Account Role Removed

When a Discord role is removed from a user:

  • Bot informs the CMS of the role removal

  • The associated "mapped" rank is removed in CMS

  • Bot removes all associated "mapped" roles to all additional Discord Guilds

Account Manual Sync

When a user runs the /sync command in a Discord Guild:

  • Bot requests all existing CMS ranks the user has

  • Bot applies any associated "mapped" roles from the existing CMS ranks

  • Bot informs CMS of any existing Discord roles the user has

  • CMS adds any associated "mapped" roles from the existing Discord roles

A manual sync will never result in any role or rank removal. It will only "complete" any missing pieces to the mapping.

Account Kicked

When a user is kicked from a Discord Guild:

    • The user will be kicked from the CMS

    • The user will be kicked from any remaining Discord Guilds

  • Bot checks for remaining "mapped" roles in any other linked Discord Guilds

    • Any mapped ranks in remaining other Discord Guilds will remain unchanged

    • Any mapped ranks that no longer remain in any Discord Guild will be removed

Account Banned

When a user is banned from a Discord Guild:

    • The user will be banned from the CMS

    • The user will be banned in any remaining Discord Guilds

  • Bot checks for remaining "mapped" roles in any other linked Discord Guilds

    • Any mapped ranks in remaining other Discord Guilds will remain unchanged

    • Any mapped ranks that no longer remain in any Discord Guild will be removed

CMS from any other CMS accounts

If is enabled, bot will ban user in any remaining guilds

If is enabled

If is enabled

If is enabled

removes the Discord link
ban sync
kick on leave
kick on leave
ban sync