Skip to content

Commit

Permalink
sync plugin schema; remove octokit; add discord install instructions;…
Browse files Browse the repository at this point in the history
… chan/guild filters
  • Loading branch information
chrisdickinson committed Jul 10, 2024
1 parent 2c17788 commit 9cbb260
Show file tree
Hide file tree
Showing 11 changed files with 70 additions and 706 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ jobs:

- name: update the schema
run: |
body="$(jq -rcM -n --arg content "$(cat plugin.yaml)" '{"name":"chat", "schema": $content}')"
body="$(jq -rcM -n --arg content "$(cat plugin.yaml)" '{"name":"message_handler", "schema": $content}')"
EXTENSION_ID=ext_01j24z4yc2emetf0hysrnyg41j
curl -sLfi \
-H "Authorization: Bearer $XTP_TOKEN" \
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:

- name: test the schema
run: |
body="$(jq -rcM -n --arg content "$(cat plugin.yaml)" '{"name":"chatTest", "schema": $content}')"
body="$(jq -rcM -n --arg content "$(cat plugin.yaml)" '{"name":"message_handler_test", "schema": $content}')"
EXTENSION_ID=ext_01j24zpza4e63rzkz1pya80ey7
curl -sLfi \
-H "Authorization: Bearer $XTP_TOKEN" \
Expand Down
30 changes: 26 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,32 @@ as the credentials. (If you're running xtp locally, this should already be the
case!)

1. Copy `env.example` to `.env`.
2. Grab the `GITHUB_OAUTH_CLIENT_ID` and `OAUTH_GITHUB_SECRET`, `DISCORD_BOT_TOKEN` values from 1Password under `discordbot settings`.
- Optionally you can [set up another GitHub app](#setting-up-local-github-oauth)
- The link to install the Discord bot is also on 1password, this can be used to install the app on a private server
3. Link an XTP app.
2. Create a Discord test server for local dev.
3. Create a Discord app and bot.
- Click "New Application" on [the Discord dev portal](https://discord.com/developers/applications).
- Call it `xtp (local)`
- Navigate to the "Installation" drawer tab.
- Make sure only "Guild install" is checked.
- Under "default install settings":
- Scopes: Add "application.commands" and "bot".
- Permissions:
- Add Reactions
- Attach files
- Ban members
- Embed links
- Manage Messages
- Read message History
- Read messages / view channels
- Send Messages
- Use Slash commands
- To add the bot to your server, click the link under "Install Link".
- Navigate to the "Bot" drawer tab.
- Click the "Reset Token" button. **Save the token as `DISCORD_BOT_TOKEN`**.
- Uncheck "public bot".
- Check "PRESENCE INTENT".
- Check "SERVER MEMBERS INTENT".
- Check "MESSAGE CONTENT INTENT".
4. Link an XTP app.
- The app should be on staging or local.
- For local use `http://localhost:8080`.
- For staging use `https://xtp-staging.dylibso.com`
Expand Down
4 changes: 2 additions & 2 deletions env.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ FORCE_PRETTY_OUTPUT=true
COOKIE_REQUIRES_HTTPS="false"
HOST_ORIGIN="http://localhost:8124"
HOST_SECRET="motorhead's ace of spades from tony hawk pro skater 3 soundtrack"
OAUTH_GITHUB_CLIENT_ID="<go get one of these>"
OAUTH_GITHUB_SECRET="<go get one of these>"
PGURL="postgres://postgres:password@localhost/discordbot"
PORT=8124
SESSION_SECRET="If you like to gamble
Expand All @@ -24,3 +22,5 @@ EXTISM_ENABLE_WASI_OUTPUT="1"

DISCORD_BOT_TOKEN="<get from discord app>"
DISCORD_BOT_CLIENT_ID="<go get one of these>"
DISCORD_GUILD_FILTER="Discord Bot Demo Server"
DISCORD_CHANNEL_FILTER="<set this to your name>"
Loading

0 comments on commit 9cbb260

Please sign in to comment.