Don't allow everyone to be staff members

This commit is contained in:
rxdn 2022-08-10 18:43:44 +01:00
parent caeafa1485
commit c2239ef882
2 changed files with 10 additions and 5 deletions

View File

@ -29,6 +29,11 @@ func AddMember(ctx *gin.Context) {
return
}
if entityType == entityTypeRole && snowflake == guildId {
ctx.JSON(400, utils.ErrorStr("You cannot add the @everyone role as staff"))
return
}
teamId := ctx.Param("teamid")
if teamId == "default" {
addDefaultMember(ctx, guildId, snowflake, entityType)

View File

@ -34,17 +34,17 @@ func FromArchiveMessages(messages []message.Message, ticketId int) Payload {
badge = badgePtr(BadgeBot)
}
users[snowflake] = User{
users[snowflake] = User{
Avatar: msg.Author.AvatarUrl(256),
Username: msg.Author.Username,
Discriminator: msg.Author.Discriminator,
Discriminator: fmt.Sprintf("%04d", msg.Author.Discriminator),
Badge: badge,
}
}
}
}
return Payload{
Entities: Entities{
Entities: Entities{
Users: users,
Channels: make(map[string]Channel),
Roles: make(map[string]Role),