diff options
Diffstat (limited to 'connect.sh')
-rw-r--r-- | connect.sh | 10 |
1 files changed, 4 insertions, 6 deletions
@@ -73,14 +73,12 @@ atrocity_loop() { atrocity_debug "Atrocity loop started before connection has been set up" exit 1 fi - atrocity_debug "Loop started" + atrocity_debug "Read loop started" while true; do local line local operator - atrocity_debug "Trying to read line" if read -r line; then - atrocity_debug "Reading message from discord: $line" - + echo "$line" >>raw_receive.log printf %s "$line" | jq 'if .s then .s else '"$(atrocity_sequence_get)"' end' >"$ATROCITY_SESSION"/sequence operator="$(printf %s "$line" | jq .op)" case "$operator" in @@ -91,10 +89,10 @@ atrocity_loop() { 10) # Hello atrocity_debug "Sending hello" echo "$(($(printf "%s" "$line" | jq -r .d.heartbeat_interval) / 1000))" >"$ATROCITY_SESSION"/heartbeat-interval - atrocity_gateway_send_raw '{"op":2,"d":{"token":"'$ATROCITY_TOKEN'", "properties":{"os":"linux","browser":"bash","device":"bash"},"presence":{"status":"online","afk":false, "activities":[{"type":0,"name":"Being coded in Bash"}]}, "intents":33287}}' + atrocity_gateway_send_raw '{"op":2,"d":{"token":"'$ATROCITY_TOKEN'", "properties":{"os":"linux","browser":"bash","device":"bash"},"presence":{"status":"online","afk":false, "activities":[{"type":0,"name":"Being coded in Bash"}]}, "intents":4609}}' ;; 0) # Dispatch - atrocity_dispatch "$line" + atrocity_on_dispatch "$line" ;; 1) # Heartbeat atrocity_heartbeat |