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 Application
on top right - Enter name for your Discord bot, accept ToS and click
Create
- Go to
OAuth2
tab 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
Continue
and thenAuthorize
- Go back to the Developer Portal. Go to
Installation
on the left and selectNone
in the dropdown underInstall Link
- Go to
Bot
tab 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
Token
by going toBot
tab and click onReset Token
underToken
. 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
Create
button underCreate a cluster
-
Select the
M0
free cluster, name the cluster and pick your favorite provider. Then clickCreate Deployment
-
Click on
Quick Start
underSecurity
on the left hand bars -
Create an
username
andpassword
for your database. Then scroll down and click onAdd My Current IP Address
to the IP Address List. You can add0.0.0.0/0
if you want to expose the database to everyone or if your ISP IP is not static. -
On the Clusters menu, click on
Connect
on your new cluster -
Select
Drivers
underConnect to your application
-
On the next page, select
Python
under 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
.env
file containing the following:
DISCORD_API_TOKEN = ""
DISCORD_SERVER_ID = ""
DISCORD_CHANNEL_ID = ""
MONGODB_CONNECTION_STRING = ""
DISCORD_API_TOKEN
is generated from step 8 of Creating and Inviting a Private Discord Bot SectionDISCORD_SERVER_ID
can be found by right click your server where you add the bot and clickCopy Server ID
DISCORD_CHANNEL_ID
is the channel where you want the alert to go to. This can be found by right click your channel and clickCopy Channel ID
MONGODB_CONNECTION_STRING
is 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.yaml
file -
In the same directory as the
docker-compose.yaml
. Create a.env
file containing the following:
DISCORD_API_TOKEN = ""
DISCORD_SERVER_ID = ""
DISCORD_CHANNEL_ID = ""
MONGODB_CONNECTION_STRING = ""
DISCORD_API_TOKEN
is generated from step 8 of Creating and Inviting a Private Discord Bot SectionDISCORD_SERVER_ID
can be found by right click your server where you add the bot and clickCopy Server ID
DISCORD_CHANNEL_ID
is the channel where you want the alert to go to. This can be found by right click your channel and clickCopy Channel ID
MONGODB_CONNECTION_STRING
is generated from step 8 of Creating a free MongoDB Atlas instance Section
- Run docker compose:
docker compose up -d
- Create a
values.yaml
file containing the following:
env:
DISCORD_API_TOKEN = ""
DISCORD_SERVER_ID = ""
DISCORD_CHANNEL_ID = ""
MONGODB_CONNECTION_STRING = ""
DISCORD_API_TOKEN
is generated from step 8 of Creating and Inviting a Private Discord Bot SectionDISCORD_SERVER_ID
can be found by right click your server where you add the bot and clickCopy Server ID
DISCORD_CHANNEL_ID
is the channel where you want the alert to go to. This can be found by right click your channel and clickCopy Channel ID
MONGODB_CONNECTION_STRING
is 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