Skip to content

Commit

Permalink
docs: updating discord docs (#476)
Browse files Browse the repository at this point in the history
* docs: updated discord docs

Added two images and changed the spacing to get the list to render properly.

* docs: added warning about message-intent

* docs: discord bot - new images and instructions

* docs: sourcing guild and channel ids

* docs: added bot verification image

* docs: update spacing on ordered list

---------

Co-authored-by: Nolan Jacobson <50815660+nolanjacobson@users.noreply.github.com>
  • Loading branch information
theMultitude and nolanjacobson authored Aug 5, 2024
1 parent 402a069 commit 2cc68e2
Show file tree
Hide file tree
Showing 13 changed files with 71 additions and 8 deletions.
Binary file added docs/images/discord-add-bot-to-server.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/discord-change-bot-permissions-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/discord-change-bot-permissions.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/discord-copy-bot-token.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/discord-create-a-new-application.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/discord-get-all-guilds.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/discord-get-guild-channels.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/discord-install-link.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/discord-message-content-intent.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/discord-verify-bot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 18 additions & 4 deletions docs/oracle-node/discord-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,20 @@ The Service Manager assesses the request and delegates the task to the appropria

## Discord Endpoints

The API provides one endpoint for interacting with Discord user data:
### Getting Guild and Channel IDs

To get all guilds (and their IDs) you can use the `/data/discord/guilds/all` endpoint.

> ![Get Guilds](../images/discord-get-all-guilds.png)
With the guild ID you can then use the `/data/discord/guilds/{guildID}/channels` endpoint to get all channels for that guild.

> ![Get Channels](../images/discord-get-guild-channels.png)
### Retrieve User Profile

The API provides one endpoint for interacting with Discord user data:

The `/data/discord/users/{userID}` endpoint retrieves a Discord user's profile. This can be particularly useful for understanding user demographics, personalizing interactions, or for further analysis in combination with other data points.

- **Endpoint:** `/data/discord/users/{userID}`
Expand Down Expand Up @@ -63,6 +73,10 @@ Example response:

### Retrieve Messages from a Discord Channel

> **Important**: To retrieve message content, you must toggle "Message Content Intent" in the Discord Developer Portal under the `Bot` section.
>
> ![Message Content Intent](../images/discord-message-content-intent.png)
The `/data/discord/channels/{channelID}/messages` endpoint retrieves messages from a specified Discord channel.

- **Endpoint:** `/data/discord/channels/{channelID}/messages`
Expand Down Expand Up @@ -162,11 +176,11 @@ Imagine a decentralized AI agent, "CommunityEngageAI," designed to analyze engag

### How CommunityEngageAI Leverages AI

1. **Data Collection:** CommunityEngageAI sends queries to the various endpoints to fetch profiles of active community members, messages from channels, and other relevant data.
1 . **Data Collection:** CommunityEngageAI sends queries to the various endpoints to fetch profiles of active community members, messages from channels, and other relevant data.

2. **Engagement Analysis:** Upon retrieving the data, CommunityEngageAI employs AI models to analyze engagement patterns, identify key influencers, and understand user demographics.
2 . **Engagement Analysis:** Upon retrieving the data, CommunityEngageAI employs AI models to analyze engagement patterns, identify key influencers, and understand user demographics.

3. **Personalized Interactions:** Leveraging the insights gained, CommunityEngageAI customizes interactions with community members, tailoring messages and content to enhance engagement and user satisfaction.
3 . **Personalized Interactions:** Leveraging the insights gained, CommunityEngageAI customizes interactions with community members, tailoring messages and content to enhance engagement and user satisfaction.

### Conclusion

Expand Down
4 changes: 4 additions & 0 deletions docs/oracle-node/discord-sentiment.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ The Discord sentiment analysis feature extends the Masa Node's capabilities to i

The sentiment analysis process begins by collecting Discord messages based on specific channel IDs, followed by sentiment evaluation using the chosen language models. The system is compatible with a variety of models, such as Claude and GPT variants, ensuring versatile and robust sentiment analysis.

> **Important**: To retrieve message content, you must toggle "Message Content Intent" in the Discord Developer Portal under the `Bot` section.
>
> ![Message Content Intent](../images/discord-message-content-intent.png)
### Models

```go
Expand Down
53 changes: 49 additions & 4 deletions docs/worker-node/discord-worker.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,63 @@ As a worker in the Masa Oracle Node network, your primary function is to process
To become a worker focused on Discord data requests, you need to:

- Have your Masa Oracle Node staked as outlined in the [Staking Guide for Masa Oracle Node](staking-guide.md).
- Create a Discord bot as outlined in the [Creating a Discord Bot](#creating-a-discord-bot) section.
- Add your Discord bot token to your node's `.env` file. This is crucial for authenticating with the Discord API and fetching data.
- Ensure your Masa Oracle Node is up and running, with network accessibility for receiving and processing requests.

## Retrieving Your Discord Bot Token
## Creating a Discord Bot

### Create a new Bot Application

To start processing Discord data requests, you need to retrieve your Discord bot token, which is essential for authenticating with the Discord API. This token will allow your bot to collect data on your guild. Here's how to get your token:

1 . Go to the [Discord Developer Portal](https://discord.com/developers/applications).

2 . Log in with your Discord account credentials.

3 . Click on the "New Application" button. Give your application a name and confirm the creation.
4 . Navigate to the "Bot" tab on the left-hand side and click on "Reset Token".
5 . Under the "TOKEN" section, click on "Copy" to get your bot token.

> ![Create a New Application](../images/discord-create-a-new-application.png)
### Update Bot permissions and install

1 . Go to the “Guild Install” section

2 . Select on dropdown where is says “applications.commands and select “bot”

> ![Update Bot Permissions](../images/discord-change-bot-permissions.png)
3 . On the added permission dropdown after selecting bot, select “administrator”

4 . Save changes on the bottom floating bar.

> ![Save Bot Permissions](../images/discord-change-bot-permissions-2.png)
5 . Copy the install link

> ![Copy Install Link](../images/discord-install-link.png)
6 . Go to a new tab on your browser and paste the link and then hit enter

7 . You will go to Discord and see a modal click on add to server

8 . Select add to server dropdown and select the guild to add your new bot to your guild.

> <img src="../images/discord-add-bot-to-server.png" alt="Description" width="400"/>
9 . Click “Continue”

10 . Click Authorize to add your bot. Congrats screen and should see Bot on Discord now!

> ![Bot Added](../images/discord-verify-bot.png)
### Retrieving Your Discord Bot Token

1 . Navigate to the "Bot" tab on the left-hand side and click on "Reset Token".

2 . Under the "TOKEN" section, click on "Copy" to get your bot token.

> ![Copy Token](../images/discord-copy-bot-token.png)
### Adding Discord Credentials

Expand All @@ -48,7 +93,7 @@ DISCORD_BOT_TOKEN='your_discord_bot_token'
DISCORD_SCRAPER=true
```

3 . Save the `.env` file and restart your node to apply the changes.
3 . Save the `.env` file and restart your node (`make run`) to apply the changes.

### 3) Verifying Node Configuration

Expand Down

0 comments on commit 2cc68e2

Please sign in to comment.