JOINCANE commited on
Commit
841924e
·
verified ·
1 Parent(s): 3574ffb

Upload 5 files

Browse files
001-B1-AI bot discord/README.md ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Steam Manifest Discord Bot
2
+
3
+ Discord Bot tạo manifest Steam với đầy đủ tính năng.
4
+
5
+ ## Tính năng
6
+ - `/gen appid` với autocomplete từ toàn bộ danh sách Steam
7
+ - Nhập AppID số → chạy thẳng
8
+ - Nhập đúng tên game (1 kết quả) → chạy thẳng
9
+ - Nhập tên game có nhiều kết quả → hiện **buttons chọn game**
10
+ - Download lua + manifest từ **HuggingFace** `Immaking/Luas`
11
+ - Kiểm tra DLC: so sánh DLC trong file lua với Steam API
12
+ - Cảnh báo Denuvo tự động
13
+ - Giới hạn **25 lượt/ngày/người** (SQLite)
14
+ - Keep-alive HTTP server cho **Render.com** (port 8080)
15
+
16
+ ## Cấu trúc file
17
+ ```
18
+ E:\ACN\
19
+ ├── bot.py ← Mã nguồn chính
20
+ ├── requirements.txt ← Thư viện Python
21
+ ├── render.yaml ← Config deploy Render.com
22
+ ├── README.md ← File này
23
+ └── bot_data.db ← Database quota (tự tạo khi chạy)
24
+ ```
25
+
26
+ ## Chạy local
27
+ ```powershell
28
+ pip install -r requirements.txt
29
+ python bot.py
30
+ ```
31
+
32
+ ## Deploy lên Render.com
33
+
34
+ 1. Push toàn bộ code lên **GitHub repo**:
35
+ ```powershell
36
+ git init
37
+ git add .
38
+ git commit -m "Initial bot"
39
+ git remote add origin https://github.com/<your-username>/<repo-name>.git
40
+ git push -u origin main
41
+ ```
42
+
43
+ 2. Vào [render.com](https://render.com) → **New → Web Service**
44
+ 3. Kết nối GitHub repo của bạn
45
+ 4. Render sẽ tự đọc `render.yaml` và deploy
46
+
47
+ ## Cấu hình UptimeRobot (giữ bot online 24/7)
48
+
49
+ > Render free tier sẽ tắt sau 15 phút không có request.
50
+ > UptimeRobot ping mỗi 5 phút để giữ bot sống.
51
+
52
+ 1. Vào [uptimerobot.com](https://uptimerobot.com) → **Add New Monitor**
53
+ 2. Monitor Type: **HTTP(s)**
54
+ 3. Friendly Name: `Steam Manifest Bot`
55
+ 4. URL: `https://<tên-service-của-bạn>.onrender.com` (lấy từ Render dashboard)
56
+ 5. Monitoring Interval: **5 minutes**
57
+ 6. Click **Create Monitor**
58
+
59
+ Bot sẽ luôn online 24/7 nhờ UptimeRobot ping liên tục.
001-B1-AI bot discord/assign_role.py ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import urllib.request
2
+ import json
3
+ import sys
4
+
5
+ TOKEN = "MTQ5MjE1MjY3NjE2NTg4MTkzOA.GI8SfV.VkzlCX64fdt2Ri3IMVnLYscVbKPFwiqqBGR1Go"
6
+ GUILD_ID = "1492076309323714570"
7
+ TARGET_ID = "1509899252686520481"
8
+ ROLE_NAME = "NIGGA"
9
+
10
+ headers = {
11
+ "Authorization": f"Bot {TOKEN}",
12
+ "User-Agent": "DiscordBot"
13
+ }
14
+
15
+ # 1. Fetch roles
16
+ req = urllib.request.Request(f"https://discord.com/api/v10/guilds/{GUILD_ID}/roles", headers=headers)
17
+ try:
18
+ with urllib.request.urlopen(req) as response:
19
+ roles = json.loads(response.read().decode())
20
+ except Exception as e:
21
+ print("Failed to fetch roles:", e)
22
+ sys.exit(1)
23
+
24
+ role_id = None
25
+ for role in roles:
26
+ if role["name"].lower() == ROLE_NAME.lower():
27
+ role_id = role["id"]
28
+ break
29
+
30
+ if not role_id:
31
+ print(f"Role '{ROLE_NAME}' not found.")
32
+ sys.exit(1)
33
+
34
+ # 2. Add role
35
+ url = f"https://discord.com/api/v10/guilds/{GUILD_ID}/members/{TARGET_ID}/roles/{role_id}"
36
+ req = urllib.request.Request(url, headers=headers, method='PUT')
37
+ try:
38
+ with urllib.request.urlopen(req) as response:
39
+ if response.status == 204:
40
+ print(f"Successfully added role '{ROLE_NAME}'!")
41
+ except urllib.error.HTTPError as e:
42
+ print(f"Failed to add role. Status: {e.code}, Reason: {e.read().decode()}")
001-B1-AI bot discord/bot.py ADDED
The diff for this file is too large to render. See raw diff
 
001-B1-AI bot discord/render.yaml ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ services:
2
+ - type: web
3
+ name: steam-manifest-bot
4
+ env: python
5
+ region: singapore
6
+ plan: free
7
+ buildCommand: pip install -r requirements.txt
8
+ startCommand: python bot.py
9
+ envVars:
10
+ - key: PORT
11
+ value: 8080
001-B1-AI bot discord/requirements.txt ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ discord.py>=2.3.0
2
+ aiohttp>=3.9.0
3
+ requests>=2.31.0
4
+ huggingface_hub>=0.20.0
5
+ deep-translator>=1.11.4
6
+ python-dateutil>=2.8.0
7
+ cloudscraper>=1.2.71