A Discord tipping bot for SmileyCoin
-
Get Ubuntu 20.04
-
Set up a core smileycoin wallet, put
smileycoin-cliandsmileycoindinto $PATH -
Append
walletnotify=/home/<yourusername>/bin/readIncoming %sto ~/.smileycoin/smileycoin.conf -
Create a readIncoming file with these contents in ~/bin/:
#!/bin/bash
#
TxId="$1"
exists=`grep $TxId /home/<yourusername>/SmileyCoinBot/deposits/myTransactionId`
if [ X"$exists" = X ]
then
echo $1 >> /home/<yourusername>/SmileyCoinBot/deposits/myTransactionId
Tx=`smileycoin-cli getrawtransaction $TxId`
smileycoin-cli decoderawtransaction $Tx > /home/<yourusername>/SmileyCoinBot/deposits/myTransaction.$$
fi- Start a server in the background with
smileycoind --server &
-
Go to Discord Developers
-
Create an application
-
Note down the Client ID
-
Go to "Bot" and press "Reset token". Store this token inside .env as
TOKEN=<token> -
Under "Privileged Gateway Intents", toggle
Presence Intent,Server Members IntentandMessage Content Intent -
Go to "OAuth2", note down the Client ID, go to -> Url Generator
-
Select
botandapplication.commandsin the "Scope" box -
Select
Send Messagesin the "Bot Permissions" box. -
Copy the url and go to link to invite your bot to your server
-
-
-
Clone the repository to your root folder
/home/<yourusername>/-
Use
npm installto install the dependencies -
Install nodejs
-
-
Make a .env file with the following information:
TOKEN=yourbottoken
CLIENTID=yourclientid- run
node bot.js. Bot will join the server and be up as long as the app is being run.
-
/help- List commands -
/deposit- Create a virtual wallet -
/setaddress- Set a withdrawal address -
/getaddress- Get deposit address -
/withdraw- Withdraw smileys from your wallet -
/balance- Check virtual wallet balance -
/tip- Send Smileys to Discord users