Mabinogi Auction House Watcher using Discord Bot + MongoDB Atlas
This Discord Bot query items from MabiBase and alert to the Discord channel if new item was added that matches the alert criteria. This has the same function as MabiBase built-in alert bot. However, MabiBase bot has a 5 minutes alert interval and send alerts to everyone who subscribes to its alerting function. Thus, the popular items are hotly contested and very difficult to buy at a good price.
This bot alert faster than the MabiBase built-in alerting function as this will constantly watching the database and checking items from the alert list. This will give an advantage edge in the game when buying items at a good price.
demo.mp4
When an item is posted on Auction House and matches our criteria:
- Navigate to https://discord.com/developers/applications to create a new bot
- Click on
New Applicationon top right - Enter name for your Discord bot, accept ToS and click
Create - Go to
OAuth2tab on the left and perform the following:
- Under
Client Information:- Click on
Reset Secret
- Click on
- Under
OAuth2 URL Generator:- Check
Bot
- Check
- Under
Bot Permissions:- Check
Administrator
- Check
- Under
Integration Type:- Select
Guild Install
- Select
- This will generate an invite link. Copy this and paste to your browser. Select the server you want to add this bot to and click
Continueand thenAuthorize - Go back to the Developer Portal. Go to
Installationon the left and selectNonein the dropdown underInstall Link - Go to
Bottab on the left and perform the following:
- Under
Authorization Flow:- Disable
Public Bot - Enable
Requires OAUTH2 Code Grant
- Disable
- Under
Priviledged Gateway Intents:- Enable
Presence Intent - Enable
Server Members Intent - Enable
Message Content Intent
- Enable
- Under
Bot Permissions:- Check
Administrator
- Check
- Generate a
Tokenby going toBottab and click onReset TokenunderToken. Save this token to use for the app.
-
Sign up an account for a free shared resource pool MongoDB Atlas database: https://www.mongodb.com/cloud/atlas/register
-
Once you've created an account and login to https://cloud.mongodb.com/, click on
Createbutton underCreate a cluster -
Select the
M0free cluster, name the cluster and pick your favorite provider. Then clickCreate Deployment
-
Click on
Quick StartunderSecurityon the left hand bars -
Create an
usernameandpasswordfor your database. Then scroll down and click onAdd My Current IP Addressto the IP Address List. You can add0.0.0.0/0if you want to expose the database to everyone or if your ISP IP is not static.
-
On the Clusters menu, click on
Connecton your new cluster
-
Select
DriversunderConnect to your application -
On the next page, select
Pythonunder Driver and use the latest Stable API -
Save the connection string to use for the app. Modify it with the password as instructed.
- Clone this repo
git clone https://github.com/dqle/mabi-ah-discord.git
- Create a
.envfile containing the following:
DISCORD_API_TOKEN = ""
DISCORD_SERVER_ID = ""
DISCORD_CHANNEL_ID = ""
MONGODB_CONNECTION_STRING = ""
DISCORD_API_TOKENis generated from step 8 of Creating and Inviting a Private Discord Bot SectionDISCORD_SERVER_IDcan be found by right click your server where you add the bot and clickCopy Server IDDISCORD_CHANNEL_IDis the channel where you want the alert to go to. This can be found by right click your channel and clickCopy Channel IDMONGODB_CONNECTION_STRINGis generated from step 8 of Creating a free MongoDB Atlas instance Section
- Install requirements and run the program:
pip install -r .\requirements.txt
python.exe .\main.py #Windows
-
Copy the
docker-compose.yamlfile -
In the same directory as the
docker-compose.yaml. Create a.envfile containing the following:
DISCORD_API_TOKEN = ""
DISCORD_SERVER_ID = ""
DISCORD_CHANNEL_ID = ""
MONGODB_CONNECTION_STRING = ""
DISCORD_API_TOKENis generated from step 8 of Creating and Inviting a Private Discord Bot SectionDISCORD_SERVER_IDcan be found by right click your server where you add the bot and clickCopy Server IDDISCORD_CHANNEL_IDis the channel where you want the alert to go to. This can be found by right click your channel and clickCopy Channel IDMONGODB_CONNECTION_STRINGis generated from step 8 of Creating a free MongoDB Atlas instance Section
- Run docker compose:
docker compose up -d
- Create a
values.yamlfile containing the following:
env:
DISCORD_API_TOKEN = ""
DISCORD_SERVER_ID = ""
DISCORD_CHANNEL_ID = ""
MONGODB_CONNECTION_STRING = ""
DISCORD_API_TOKENis generated from step 8 of Creating and Inviting a Private Discord Bot SectionDISCORD_SERVER_IDcan be found by right click your server where you add the bot and clickCopy Server IDDISCORD_CHANNEL_IDis the channel where you want the alert to go to. This can be found by right click your channel and clickCopy Channel IDMONGODB_CONNECTION_STRINGis generated from step 8 of Creating a free MongoDB Atlas instance Section
- Add helm chart:
helm repo add dqle https://dqle.github.io/helm-charts/
helm repo update
- Install helm chart:
helm install mabi-ah-discord dqle/mabi-ah-discord -f values.yaml -n mabi-ah-discord --create-namespace
