discord — work with the user's Discord account
This skill has two modes, picked automatically by which credential the
connector injected. Check the environment first and follow the matching section:
$DISCORD_USER_TOKENis set → User Token (BYOC) mode: full
personal-account actions via the scripts/discord_user.py CLI (list channels, read
messages, send / reply). This acts as the user's real account.
- only
$DISCORD_TOKENis set → OAuth mode: read-only identity + server
list via curl. Channel messages are not available in this mode.
if [ -n "$DISCORD_USER_TOKEN" ]; then echo "mode: user-token (full)"; \
elif [ -n "$DISCORD_TOKEN" ]; then echo "mode: oauth (read-only)"; \
else echo "no Discord connection — connect at https://studio.acedata.cloud/console/connectors"; fi
Both tokens are secret — full account access. Never echo or print them. On
401, the token expired or was revoked — tell the user to reconnect at
studio.acedata.cloud/console/connectors. On 429, sleep the retry_after
seconds, then retry; never parallelize.
User Token (BYOC) mode — full actions
When $DISCORD_USER_TOKEN is set, drive the user's real account through