-
Create a bot and retrieve the token. How to Get a Discord Bot Token. It should have the following permissions:
- Send Messages
- Read Message History
-
Add token to
.env
file with nameDISCORD_TOKEN
. -
Get memes channel id from Discord and add it to
.env
file with nameDISCORD_MEMES_CHANNEL_ID
. -
Go to Twitter developer portal and retrieve the tokens and save them to
.env
:TWITTER_ACCESS_TOKEN
TWITTER_ACCESS_TOKEN_SECRET
TWITTER_API_KEY
TWITTER_API_KEY_SECRET
-
Access AWS and retrieve the access key, secret, region, and bucket name. Save them to
.env
file with the following names:AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY
AWS_REGION
AWS_BUCKET_NAME
Once you have all the tokens, you can run the bot locally with npm run dev
.
To run the bot locally and watch for changes, run:
npm run dev
To run the bot locally without watching for changes, run:
npm run start
To run the tests, run:
npm test
We use PM2 to run and keep soseramemes online. Provisioning the server:
sudo apt update
sudo apt install curl
curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
source ~/.bashrc
nvm install node 20 # As of November 2023
Cloning the project via HTTPS:
git clone https://github.com/arantespp/soseramemes.git
Now, to start the server, run:
npm install
npm run server:start
To check the logs, run:
npm run server:logs
If you want to check only error logs, run:
npm run server:logs --err
To check PM2 status, run:
pm2 status
To configure the deploy, add the following variable to the .env
file on the server:
WEBHOOK_SECRET
: The secret used to verify the webhook.