|
|
@ -23,10 +23,11 @@ type ServerRoleAssignConfig struct {
|
|
|
|
type ServerConfigOptionFunction func(s *discordgo.Session) ServerRoleAssignConfig
|
|
|
|
type ServerConfigOptionFunction func(s *discordgo.Session) ServerRoleAssignConfig
|
|
|
|
|
|
|
|
|
|
|
|
func InitRoleReactions(s *discordgo.Session) {
|
|
|
|
func InitRoleReactions(s *discordgo.Session) {
|
|
|
|
addHubbubHandlers(s)
|
|
|
|
addHubbubRoleHandlers(s)
|
|
|
|
|
|
|
|
addHubbubPronounHandlers(s)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func addHubbubHandlers(s *discordgo.Session) {
|
|
|
|
func addHubbubRoleHandlers(s *discordgo.Session) {
|
|
|
|
hubbubId := "827958531659530301"
|
|
|
|
hubbubId := "827958531659530301"
|
|
|
|
roleAssignChannelId := "855923187354959872"
|
|
|
|
roleAssignChannelId := "855923187354959872"
|
|
|
|
roleMap := map[string]RoleReaction{
|
|
|
|
roleMap := map[string]RoleReaction{
|
|
|
@ -47,6 +48,41 @@ func addHubbubHandlers(s *discordgo.Session) {
|
|
|
|
s,
|
|
|
|
s,
|
|
|
|
hubbubId,
|
|
|
|
hubbubId,
|
|
|
|
roleAssignChannelId,
|
|
|
|
roleAssignChannelId,
|
|
|
|
|
|
|
|
"React to this message to get a role!",
|
|
|
|
|
|
|
|
roleMap,
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
s.AddHandler(roleAddHandler(serverConfig))
|
|
|
|
|
|
|
|
s.AddHandler(roleRemoveHandler(serverConfig))
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func addHubbubPronounHandlers(s *discordgo.Session) {
|
|
|
|
|
|
|
|
hubbubId := "827958531659530301"
|
|
|
|
|
|
|
|
roleAssignChannelId := "932432742547869726"
|
|
|
|
|
|
|
|
roleMap := map[string]RoleReaction{
|
|
|
|
|
|
|
|
"🇭": {
|
|
|
|
|
|
|
|
RoleName: "He/Him",
|
|
|
|
|
|
|
|
RoleId: "932433573292699699",
|
|
|
|
|
|
|
|
EmojiName: "regional_indicator_h",
|
|
|
|
|
|
|
|
EmojiId: "🇭",
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
"🇫": {
|
|
|
|
|
|
|
|
RoleName: "She/Her",
|
|
|
|
|
|
|
|
RoleId: "932433721750081587",
|
|
|
|
|
|
|
|
EmojiName: "regional_indicator_f",
|
|
|
|
|
|
|
|
EmojiId: "🇫",
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
"🇹": {
|
|
|
|
|
|
|
|
RoleName: "They/Them",
|
|
|
|
|
|
|
|
RoleId: "932433573292699699",
|
|
|
|
|
|
|
|
EmojiName: "regional_indicator_t",
|
|
|
|
|
|
|
|
EmojiId: "🇹",
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
serverConfig := getServerConfig(
|
|
|
|
|
|
|
|
s,
|
|
|
|
|
|
|
|
hubbubId,
|
|
|
|
|
|
|
|
roleAssignChannelId,
|
|
|
|
|
|
|
|
"React to this message to assign pronouns! You are allowed to select multiple.",
|
|
|
|
roleMap,
|
|
|
|
roleMap,
|
|
|
|
)
|
|
|
|
)
|
|
|
|
s.AddHandler(roleAddHandler(serverConfig))
|
|
|
|
s.AddHandler(roleAddHandler(serverConfig))
|
|
|
@ -57,6 +93,7 @@ func getServerConfig(
|
|
|
|
s *discordgo.Session,
|
|
|
|
s *discordgo.Session,
|
|
|
|
guildId string,
|
|
|
|
guildId string,
|
|
|
|
roleAssignChannelId string,
|
|
|
|
roleAssignChannelId string,
|
|
|
|
|
|
|
|
roleAssignMessage string,
|
|
|
|
roleMap map[string]RoleReaction,
|
|
|
|
roleMap map[string]RoleReaction,
|
|
|
|
) ServerRoleAssignConfig {
|
|
|
|
) ServerRoleAssignConfig {
|
|
|
|
serverConfig := ServerRoleAssignConfig{
|
|
|
|
serverConfig := ServerRoleAssignConfig{
|
|
|
@ -70,7 +107,7 @@ func getServerConfig(
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if len(messages) == 0 {
|
|
|
|
if len(messages) == 0 {
|
|
|
|
content := "React to this message to get a role!\n"
|
|
|
|
content := fmt.Sprintf("%s\n", roleAssignMessage)
|
|
|
|
for emote, role := range roleMap {
|
|
|
|
for emote, role := range roleMap {
|
|
|
|
content += fmt.Sprintf("%s : %s\n", emote, role.RoleName)
|
|
|
|
content += fmt.Sprintf("%s : %s\n", emote, role.RoleName)
|
|
|
|
}
|
|
|
|
}
|
|
|
|