make gateway-identify-json work even without a discord-bot connected
for testing
TUPLE: discord-bot-config
client-id client-secret
- token application-id guild-id channel-id permissions
+ token application-id guild-id channel-id
+ permissions intents
user-callback obey-names
metadata
discord-bot mailbox connect-thread ;
: get-discord-bot-gateway ( -- json ) "/gateway/bot" discord-get ;
: gateway-identify-json ( -- json )
- \ discord-bot get config>> token>> [[ {
+ \ discord-bot get
+ [ config>> ] ?call
+ [ [ token>> ] ?call "0" or ]
+ [ [ intents>> ] ?call 3276541 or ] bi
+ [[ {
"op": 2,
"d": {
"token": "%s",
"device": "discord.factor"
},
"large_threshold": 250,
- "intents": 3276541
+ "intents": %d
}
}]] sprintf json> >json ;