github.com/starshine-sys/bcr@v0.21.0/roles.go (about)

     1  package bcr
     2  
     3  import "github.com/diamondburned/arikawa/v3/discord"
     4  
     5  // Roles are a sortable collection of discord.Role
     6  type Roles []discord.Role
     7  
     8  func (r Roles) Len() int {
     9  	return len(r)
    10  }
    11  
    12  func (r Roles) Less(i, j int) bool {
    13  	return r[i].Position > r[j].Position
    14  }
    15  
    16  func (r Roles) Swap(i, j int) {
    17  	r[i], r[j] = r[j], r[i]
    18  }