Crypto Tipping Bot for the SolanaSail Discord
- send SOL, gSAIL, SAIL to public keys or by tagging a discord user
- check your account balance
- help
- import-wallet pk
- register-wallet
- balance
- tipsol @user1 @user2 ... amount -m desc
- tipsail @user1 @user2 ... amount -m desc
- tipgsail @user1 @user2 ... amount -m desc
- rainsail amount maxpeople
- raingsail amount maxpeople
In a public channel, you can use the these commands. You can also use these commands in a private DM channel with the bot.
This is a persistent db. All it does is map discordIds to public keys. A user can use a command to save a public key for their discordId here. Then, users can send that user currency by simply tagging them in a message instead of having to write the public key.
Regular wallet offering functions such as inspecting balance or sending currency. Forwards calls to the selected Solana cluster.
Provides the current USD value of SOL and some other price-related functions.
- Go to the discord developer portal
https://discord.com/developers/applications
and create a new application - Create a new bot. You can also give it an avatar. You'll need the bot token for later!
- Go to
https://discord.com/oauth2/authorize?client_id=<YOUR_APPLICATION_CLIENT_ID>&scope=bot
to add the bot to your server.
- run
npm install
- run
npm install @solana/web3.js
- run
npm install @solana/spl-token
- run
npm install discord.js axios dotenv
- run
npm install base58
- run
npm install mongoose
- add a new
config
folder, insideconfig
, add anindex.js
file inside with the following content (DO NOT COMMIT THIS config folder. JUST IGNORE):
const CLUSTERS = {
MAINNET: 'mainnet-beta',
DEVNET: 'devnet',
TESTNET: 'testnet',
};
export const ACTIVE_CLUSTER=CLUSTERS.DEVNET;
export const COMMAND_PREFIX = '?';
export const DISCORD_TOKEN=<YOUR_BOT_TOKEN>
export const gSAIL_TOKEN_ADDRESS=''
export const SAIL_TOKEN_ADDRESS=''
export const SOL_Emoji='sol'
export const SAIL_Emoji='sail'
export const gSAIL_Emoji='gsail'
export const GUILD_ID=<YOUR_DISCORD_SERVER_ID>
export const LOG_CHANNEL_ID=<YOUR_DEDICATED_CHANNEL_ON_YOUR_DISCORD_SERVER>
- Open the cmd and type
node index.js