77 "fmt"
88 "log"
99 "net/http"
10- "strconv"
1110 "strings"
1211 "time"
1312
@@ -266,7 +265,7 @@ func handleCreateAlmanax(w http.ResponseWriter, r *http.Request) {
266265 }
267266
268267 requestedBonuses := map [string ]* Set [string ]{}
269- requestedMentions := map [string ]* Set [uint64 ]{}
268+ requestedMentions := map [string ]* Set [json. Number ]{}
270269
271270 if createWebhook .Mentions != nil {
272271
@@ -280,7 +279,7 @@ func handleCreateAlmanax(w http.ResponseWriter, r *http.Request) {
280279 requestedBonuses [bonusId ] = NewSet [string ]()
281280 }
282281 if _ , ok := requestedMentions [bonusId ]; ! ok {
283- requestedMentions [bonusId ] = NewSet [uint64 ]()
282+ requestedMentions [bonusId ] = NewSet [json. Number ]()
284283 }
285284 if ! possibleBonuses .Has (bonusId ) {
286285 http .Error (w , "Unknown almanax bonus id: " + bonusId + "." , http .StatusBadRequest )
@@ -298,12 +297,7 @@ func handleCreateAlmanax(w http.ResponseWriter, r *http.Request) {
298297 return
299298 }
300299 }
301- discordId , err := mention .DiscordId .Int64 ()
302- if err != nil {
303- http .Error (w , "Invalid discord id." , http .StatusBadRequest )
304- return
305- }
306- requestedMentions [bonusId ].Add (uint64 (discordId ))
300+ requestedMentions [bonusId ].Add (mention .DiscordId )
307301 }
308302 }
309303 }
@@ -940,11 +934,7 @@ func buildDiscordHookAlmanax(almanaxSend AlmanaxSend) ([]PreparedHook, error) {
940934 if mentions , ok := hookMentions [almBonusType .GetId ()]; ok {
941935 var mentionStrings []string
942936 for _ , mention := range mentions {
943- discordId , err := mention .DiscordId .Int64 ()
944- if err != nil {
945- return nil , err
946- }
947- idStr := strconv .FormatInt (discordId , 10 )
937+ idStr := mention .DiscordId .String ()
948938 found := false
949939 for _ , alreadyInsertedMention := range mentionStrings {
950940 if strings .Contains (alreadyInsertedMention , idStr ) {
@@ -982,11 +972,7 @@ func buildDiscordHookAlmanax(almanaxSend AlmanaxSend) ([]PreparedHook, error) {
982972
983973 var mentionStrings []string
984974 for _ , mention := range mentions {
985- discordId , err := mention .DiscordId .Int64 ()
986- if err != nil {
987- return nil , err
988- }
989- idStr := strconv .FormatInt (discordId , 10 )
975+ idStr := mention .DiscordId .String ()
990976 if mention .IsRole {
991977 mentionStrings = append (mentionStrings , "<@&" + idStr + ">" )
992978 } else {
0 commit comments