Skip to content
This repository has been archived by the owner on Mar 7, 2024. It is now read-only.

Commit

Permalink
Clear the identifier after it has been used
Browse files Browse the repository at this point in the history
  • Loading branch information
duncte123 committed Oct 27, 2020
1 parent 4c36967 commit d440c25
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ class FetchDataHandler : SocketHandler() {

if (waitingMap.containsKey(identifier)) {
waitingMap[identifier]!!(data)

waitingMap.remove(identifier)
}
}
}
20 changes: 10 additions & 10 deletions websocket.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Send an "Authorization" header with the correct token (one that is for the bot r

#### Internal data exchange
Request (from-bot):
```json
```json5
{
"t": "ROLES_PUT_HASH",
"d": {
Expand All @@ -27,7 +27,7 @@ Request (from-bot):
}
```
Response (to-bot):
```json
```json5
{
"t": "ROLES_PUT_HASH",
"data": {
Expand All @@ -43,7 +43,7 @@ Response (to-bot):
Request:

TODO: also do guild settings in here?
```json
```json5
{
"t": "DATA_UPDATE",
"d": {
Expand All @@ -63,7 +63,7 @@ TODO: also do guild settings in here?
```

##### to dashboard
```json
```json5
{
"t": "DATA_UPDATE",
"d": {
Expand All @@ -80,7 +80,7 @@ TODO: also do guild settings in here?
Request (to-bot):

both update and add send the full guild settings object to the bot
```json
```json5
{
"t": "GUILD_SETTINGS",
"d":{
Expand All @@ -100,7 +100,7 @@ both update and add send the full guild settings object to the bot
}
}
```
```json
```json5
{
"t": "CUSTOM_COMMANDS",
"d": {
Expand Down Expand Up @@ -133,15 +133,15 @@ Response (from-bot): None

#### getting command info
Request (to-bot):
```json
```json5
{
"t": "FETCH_DATA",
"identifier": "Identifier for finding the data we requested",
"commands": {}
}
```
Response (from-bot):
```json
```json5
{
"t": "FETCH_DATA",
"identifier": "Identifier for finding the data we requested",
Expand All @@ -157,7 +157,7 @@ Response (from-bot):
All data fields are optional

Request (to-bot):
```json
```json5
{
"t": "FETCH_DATA",
"d": {
Expand All @@ -175,7 +175,7 @@ Request (to-bot):
}
```
Response (from-bot):
```json
```json5
{
"t": "FETCH_DATA",
"d": {
Expand Down

0 comments on commit d440c25

Please sign in to comment.