A feature-rich Vietnamese word-chain (Nối Từ) Discord bot built with discord.py.
It supports casual play, tournaments, ranking systems, anti-cheat, and database persistence.
-
🎮 Game Modes
- Normal mode: play casually or competitively with friends.
- Tournament mode: team-based competition with ranking and streak bonuses.
- Practice mode: play against the bot with multiple difficulty levels (easy → insane).
-
🧠 AI Opponent
- Built-in strategic bot using search algorithms (Negamax, IDDFS, heuristics).
- Supports difficulty levels:
easy,medium,hard,insane-min,insane-mid,insane-max.
-
🏆 Ranking System
- Individual rank points and streak tracking.
- Team leaderboard (Hall of Fame) with streaks and seasonal resets.
- Automatic bonus points for winning streaks.
-
🔒 Anti-Cheat
- Auto-play detection (too fast inputs).
- Rare/invalid word checks using frequency analysis and online dictionary validation.
- Warnings, auto-bans, and rank penalties for violators.
-
💾 Database Integration
- Persistent storage via SQLite (
databases.db). - Stores dictionary phrases, user stats, teams, and season info.
- Persistent storage via SQLite (
-
⚙️ Admin Tools
- Manage dictionary (
add_word,remove_word,reload_dict). - Control user stats (
set_rank,set_streak,ban,warn, etc.). - Manage tournaments and teams (
create_team,start_match,add_member, etc.).
- Manage dictionary (
git clone https://github.com/EndermanPC/Noi-Tu.git
cd Noi-Tupip install -r requirements.txt-
Open
main.py. -
Replace the placeholder admin ID:
ADMIN = 999999999999999999 # ❌ placeholder ADMIN = YOUR_DISCORD_ID # ✅ replace with your actual Discord ID
-
Replace the placeholder bot token:
bot.run("YOUR_DISCORD_BOT_TOKEN") # ❌ placeholder bot.run("MTnx...Vg") # ✅ replace with your actual Discord Bot Token
python main.py-
Python 3.9+
-
Dependencies (from
requirements.txt):discord.pyrequestswordfreq
NTstart→ start a new game.NTstop→ stop the current game (creator only).NTsurrender→ surrender the current game.NTrule→ show game rules.NTrank→ show personal ranking.NThalloffame→ show team leaderboard.NTstart_bot <difficulty>→ play against the bot.
(See in-bot NThelp or NTrule for the full command list.)
-
SQLite (
databases.db) is used to store:- Phrases dictionary
- User stats
- Team data
- Seasonal info
All data is auto-saved and loaded at runtime.
-
Ensure you replace the
ADMINID inmain.pywith your actual Discord user ID. -
The bot must be invited to your Discord server with the following permissions:
Send MessagesRead Message ContentAdd ReactionsManage Messages(optional for tournaments/admin commands).
If you want to try the bot with a pre-built dictionary and database,
please contact me directly and I will share the sample databases.db file.
-
Try the bot here: Invite Link
-
Contact me on Discord:
twentyzr
This project is released under the Apache License 2.0. Feel free to modify and use it for your own Discord servers.