-
Notifications
You must be signed in to change notification settings - Fork 157
feat(example): add discord wallet tracker bot #82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat(example): add discord wallet tracker bot #82
Conversation
``` | ||
|
||
> ✅ Make sure your Discord bot has permissions to **read and send messages** in the target channel. | ||
> ✅ You can get a free BscScan API key at [https://bscscan.com/myapikey](https://bscscan.com/myapikey) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’m
@@ -0,0 +1,140 @@ | |||
# 🤖 BSC Smart Contract Risk Agent |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not related to adding the Discord example — if it is, please remove it. Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the Discord wallet example, the Python files probably aren't necessary, right?
} | ||
} | ||
|
||
// Check mỗi 10 giây |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
English, please
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have removed the Vietnamese comment.
"version": "1.0.0", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add your scripts here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -0,0 +1,42 @@ | |||
require("dotenv").config(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the purpose of this file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file is used during development and debugging to watch wallet activity in real-time without running the main Discord bot logic. It polls the BscScan API every 10 seconds to detect new transactions on the specified wallet and logs the details to the console.
If you think this file is not necessary, I’m happy to remove it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can use tsx
instead.
Description
This PR adds a new example: Discord Wallet Tracker Bot — a TypeScript/Node.js application that listens to BNB Chain wallet transactions and posts real-time alerts to a specified Discord channel.
It uses:
This example helps developers learn how to build blockchain-integrated bots that communicate directly with communities.
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Set up the project locally using
npm install
and created a valid.env
file based on.env.example
with real credentials:Ran the bot using
npx ts-node index.ts
in development mode.Simulated both incoming and outgoing transactions on the monitored wallet:
Verified that:
Confirmed the bot remained stable after multiple transactions and had no crash or warning during runtime.
Checklist: