GraphShaggingBot is a Discord bot made for my friend group discord server that fetches and displays your holdings from the Trading212 API.
- Slash command
/holdingsto fetch and display your Trading212 holdings. (WIP) - Slash command
/checkapito verify Trading212 API connectivity. - Slash command
/setapikeyto securely set your personal Trading212 API key. - Multi-user support: Each user can set their own API key privately.
- Node.js
- A Discord bot token
- Your Discord application's client ID and guild ID
- Each user needs their own Trading212 API key (With the 'Portfolio' permission enabled)
git clone https://github.com/gekklee/GraphShaggingBot.git
cd GraphShaggingBotnpm installCreate a .env file in the root directory and add the following keys:
DISCORD_TOKEN=your_discord_bot_token
DISCORD_CLIENT_ID=your_discord_client_id
DISCORD_GUILD_ID=your_discord_guild_id
Replace the placeholders with your actual values:
DISCORD_TOKEN: Your Discord bot token.DISCORD_CLIENT_ID: Your Discord application's client ID.DISCORD_GUILD_ID: The ID of the Discord server where the bot will be used.
Start the bot using the following command:
node bot.js- Each user should first use the
/setapikeycommand to privately set their Trading212 API key. The key will be stored securely and not visible in chat. - Use the
/holdingscommand to fetch and display your Trading212 holdings. - Use the
/checkapicommand to verify if your Trading212 API key is working properly.
This project is licensed under the GNU General Public License v3.0. See the LICENSE file for details.