func (g *Guild) RoleByName(name string) ([]*Role, error) {
	g.RLock()
	defer g.RUnlock()

	var roles []*Role
	for _, role := range g.Roles {
		if role.Name == name {
			roles = append(roles, role)
		}
	}

	if len(roles) == 0 {
		return nil, errors.New("no roles were found in guild")
	}

	return roles, nil
}
// RoleByTitle retrieves a slice of roles with same name
RoleByTitle retrieves a slice of roles with same name
// RoleByTitle retrieves a slice of roles with same name
func (g *Guild) RoleByName(name string) ([]*Role, error) {
	g.RLock()
	defer g.RUnlock()
	var roles []*Role
	for _, role := range g.Roles {
		if role.Name == name {
			roles = append(roles, role)
		}
	}
	if len(roles) == 0 {
		return nil, errors.New("no roles were found in guild")
	}
	return roles, nil
}
func ( g * Guild ) RoleByName ( name string ) ( [ ] * Role , error ) { g . RLock ( ) defer g . RUnlock ( ) var roles [ ] * Role for _ , role := range g . Roles { if role . Name == name { roles = append ( roles , role ) } } if len ( roles ) == 0 { return nil , errors . New ( " " ) } return roles , nil }
RoleByTitle retrieves a slice of roles with same name
RoleByTitle retrieves a slice of roles with same name