func (es eventStore) AddToQueue(User *discordgo.User, eventID string) (*discordgo.User, error) {
	es.m.Lock()
	defer es.m.Unlock()
	val := es.eb[eventID]
	if len(val.Queue) == val.Limit {
		return nil, errors.New("queue limit reached")
	}
	if val.DiscordUser.ID == User.ID {
		return nil, errors.New("you cannot queue for your own event")
	}
	for _, u := range val.Queue {
		if u.DiscordUser.ID == User.ID {
			return nil, errors.New("user already in queue")
		}
	}
	newUser := QueueUser{
		DiscordUser: User,
	}
	val.Queue = append(val.Queue, newUser)
	es.eb[eventID].Queue = val.Queue
	return val.DiscordUser, nil
}
// AddToQueue will add another user to the queue who registers as long as the
// queue is not full
AddToQueue will add another user to the queue who registers as long as the
queue is not full
// AddToQueue will add another user to the queue who registers as long as the // queue is not full
func (es eventStore) AddToQueue(User *discordgo.User, eventID string) (*discordgo.User, error) {
	es.m.Lock()
	defer es.m.Unlock()
	val := es.eb[eventID]
	if len(val.Queue) == val.Limit {
		return nil, errors.New("queue limit reached")
	}
	if val.DiscordUser.ID == User.ID {
		return nil, errors.New("you cannot queue for your own event")
	}
	for _, u := range val.Queue {
		if u.DiscordUser.ID == User.ID {
			return nil, errors.New("user already in queue")
		}
	}
	newUser := QueueUser{
		DiscordUser: User,
	}
	val.Queue = append(val.Queue, newUser)
	es.eb[eventID].Queue = val.Queue
	return val.DiscordUser, nil
}
func ( es eventStore ) AddToQueue ( User * discordgo . User , eventID string ) ( * discordgo . User , error ) { es . m . Lock ( ) defer es . m . Unlock ( ) val := es . eb [ eventID ] if len ( val . Queue ) == val . Limit { return nil , errors . New ( " " ) } if val . DiscordUser . ID == User . ID { return nil , errors . New ( " " ) } for _ , u := range val . Queue { if u . DiscordUser . ID == User . ID { return nil , errors . New ( " " ) } } newUser := QueueUser { DiscordUser : User , } val . Queue = append ( val . Queue , newUser ) es . eb [ eventID ] . Queue = val . Queue return val . DiscordUser , nil }
AddToQueue will add another user to the queue who registers as long as the
queue is not full
AddToQueue will add another user to the queue who registers as long as the queue is not full