upload gitea
This commit is contained in:
commit
6747dbacb8
13 files changed
+1074
No files matched your search
+14
@@ -0,0 +1,14 @@
|
||||
# Secrets
|
||||
.env
|
||||
command.txt
|
||||
|
||||
# User data
|
||||
data/*.csv
|
||||
|
||||
# Python
|
||||
__pycache__/
|
||||
*.pyc
|
||||
|
||||
# Jupyter
|
||||
.ipynb_checkpoints/
|
||||
*.ipynb
|
||||
@@ -0,0 +1,5 @@
|
||||
FROM python:3.11-slim
|
||||
WORKDIR /app
|
||||
COPY . .
|
||||
RUN pip install --no-cache-dir pytz -r requirements.txt
|
||||
CMD ["python", "main.py"]
|
||||
@@ -0,0 +1,2 @@
|
||||
USER_SIGNIN = "./data/User_Data.csv"
|
||||
SERVER_SETTING = "./data/Server_Sets_Data.csv"
|
||||
@@ -0,0 +1,84 @@
|
||||
import csv
|
||||
import os
|
||||
|
||||
def create_user_data(user_id: int):
|
||||
file_path = "./data/User_Data.csv"
|
||||
fieldnames = ["ID", "total_coin", "last_signin", "total_signin", "exp"]
|
||||
|
||||
new_row = {
|
||||
"ID": str(user_id),
|
||||
"total_coin": "0",
|
||||
"last_signin": "0",
|
||||
"total_signin": "0",
|
||||
"exp": "0"
|
||||
}
|
||||
|
||||
_append_row(file_path, fieldnames, new_row)
|
||||
print(f"[Create.py] 已建立 User_Data 資料:{user_id}")
|
||||
|
||||
def create_user_achievement(user_id: int):
|
||||
file_path = "./data/User_Achievement.csv"
|
||||
fieldnames = ["ID", "achi_1", "achi_2", "achi_3", "achi_4", "achi_5", "achi_6", "achi_7"]
|
||||
|
||||
new_row = {
|
||||
"ID": str(user_id),
|
||||
"achi_1": "0",
|
||||
"achi_2": "0",
|
||||
"achi_3": "0",
|
||||
"achi_4": "0",
|
||||
"achi_5": "0",
|
||||
"achi_6": "0",
|
||||
"achi_7": "0"
|
||||
}
|
||||
|
||||
_append_row(file_path, fieldnames, new_row)
|
||||
print(f"[Create.py] 已建立 User_Achievement 資料:{user_id}")
|
||||
|
||||
def create_user_backpack(user_id: int):
|
||||
file_path = "./data/User_Backpack.csv"
|
||||
fieldnames = [
|
||||
"ID", "case", "cpu", "mother_board", "ram", "gpu", "fan", "psu", "hdd",
|
||||
"white_shark", "red_shark", "orange_shark", "yellow_shark", "green_shark",
|
||||
"blue_shark", "purple_shark", "gray_shark", "black_shark", "rgb_shark",
|
||||
"my_left_hand", "my_right_hand", "my_hair", "my_left_leg", "my_right_leg",
|
||||
"my_body", "my_head", "bed", "pillow", "quilt", "ac", "chair", "desk",
|
||||
"laptop", "screen", "phone", "plug", "wig", "pants", "top", "dress",
|
||||
"sleeve_cover", "stocking", "pantyhose", "bow", "hair_accessories", "cosmetics"
|
||||
]
|
||||
|
||||
# 初始化新行資料
|
||||
new_row = {key: "0" for key in fieldnames}
|
||||
new_row["ID"] = str(user_id)
|
||||
|
||||
# 檢查檔案是否存在,若不存在則先建立檔案與欄位標題
|
||||
file_exists = os.path.isfile(file_path)
|
||||
with open(file_path, mode="a", newline="", encoding="utf-8") as csvfile:
|
||||
writer = csv.DictWriter(csvfile, fieldnames=fieldnames)
|
||||
if not file_exists:
|
||||
writer.writeheader()
|
||||
writer.writerow(new_row)
|
||||
|
||||
print(f"[Create.py] 已建立 User_Backpack 資料:{user_id}")
|
||||
|
||||
|
||||
def create_server_setting(server_id: int):
|
||||
file_path = "./data/Server_Setting.csv"
|
||||
fieldnames = ["Server_ID", "signin_channel", "signin_emoji"]
|
||||
|
||||
new_row = {
|
||||
"Server_ID": str(server_id),
|
||||
"signin_channel": "default",
|
||||
"signin_emoji": "🪙"
|
||||
}
|
||||
|
||||
_append_row(file_path, fieldnames, new_row)
|
||||
print(f"[Create.py] 已建立 Server_Setting 資料:{server_id}")
|
||||
|
||||
# 負責寫入
|
||||
def _append_row(file_path, fieldnames, new_row):
|
||||
file_exists = os.path.isfile(file_path)
|
||||
with open(file_path, mode="a", newline="", encoding="utf-8") as csvfile:
|
||||
writer = csv.DictWriter(csvfile, fieldnames=fieldnames)
|
||||
if not file_exists or os.stat(file_path).st_size == 0:
|
||||
writer.writeheader()
|
||||
writer.writerow(new_row)
|
||||
+159
@@ -0,0 +1,159 @@
|
||||
import csv
|
||||
|
||||
def load_user_data(ID):
|
||||
try:
|
||||
with open("./data/User_Data.csv", mode="r", newline="", encoding="utf-8") as csvfile:
|
||||
reader = csv.DictReader(csvfile)
|
||||
for row in reader:
|
||||
if row["ID"] == str(ID):
|
||||
user_data = {
|
||||
"ID": row["ID"],
|
||||
"total_coin": int(row["total_coin"]),
|
||||
"last_signin": row["last_signin"],
|
||||
"total_signin": int(row["total_signin"]),
|
||||
"exp": int(row["exp"])
|
||||
}
|
||||
return user_data
|
||||
# 如果沒找到該ID
|
||||
print(f"[Load.py] 使用者 ID {ID} 不存在於 User_Data.csv 中。")
|
||||
return None
|
||||
except FileNotFoundError:
|
||||
print("[Load.py] 找不到 User_Data.csv 檔案。")
|
||||
return None
|
||||
|
||||
def load_user_achievement(ID):
|
||||
try:
|
||||
with open("./data/User_Achievement.csv", mode="r", newline="", encoding="utf-8") as csvfile:
|
||||
reader = csv.DictReader(csvfile)
|
||||
for row in reader:
|
||||
if row["ID"] == str(ID):
|
||||
user_achievement = {
|
||||
"ID": row["ID"],
|
||||
"achi_1": int(row["achi_1"]),
|
||||
"achi_2": int(row["achi_2"]),
|
||||
"achi_3": int(row["achi_3"]),
|
||||
"achi_4": int(row["achi_4"]),
|
||||
"achi_5": int(row["achi_5"]),
|
||||
"achi_6": int(row["achi_6"]),
|
||||
"achi_7": int(row["achi_7"])
|
||||
}
|
||||
return user_achievement
|
||||
# 如果沒找到該ID
|
||||
print(f"[Load.py] 使用者 ID {ID} 不存在於 User_Achievement.csv 中。")
|
||||
return None
|
||||
except FileNotFoundError:
|
||||
print("[Load.py] 找不到 User_Achievement.csv 檔案。")
|
||||
return None
|
||||
|
||||
def load_user_backpack(ID):
|
||||
try:
|
||||
with open("./data/User_Backpack.csv", mode="r", newline="", encoding="utf-8") as csvfile:
|
||||
reader = csv.DictReader(csvfile)
|
||||
for row in reader:
|
||||
if row["ID"] == str(ID):
|
||||
user_backpack = {
|
||||
"ID": row["ID"],
|
||||
"case": int(row["case"]),
|
||||
"cpu": int(row["cpu"]),
|
||||
"mother_board": int(row["mother_board"]),
|
||||
"ram": int(row["ram"]),
|
||||
"gpu": int(row["gpu"]),
|
||||
"fan": int(row["fan"]),
|
||||
"psu": int(row["psu"]),
|
||||
"hdd": int(row["hdd"]),
|
||||
"white_shark": int(row["white_shark"]),
|
||||
"red_shark": int(row["red_shark"]),
|
||||
"orange_shark": int(row["orange_shark"]),
|
||||
"yellow_shark": int(row["yellow_shark"]),
|
||||
"green_shark": int(row["green_shark"]),
|
||||
"blue_shark": int(row["blue_shark"]),
|
||||
"purple_shark": int(row["purple_shark"]),
|
||||
"gray_shark": int(row["gray_shark"]),
|
||||
"black_shark": int(row["black_shark"]),
|
||||
"rgb_shark": int(row["rgb_shark"]),
|
||||
"my_left_hand": int(row["my_left_hand"]),
|
||||
"my_right_hand": int(row["my_right_hand"]),
|
||||
"my_hair": int(row["my_hair"]),
|
||||
"my_left_leg": int(row["my_left_leg"]),
|
||||
"my_right_leg": int(row["my_right_leg"]),
|
||||
"my_body": int(row["my_body"]),
|
||||
"my_head": int(row["my_head"]),
|
||||
"bed": int(row["bed"]),
|
||||
"pillow": int(row["pillow"]),
|
||||
"quilt": int(row["quilt"]),
|
||||
"ac": int(row["ac"]),
|
||||
"chair": int(row["chair"]),
|
||||
"desk": int(row["desk"]),
|
||||
"laptop": int(row["laptop"]),
|
||||
"screen": int(row["screen"]),
|
||||
"phone": int(row["phone"]),
|
||||
"plug": int(row["plug"]),
|
||||
"wig": int(row["wig"]),
|
||||
"pants": int(row["pants"]),
|
||||
"top": int(row["top"]),
|
||||
"dress": int(row["dress"]),
|
||||
"sleeve_cover": int(row["sleeve_cover"]),
|
||||
"stocking": int(row["stocking"]),
|
||||
"pantyhose": int(row["pantyhose"]),
|
||||
"bow": int(row["bow"]),
|
||||
"hair_accessories": int(row["hair_accessories"]),
|
||||
"cosmetics": int(row["cosmetics"]),
|
||||
}
|
||||
return user_backpack
|
||||
# 如果沒找到該ID
|
||||
print(f"[Load.py] 使用者 ID {ID} 不存在於 User_Backpack.csv 中。")
|
||||
return None
|
||||
except FileNotFoundError:
|
||||
print("[Load.py] 找不到 User_Backpack.csv 檔案。")
|
||||
return None
|
||||
|
||||
def load_server_setting(ID):
|
||||
try:
|
||||
with open("./data/Server_Setting.csv", mode="r", newline="", encoding="utf-8") as csvfile:
|
||||
reader = csv.DictReader(csvfile)
|
||||
for row in reader:
|
||||
if row["Server_ID"] == str(ID):
|
||||
# 根據字串決定是否轉成 int
|
||||
signin_channel_raw = row["signin_channel"]
|
||||
if signin_channel_raw == "default":
|
||||
signin_channel = "default"
|
||||
else:
|
||||
signin_channel = int(signin_channel_raw)
|
||||
|
||||
server_setting = {
|
||||
"Server_ID": row["Server_ID"],
|
||||
"signin_channel": signin_channel,
|
||||
"signin_emoji": row["signin_emoji"]
|
||||
}
|
||||
return server_setting
|
||||
print(f"[Load.py] 伺服器 ID {ID} 不存在於 Server_Setting.csv 中。")
|
||||
return None
|
||||
except FileNotFoundError:
|
||||
print("[Load.py] 找不到 Server_Setting.csv 檔案。")
|
||||
return None
|
||||
|
||||
|
||||
def get_signin_count(user_id: str) -> int:
|
||||
user_data = load_user_data(user_id)
|
||||
if user_data:
|
||||
return user_data.get("total_signin", 0)
|
||||
return 0
|
||||
|
||||
def get_coin_count(user_id: str) -> int:
|
||||
user_data = load_user_data(user_id)
|
||||
if user_data:
|
||||
return user_data.get("total_coin", 0)
|
||||
return 0
|
||||
|
||||
def get_exp_count(user_id: str) -> int:
|
||||
user_data = load_user_data(user_id)
|
||||
if user_data:
|
||||
return user_data.get("exp", 0)
|
||||
return 0
|
||||
|
||||
def get_signin_time(user_id: str) -> str:
|
||||
user_data = load_user_data(user_id)
|
||||
if user_data:
|
||||
return user_data.get("last_signin", "no signin data")
|
||||
return 0
|
||||
|
||||
+139
@@ -0,0 +1,139 @@
|
||||
import csv
|
||||
|
||||
def save_user_data(user_data: dict):
|
||||
fieldnames = ["ID", "total_coin", "last_signin", "total_signin", "exp"]
|
||||
lines = []
|
||||
|
||||
with open("./data/User_Data.csv", mode="r", newline="", encoding="utf-8") as csvfile:
|
||||
reader = csv.DictReader(csvfile)
|
||||
lines.append(fieldnames) # 標題
|
||||
for row in reader:
|
||||
if row["ID"] == str(user_data["ID"]):
|
||||
# 覆寫這行
|
||||
lines.append([
|
||||
str(user_data["ID"]),
|
||||
str(user_data["total_coin"]),
|
||||
user_data["last_signin"],
|
||||
str(user_data["total_signin"]),
|
||||
str(user_data["exp"])
|
||||
])
|
||||
else:
|
||||
# 其他行照原本寫回去
|
||||
lines.append([
|
||||
row["ID"],
|
||||
row["total_coin"],
|
||||
row["last_signin"],
|
||||
row["total_signin"],
|
||||
row["exp"]
|
||||
])
|
||||
|
||||
with open("./data/User_Data.csv", mode="w", newline="", encoding="utf-8") as csvfile:
|
||||
writer = csv.writer(csvfile)
|
||||
writer.writerows(lines)
|
||||
|
||||
print(f"[Save.py] 使用者 ID {user_data['ID']} 資料已更新。")
|
||||
|
||||
def save_user_achievement(user_achievement: dict):
|
||||
fieldnames = ["ID", "achi_1", "achi_2", "achi_3", "achi_4", "achi_5", "achi_6", "achi_7"]
|
||||
lines = []
|
||||
|
||||
with open("./data/User_Achievement.csv", mode="r", newline="", encoding="utf-8") as csvfile:
|
||||
reader = csv.DictReader(csvfile)
|
||||
lines.append(fieldnames) # 標題
|
||||
for row in reader:
|
||||
if row["ID"] == str(user_achievement["ID"]):
|
||||
# 覆寫這行
|
||||
lines.append([
|
||||
str(user_achievement["ID"]),
|
||||
str(user_achievement["achi_1"]),
|
||||
str(user_achievement["achi_2"]),
|
||||
str(user_achievement["achi_3"]),
|
||||
str(user_achievement["achi_4"]),
|
||||
str(user_achievement["achi_5"]),
|
||||
str(user_achievement["achi_6"]),
|
||||
str(user_achievement["achi_7"])
|
||||
])
|
||||
else:
|
||||
# 其他行照原本寫回去
|
||||
lines.append([
|
||||
row["ID"],
|
||||
row["achi_1"],
|
||||
row["achi_2"],
|
||||
row["achi_3"],
|
||||
row["achi_4"],
|
||||
row["achi_5"],
|
||||
row["achi_6"],
|
||||
row["achi_7"]
|
||||
])
|
||||
|
||||
with open("./data/User_Achievement.csv", mode="w", newline="", encoding="utf-8") as csvfile:
|
||||
writer = csv.writer(csvfile)
|
||||
writer.writerows(lines)
|
||||
|
||||
print(f"[Save.py] 使用者 ID {user_achievement['ID']} 資料已更新。")
|
||||
|
||||
def save_user_backpack(user_backpack: dict):
|
||||
fieldnames = [
|
||||
"ID", "case", "cpu", "mother_board", "ram", "gpu", "fan", "psu", "hdd",
|
||||
"white_shark", "red_shark", "orange_shark", "yellow_shark", "green_shark",
|
||||
"blue_shark", "purple_shark", "gray_shark", "black_shark", "rgb_shark",
|
||||
"my_left_hand", "my_right_hand", "my_hair", "my_left_leg", "my_right_leg",
|
||||
"my_body", "my_head", "bed", "pillow", "quilt", "ac", "chair", "desk",
|
||||
"laptop", "screen", "phone", "plug", "wig", "pants", "top", "dress",
|
||||
"sleeve_cover", "stocking", "pantyhose", "bow", "hair_accessories", "cosmetics"
|
||||
]
|
||||
|
||||
lines = []
|
||||
|
||||
# 讀取原始資料,替換目標使用者資料
|
||||
with open("./data/User_Backpack.csv", mode="r", newline="", encoding="utf-8") as csvfile:
|
||||
reader = csv.DictReader(csvfile)
|
||||
lines.append(fieldnames) # 標題列
|
||||
|
||||
for row in reader:
|
||||
if row["ID"] == str(user_backpack["ID"]):
|
||||
# 用新的資料替代該使用者資料
|
||||
new_row = [str(user_backpack.get(key, 0)) for key in fieldnames]
|
||||
lines.append(new_row)
|
||||
else:
|
||||
# 其他行照原樣寫回去
|
||||
old_row = [row.get(key, "0") for key in fieldnames]
|
||||
lines.append(old_row)
|
||||
|
||||
# 寫回CSV檔
|
||||
with open("./data/User_Backpack.csv", mode="w", newline="", encoding="utf-8") as csvfile:
|
||||
writer = csv.writer(csvfile)
|
||||
writer.writerows(lines)
|
||||
|
||||
print(f"[Save.py] 使用者 ID {user_backpack['ID']} 資料已更新。")
|
||||
|
||||
|
||||
def save_server_setting(server_setting: dict):
|
||||
fieldnames = ["Server_ID", "signin_channel", "signin_emoji"]
|
||||
lines = []
|
||||
|
||||
with open("./data/Server_Setting.csv", mode="r", newline="", encoding="utf-8") as csvfile:
|
||||
reader = csv.DictReader(csvfile)
|
||||
lines.append(fieldnames) # 標題
|
||||
for row in reader:
|
||||
if row["Server_ID"] == str(server_setting["Server_ID"]):
|
||||
# 覆寫這行
|
||||
lines.append([
|
||||
str(server_setting["Server_ID"]),
|
||||
str(server_setting["signin_channel"]),
|
||||
str(server_setting["signin_emoji"])
|
||||
])
|
||||
else:
|
||||
# 其他行照原本寫回去
|
||||
lines.append([
|
||||
row["Server_ID"],
|
||||
row["signin_channel"],
|
||||
row["signin_emoji"]
|
||||
])
|
||||
|
||||
with open("./data/Server_Setting.csv", mode="w", newline="", encoding="utf-8") as csvfile:
|
||||
writer = csv.writer(csvfile)
|
||||
writer.writerows(lines)
|
||||
|
||||
print(f"[Save.py] 伺服器 ID {server_setting['Server_ID']} 資料已更新。")
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
import random
|
||||
import discord
|
||||
|
||||
text = [
|
||||
"你輸了",
|
||||
"加把勁,下次一定行",
|
||||
"失誤啦,再來一次",
|
||||
"唉,可惜了",
|
||||
"再接再厲",
|
||||
]
|
||||
|
||||
rare_text = [
|
||||
"菜,就多練",
|
||||
"可以剪精華了",
|
||||
"這操作要上抖音了",
|
||||
"你是不是閉著眼睛玩?",
|
||||
"請問你有開螢幕嗎?"
|
||||
]
|
||||
|
||||
def lose_message(lose_user: discord.User) -> str:
|
||||
if random.random() < 0.05:
|
||||
msg = random.choice(rare_text)
|
||||
else:
|
||||
msg = random.choice(text)
|
||||
return f"{lose_user.mention} {msg}"
|
||||
+205
@@ -0,0 +1,205 @@
|
||||
import random
|
||||
from data import load, save
|
||||
import numpy as np
|
||||
|
||||
def omikuji(user_id: int):
|
||||
user_data = load.load_user_data(user_id)
|
||||
|
||||
# 餘額不足跳出
|
||||
if int(user_data.get("total_coin", 0)) < 10:
|
||||
return None
|
||||
|
||||
# 籤的選項與機率(百分比)
|
||||
choices = [
|
||||
("大吉", 130, 10),
|
||||
("吉", 110, 20),
|
||||
("中吉", 105, 15),
|
||||
("小吉", 100, 15),
|
||||
("末吉", 95, 15),
|
||||
("凶", 85, 15),
|
||||
("大凶", 70, 10)
|
||||
]
|
||||
|
||||
# 製作機率權重列表
|
||||
weights = [c[2] for c in choices]
|
||||
|
||||
# 隨機抽籤
|
||||
result = random.choices(choices, weights=weights, k=1)[0]
|
||||
|
||||
# 更新經驗值與扣代幣
|
||||
user_data["exp"] = int(user_data.get("exp", 0)) + result[1]
|
||||
user_data["total_coin"] = int(user_data.get("total_coin", 0)) - 10
|
||||
|
||||
# 儲存使用者資料
|
||||
save.save_user_data(user_data)
|
||||
|
||||
# 回傳籤的名稱與獲得的經驗值
|
||||
return result[0], result[1]
|
||||
|
||||
def miner(user_id, pool_type, times):
|
||||
user_data = load.load_user_data(user_id)
|
||||
|
||||
cost = times # 每次消耗1代幣
|
||||
if user_data.get("total_coin", 0) < cost:
|
||||
return None # 代幣不足
|
||||
|
||||
user_data["total_coin"] -= cost
|
||||
|
||||
total_exp = 0
|
||||
log = []
|
||||
|
||||
for _ in range(times):
|
||||
if pool_type == "small":
|
||||
reward = random.choices([7, 22], weights=[80, 20], k=1)[0]
|
||||
elif pool_type == "large":
|
||||
reward = random.choices([8, 350], weights=[9900, 100], k=1)[0]
|
||||
elif pool_type == "risk":
|
||||
reward = random.choices([9, 114514, 300000], weights=[999980, 20, 10], k=1)[0]
|
||||
|
||||
total_exp += reward
|
||||
log.append(reward)
|
||||
|
||||
|
||||
user_data["exp"] = user_data.get("exp", 0) + total_exp
|
||||
save.save_user_data(user_data)
|
||||
|
||||
return total_exp, log
|
||||
|
||||
def scratch(user_id):
|
||||
user_data = load.load_user_data(user_id)
|
||||
|
||||
if int(user_data.get("total_coin", 0)) < 5:
|
||||
return None # 餘額不足
|
||||
|
||||
user_data["total_coin"] -= 5
|
||||
|
||||
opponent_nums = random.sample(range(1, 61), 3) # 先抽對手3個號碼
|
||||
player_nums = random.sample(range(1, 61), 9) # 再抽自己9個號碼
|
||||
|
||||
hits = len(set(opponent_nums) & set(player_nums))
|
||||
exp_gain = {0: 10, 1: 77, 2: 231, 3: 693}[hits]
|
||||
user_data["exp"] = user_data.get("exp", 0) + exp_gain
|
||||
|
||||
save.save_user_data(user_data)
|
||||
|
||||
return {
|
||||
"opponent": opponent_nums,
|
||||
"player": player_nums
|
||||
}
|
||||
|
||||
|
||||
|
||||
def gacha(user_id, pool_type):
|
||||
if pool_type != "作者池":
|
||||
return None
|
||||
|
||||
user_data = load.load_user_data(user_id)
|
||||
user_achievement = load.load_user_achievement(user_id)
|
||||
user_backpack = load.load_user_backpack(user_id)
|
||||
|
||||
if not user_data or not user_backpack or not user_achievement:
|
||||
return None
|
||||
|
||||
if user_data["total_coin"] < 3:
|
||||
return None
|
||||
|
||||
user_data["total_coin"] -= 3 # 花費代幣
|
||||
|
||||
# 主池:中文名稱 → 欄位名稱
|
||||
main_pool = {
|
||||
"主機殼": "case", "處理器": "cpu", "主機板": "mother_board", "記憶體": "ram",
|
||||
"顯示卡": "gpu", "塔扇": "fan", "電源供應器": "psu", "硬碟": "hdd",
|
||||
"白色鯊魚": "white_shark", "紅色鯊魚": "red_shark", "橘色鯊魚": "orange_shark",
|
||||
"黃色鯊魚": "yellow_shark", "綠色鯊魚": "green_shark", "藍色鯊魚": "blue_shark",
|
||||
"紫色鯊魚": "purple_shark", "灰色鯊魚": "gray_shark", "黑色鯊魚": "black_shark",
|
||||
"彩色鯊魚": "rgb_shark",
|
||||
"作者的左手模型": "my_left_hand", "作者的右手模型": "my_right_hand",
|
||||
"作者的頭髮模型": "my_hair", "作者的左腳模型": "my_left_leg",
|
||||
"作者的右腳模型": "my_right_leg", "作者的身體模型": "my_body", "作者的頭模型": "my_head",
|
||||
"床": "bed", "枕頭": "pillow", "棉被": "quilt", "冷氣": "ac", "椅子": "chair",
|
||||
"電腦桌": "desk", "筆電": "laptop", "螢幕": "screen", "手機": "phone", "插座": "plug",
|
||||
"假髮": "wig", "小褲褲": "pants", "上衣": "top", "小裙子": "dress",
|
||||
"袖套": "sleeve_cover", "絲襪": "stocking", "褲襪": "pantyhose",
|
||||
"蝴蝶結": "bow", "髮飾": "hair_accessories", "化妝品": "cosmetics"
|
||||
}
|
||||
|
||||
# 成就條件分組(同主池 key 名稱)
|
||||
pool = {
|
||||
"主機": ["case", "cpu", "mother_board", "ram", "gpu", "fan", "psu", "hdd"],
|
||||
"鯊魚家族": ["white_shark", "red_shark", "orange_shark", "yellow_shark",
|
||||
"green_shark", "blue_shark", "purple_shark", "gray_shark", "black_shark", "rgb_shark"],
|
||||
"作者": ["my_left_hand", "my_right_hand", "my_hair", "my_left_leg", "my_right_leg", "my_body", "my_head"],
|
||||
"配置": ["bed", "pillow", "quilt", "ac", "chair", "desk", "laptop", "screen", "phone", "plug"],
|
||||
"女裝": ["wig", "pants", "top", "dress", "sleeve_cover", "stocking", "pantyhose", "bow", "hair_accessories", "cosmetics"]
|
||||
}
|
||||
|
||||
side_pool = ["30exp", "30exp", "25exp", "35exp"]
|
||||
rare_side = ["成就『閉嘴』", "成就『到底』"]
|
||||
|
||||
all_items = list(main_pool.keys()) + side_pool
|
||||
|
||||
result_log = ""
|
||||
draw_result = random.choice(all_items)
|
||||
result_log += f"抽中:「{draw_result}」\n"
|
||||
|
||||
# 處理主池與 EXP
|
||||
if draw_result.endswith("exp"):
|
||||
exp_gain = int(draw_result.replace("exp", ""))
|
||||
user_data["exp"] += exp_gain
|
||||
result_log += f"獲得 {exp_gain} EXP\n"
|
||||
else:
|
||||
item_key = main_pool.get(draw_result)
|
||||
if item_key:
|
||||
user_backpack[item_key] = user_backpack.get(item_key, 0) + 1
|
||||
result_log += f"{draw_result} 數量 +1,當前為 {user_backpack[item_key]}\n"
|
||||
else:
|
||||
result_log += f"抽到未知物品:{draw_result},請檢查 main_pool 是否包含此名稱\n"
|
||||
|
||||
# 稀有追加
|
||||
if random.random() < 0.03:
|
||||
rare = random.choice(rare_side)
|
||||
result_log += f"# 額外獲得 {rare}\n"
|
||||
|
||||
if rare == "成就『閉嘴』" and user_achievement["achi_6"] == 0:
|
||||
user_achievement["achi_6"] += 1
|
||||
result_log += "# 達成成就《閉嘴》 +0 EXP\n"
|
||||
|
||||
if rare == "成就『到底』" and user_achievement["achi_7"] == 0:
|
||||
user_achievement["achi_7"] += 1
|
||||
result_log += "# 達成成就《到底》 +0 EXP\n"
|
||||
|
||||
# 成就檢查(僅當該成就尚未領取時)
|
||||
if all(user_backpack.get(key, 0) >= 1 for key in pool["主機"]) and user_achievement["achi_1"] == 0:
|
||||
user_achievement["achi_1"] += 1
|
||||
user_data["exp"] += 480
|
||||
result_log += "# 達成成就《桌機玩家》 +480 EXP\n"
|
||||
|
||||
if all(user_backpack.get(key, 0) >= 1 for key in pool["鯊魚家族"]) and user_achievement["achi_2"] == 0:
|
||||
user_achievement["achi_2"] += 1
|
||||
user_data["exp"] += 600
|
||||
result_log += "# 達成成就《彩色鯊魚家族》 +600 EXP\n"
|
||||
|
||||
if all(user_backpack.get(key, 0) >= 1 for key in pool["作者"]) and user_achievement["achi_3"] == 0:
|
||||
user_achievement["achi_3"] += 1
|
||||
user_data["total_coin"] += 150
|
||||
result_log += "# 達成成就《單推sthkm3》 +150 代幣\n"
|
||||
|
||||
if all(user_backpack.get(key, 0) >= 1 for key in pool["配置"]) and user_achievement["achi_4"] == 0:
|
||||
user_achievement["achi_4"] += 1
|
||||
user_data["exp"] += 600
|
||||
result_log += "# 達成成就《懶人》 +600 EXP\n"
|
||||
|
||||
if all(user_backpack.get(key, 0) >= 1 for key in pool["女裝"]) and user_achievement["achi_5"] == 0:
|
||||
user_achievement["achi_5"] += 1
|
||||
user_data["exp"] += 600
|
||||
result_log += "# 達成成就《這就是...開發者的未來嗎...》 +600 EXP\n"
|
||||
|
||||
# 儲存
|
||||
save.save_user_data(user_data)
|
||||
save.save_user_backpack(user_backpack)
|
||||
save.save_user_achievement(user_achievement)
|
||||
|
||||
return result_log
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
import csv
|
||||
from data import load
|
||||
|
||||
# 🧩 取得伺服器內所有成員的資料
|
||||
def server_list(guild):
|
||||
member_data = []
|
||||
for member in guild.members:
|
||||
if member.bot:
|
||||
continue
|
||||
user_data = load.load_user_data(str(member.id))
|
||||
if user_data: # 確保有資料
|
||||
member_data.append({
|
||||
"id": member.id,
|
||||
"name": member.display_name,
|
||||
"exp": int(user_data.get("exp", 0)),
|
||||
"total_signin": int(user_data.get("total_signin", 0))
|
||||
})
|
||||
return member_data
|
||||
|
||||
|
||||
# 伺服器的簽到排行榜
|
||||
async def sort_signin_server(guild):
|
||||
members = server_list(guild)
|
||||
top = sorted(members, key=lambda x: x["total_signin"], reverse=True)[:10]
|
||||
return format_rank(top, "total_signin")
|
||||
|
||||
|
||||
# 伺服器的經驗值排行榜
|
||||
async def sort_exp_server(guild):
|
||||
members = server_list(guild)
|
||||
top = sorted(members, key=lambda x: x["exp"], reverse=True)[:10]
|
||||
return format_rank(top, "exp")
|
||||
|
||||
|
||||
# 全國簽到排行榜
|
||||
async def sort_signin_all(bot):
|
||||
users = load_csv_data()
|
||||
top = sorted(users, key=lambda x: x["total_signin"], reverse=True)[:10]
|
||||
return await format_rank_global(top, bot, "total_signin")
|
||||
|
||||
|
||||
# 全國經驗排行榜
|
||||
async def sort_exp_all(bot):
|
||||
users = load_csv_data()
|
||||
top = sorted(users, key=lambda x: x["exp"], reverse=True)[:10]
|
||||
return await format_rank_global(top, bot, "exp")
|
||||
|
||||
|
||||
# 🧩 讀取 User_Data.csv
|
||||
def load_csv_data():
|
||||
filepath = "./data/User_Data.csv"
|
||||
users = []
|
||||
try:
|
||||
with open(filepath, newline="", encoding="utf-8") as csvfile:
|
||||
reader = csv.DictReader(csvfile)
|
||||
for row in reader:
|
||||
users.append({
|
||||
"id": int(row["ID"]),
|
||||
"exp": int(row.get("exp", 0)),
|
||||
"total_signin": int(row.get("total_signin", 0))
|
||||
})
|
||||
except FileNotFoundError:
|
||||
print("[rank.py] 找不到 User_Data.csv")
|
||||
return users
|
||||
|
||||
|
||||
# 排行榜格式:本伺服器用名稱
|
||||
def format_rank(data, key):
|
||||
output = ""
|
||||
for i, user in enumerate(data, start=1):
|
||||
output += f"{i}. {user['name']} - {user[key]}\n"
|
||||
return output or "(目前沒有資料)"
|
||||
|
||||
|
||||
# 排行榜格式:全伺服器用 tag
|
||||
async def format_rank_global(data, bot, key):
|
||||
output = ""
|
||||
for i, user in enumerate(data, start=1):
|
||||
member = bot.get_user(user["id"])
|
||||
name = member.name if member else f"(ID:{user['id']})"
|
||||
output += f"{i}. {name} - {user[key]}\n"
|
||||
return output or "(目前沒有資料)"
|
||||
@@ -0,0 +1,66 @@
|
||||
import discord
|
||||
from discord.ui import View, Select
|
||||
from discord import SelectOption
|
||||
from data import load, save, create
|
||||
|
||||
# 🔧 主函式:產生簽到設定面板
|
||||
def get_signin_setup_view(guild: discord.Guild) -> View:
|
||||
guild_id = str(guild.id)
|
||||
|
||||
# 若未建立設定,先建立
|
||||
if load.load_server_setting(guild_id) is None:
|
||||
create.create_server_setting(guild_id)
|
||||
|
||||
server_setting = load.load_server_setting(guild_id)
|
||||
|
||||
view = View(timeout=180)
|
||||
|
||||
# ===== 表情選單 =====
|
||||
emoji_options = [
|
||||
SelectOption(label=e.name, value=str(e)) for e in guild.emojis
|
||||
]
|
||||
emoji_options.insert(0, SelectOption(label="預設表情符號:🪙", value="🪙"))
|
||||
|
||||
async def emoji_callback(interaction: discord.Interaction):
|
||||
server_setting["signin_emoji"] = emoji_select.values[0]
|
||||
save.save_server_setting({
|
||||
"Server_ID": guild_id,
|
||||
"signin_channel": server_setting["signin_channel"],
|
||||
"signin_emoji": server_setting["signin_emoji"]
|
||||
})
|
||||
await interaction.response.send_message(f"簽到表情已設為 {emoji_select.values[0]}", ephemeral=True)
|
||||
|
||||
emoji_select = Select(
|
||||
placeholder="選擇簽到表情符號",
|
||||
options=emoji_options,
|
||||
min_values=1,
|
||||
max_values=1
|
||||
)
|
||||
emoji_select.callback = emoji_callback
|
||||
view.add_item(emoji_select)
|
||||
|
||||
# ===== 頻道選單 =====
|
||||
channel_options = [
|
||||
SelectOption(label=ch.name, value=str(ch.id)) for ch in guild.text_channels
|
||||
]
|
||||
channel_options.insert(0, SelectOption(label="不限制頻道", value="default"))
|
||||
|
||||
async def channel_callback(interaction: discord.Interaction):
|
||||
server_setting["signin_channel"] = channel_select.values[0]
|
||||
save.save_server_setting({
|
||||
"Server_ID": guild_id,
|
||||
"signin_channel": server_setting["signin_channel"],
|
||||
"signin_emoji": server_setting["signin_emoji"]
|
||||
})
|
||||
await interaction.response.send_message(f"簽到頻道已設為 <#{channel_select.values[0]}>", ephemeral=True)
|
||||
|
||||
channel_select = Select(
|
||||
placeholder="選擇簽到頻道",
|
||||
options=channel_options,
|
||||
min_values=1,
|
||||
max_values=1
|
||||
)
|
||||
channel_select.callback = channel_callback
|
||||
view.add_item(channel_select)
|
||||
|
||||
return view
|
||||
@@ -0,0 +1,62 @@
|
||||
import discord
|
||||
from discord.ext import commands
|
||||
import random
|
||||
from datetime import datetime
|
||||
import pytz
|
||||
|
||||
from data import load, save, create
|
||||
|
||||
tz = pytz.timezone("Asia/Taipei")
|
||||
|
||||
async def handle_signin(bot: commands.Bot, message: discord.Message):
|
||||
if message.author.bot or not message.guild:
|
||||
return
|
||||
|
||||
guild_id = str(message.guild.id)
|
||||
user_id = str(message.author.id)
|
||||
channel_id = str(message.channel.id)
|
||||
today = datetime.now(tz).strftime("%Y-%m-%d")
|
||||
|
||||
# 取伺服器設定
|
||||
setting = load.load_server_setting(guild_id)
|
||||
if setting:
|
||||
emoji = setting["signin_emoji"]
|
||||
allowed_channel = str(setting["signin_channel"])
|
||||
else:
|
||||
emoji = "🪙"
|
||||
allowed_channel = "default"
|
||||
|
||||
# 表情與頻道檢查
|
||||
if message.content.strip() != emoji:
|
||||
return
|
||||
if allowed_channel != "default" and channel_id != allowed_channel:
|
||||
return
|
||||
|
||||
# 載入使用者資料
|
||||
user_data = load.load_user_data(user_id)
|
||||
|
||||
# 若不存在,創建新資料
|
||||
if user_data is None:
|
||||
create.create_user_data(user_id)
|
||||
create.create_user_achievement(user_id)
|
||||
create.create_user_backpack(user_id)
|
||||
|
||||
# 嘗試載入使用者資料
|
||||
user_data = load.load_user_data(user_id)
|
||||
|
||||
# 若今天尚未簽到,更新資料
|
||||
if user_data["last_signin"] != today:
|
||||
user_data["total_coin"] += 10
|
||||
user_data["last_signin"] = today
|
||||
user_data["total_signin"] += 1
|
||||
|
||||
await message.add_reaction(emoji)
|
||||
|
||||
# 0.15% 中大獎
|
||||
if random.random() < 0.0015:
|
||||
user_data["total_coin"] += 470
|
||||
await message.channel.send(
|
||||
f"# 感謝 {message.author.mention} 的陪伴!\n將為您奉上三顆糾纏之緣 (共 480 代幣)!"
|
||||
)
|
||||
|
||||
save.save_user_data(user_data)
|
||||
@@ -0,0 +1,229 @@
|
||||
import os
|
||||
import discord
|
||||
from discord.ext import commands
|
||||
from discord import app_commands
|
||||
from typing import Literal, Optional
|
||||
|
||||
import asyncio
|
||||
|
||||
from func import signin
|
||||
from func import setup
|
||||
from func import rank
|
||||
from func import lottery
|
||||
from func.setup import get_signin_setup_view
|
||||
from data import load, save, create
|
||||
|
||||
intents = discord.Intents.default()
|
||||
intents.messages = True
|
||||
intents.message_content = True
|
||||
intents.guilds = True
|
||||
intents.members = True
|
||||
|
||||
bot = commands.Bot(command_prefix="/", intents=intents)
|
||||
|
||||
DEV_ID = 1365846048144228392
|
||||
|
||||
@bot.event
|
||||
async def on_ready():
|
||||
bot.tree.add_command(LotteryCommandGroup())
|
||||
await bot.tree.sync()
|
||||
print(f"Logged in as {bot.user}")
|
||||
channel = bot.get_channel(DEV_ID)
|
||||
|
||||
if channel:
|
||||
await channel.send("遊戲機已啟動,版本V2.7")
|
||||
|
||||
@bot.event
|
||||
async def on_message(message: discord.Message):
|
||||
if message.author.bot:
|
||||
return
|
||||
await signin.handle_signin(bot, message)
|
||||
await bot.process_commands(message)
|
||||
|
||||
@bot.tree.command(name="查看", description="查看個人資訊")
|
||||
@app_commands.describe(類型="選擇查看資訊")
|
||||
@app_commands.choices(類型=[
|
||||
app_commands.Choice(name="簽到次數", value="signin_count"),
|
||||
app_commands.Choice(name="代幣個數", value="coin_count"),
|
||||
app_commands.Choice(name="上次簽到", value="last_signin"),
|
||||
app_commands.Choice(name="經驗值", value="exp_count")
|
||||
])
|
||||
async def 查看(interaction: discord.Interaction, 類型: app_commands.Choice[str]):
|
||||
user_id = str(interaction.user.id)
|
||||
user = interaction.user
|
||||
if 類型.value == "signin_count":
|
||||
count = load.get_signin_count(user_id)
|
||||
if count == 0:
|
||||
await interaction.response.send_message(f" # {user.mention} 沒有簽到過!!\n請先使用簽到")
|
||||
else:
|
||||
await interaction.response.send_message(f" {user.mention} 簽到了 {count} 次")
|
||||
elif 類型.value == "coin_count":
|
||||
coins = load.get_coin_count(user_id)
|
||||
if coins == 0:
|
||||
await interaction.response.send_message(f"# {user.mention} 沒有代幣!!\n請先使用簽到")
|
||||
else:
|
||||
await interaction.response.send_message(f"{user.mention} 擁有 {coins} 枚代幣")
|
||||
elif 類型.value == "exp_count":
|
||||
exp = load.get_exp_count(user_id)
|
||||
if exp == 0:
|
||||
await interaction.response.send_message(f"# {user.mention} 沒有經驗值!!\n請先使用簽到")
|
||||
else:
|
||||
await interaction.response.send_message(f"{user.mention} 有 {exp} 經驗值")
|
||||
elif 類型.value == "last_signin":
|
||||
signin_time = load.get_signin_time(user_id)
|
||||
if signin_time == "no signin data":
|
||||
await interaction.response.send_message(f" # {user.mention} 沒有簽到過!!\n請先使用簽到")
|
||||
else:
|
||||
await interaction.response.send_message(f"{user.mention} 上次簽到日期為 {signin_time}")
|
||||
|
||||
@bot.tree.command(name="設定", description="設定")
|
||||
@app_commands.describe(
|
||||
簽到頻道="輸入簽到頻道的ID,要偵測所有頻道請打\"default\"",
|
||||
簽到表符="輸入簽到表符,如 🪙 或自訂表符"
|
||||
)
|
||||
async def 設定(
|
||||
interaction: discord.Interaction,
|
||||
簽到頻道: str,
|
||||
簽到表符: str
|
||||
):
|
||||
if not interaction.user.guild_permissions.administrator:
|
||||
await interaction.response.send_message("只有管理員能使用此指令", ephemeral=True)
|
||||
return
|
||||
|
||||
if not 簽到頻道.isdigit():
|
||||
await interaction.response.send_message("頻道ID格式錯誤,請輸入純數字頻道ID。", ephemeral=True)
|
||||
return
|
||||
|
||||
guild_id = interaction.guild.id
|
||||
|
||||
current = load.load_server_setting(guild_id)
|
||||
if not current:
|
||||
create.create_server_setting(guild_id)
|
||||
|
||||
new_data = {
|
||||
"Server_ID": guild_id,
|
||||
"signin_channel": 簽到頻道,
|
||||
"signin_emoji": 簽到表符
|
||||
}
|
||||
save.save_server_setting(new_data)
|
||||
|
||||
channel = interaction.guild.get_channel(int(簽到頻道))
|
||||
channel_mention = channel.mention if channel else f"<簽到頻道 {簽到頻道}>"
|
||||
|
||||
await interaction.response.send_message(
|
||||
f"已更新簽到設定:\n頻道 {channel_mention}\n表符:{簽到表符}",
|
||||
ephemeral=True
|
||||
)
|
||||
|
||||
@bot.tree.command(name="排行榜", description="查看排行榜")
|
||||
@app_commands.describe(類型="選擇排行榜類型")
|
||||
@app_commands.choices(類型=[
|
||||
app_commands.Choice(name="簽到-本伺服器", value="signin_server"),
|
||||
app_commands.Choice(name="簽到-全國", value="signin_all"),
|
||||
app_commands.Choice(name="經驗-本伺服", value="exp_server"),
|
||||
app_commands.Choice(name="經驗-全國", value="exp_all"),
|
||||
])
|
||||
async def rank_command(interaction: discord.Interaction, 類型: app_commands.Choice[str]):
|
||||
await interaction.response.defer()
|
||||
|
||||
match 類型.value:
|
||||
case "signin_server":
|
||||
result = await rank.sort_signin_server(interaction.guild)
|
||||
case "exp_server":
|
||||
result = await rank.sort_exp_server(interaction.guild)
|
||||
case "signin_all":
|
||||
result = await rank.sort_signin_all(bot)
|
||||
case "exp_all":
|
||||
result = await rank.sort_exp_all(bot)
|
||||
|
||||
await interaction.followup.send(f"**{類型.name} 排行榜**\n```{result}```")
|
||||
|
||||
# lottery
|
||||
class LotteryCommandGroup(app_commands.Group):
|
||||
def __init__(self):
|
||||
super().__init__(name="抽獎", description="進行抽獎")
|
||||
|
||||
@app_commands.command(name="御神籤", description="抽一次御神籤,消耗10代幣")
|
||||
async def omikuji(self, interaction: discord.Interaction):
|
||||
user_id = str(interaction.user.id)
|
||||
|
||||
result = lottery.omikuji(user_id)
|
||||
if result is None:
|
||||
await interaction.response.send_message("代幣不足,無法抽取御神籤。", ephemeral=True)
|
||||
else:
|
||||
await interaction.response.send_message(f"{interaction.user.mention} 抽中了 **{result[0]}**,獲得了 **{result[1]}** exp!")
|
||||
|
||||
|
||||
@app_commands.command(name="幸運礦工", description="從指定礦池進行抽獎,消耗1代幣")
|
||||
@app_commands.describe(礦池="選擇礦池", 次數="抽幾次")
|
||||
@app_commands.choices(礦池=[
|
||||
app_commands.Choice(name="小型礦池", value="small"),
|
||||
app_commands.Choice(name="大型礦池", value="large"),
|
||||
app_commands.Choice(name="賭狗模式", value="risk")
|
||||
])
|
||||
async def miner(self, interaction: discord.Interaction, 礦池: app_commands.Choice[str], 次數: int = 1):
|
||||
user_id = str(interaction.user.id)
|
||||
|
||||
if 次數 > 500 or 次數 <= 0:
|
||||
await interaction.response.send_message("次數必須介於 1 到 500 之間。", ephemeral=True)
|
||||
return
|
||||
|
||||
result = lottery.miner(user_id, 礦池.value, 次數)
|
||||
if result is None:
|
||||
await interaction.response.send_message("代幣不足,無法幸運礦工。", ephemeral=True)
|
||||
else:
|
||||
total_exp, log = result
|
||||
log_str = ", ".join(str(x) for x in log)
|
||||
|
||||
await interaction.response.send_message(
|
||||
f"{interaction.user.mention} 進行了 {次數} 次 **{礦池.name}** 抽獎\n"
|
||||
f"總共獲得:**{total_exp} exp**\n"
|
||||
f"抽獎結果如下:\n### {log_str}"
|
||||
)
|
||||
|
||||
@app_commands.command(name="扭蛋", description="從指定扭蛋池進行抽獎,消耗3代幣")
|
||||
@app_commands.describe(卡池="選擇卡池")
|
||||
@app_commands.choices(卡池=[
|
||||
app_commands.Choice(name="作者池", value="作者池")
|
||||
])
|
||||
async def gacha(self, interaction: discord.Interaction, 卡池: app_commands.Choice[str]):
|
||||
user_id = str(interaction.user.id)
|
||||
|
||||
result = lottery.gacha(user_id, 卡池.value)
|
||||
if result is None:
|
||||
await interaction.response.send_message("代幣不足或參數錯誤。", ephemeral=True)
|
||||
else:
|
||||
await interaction.response.send_message(
|
||||
f"{interaction.user.mention} 抽取了一次 {卡池.name} 扭蛋,結果如下:\n{result}"
|
||||
)
|
||||
@app_commands.command(name="刮刮樂", description="玩一次刮刮樂,消耗5代幣")
|
||||
@app_commands.describe(卡池="選擇模式")
|
||||
@app_commands.choices(卡池=[
|
||||
app_commands.Choice(name="模式一", value="模式一"),
|
||||
app_commands.Choice(name="模式二", value="模式二")
|
||||
])
|
||||
async def scratch(self, interaction: discord.Interaction, 卡池: app_commands.Choice[str]):
|
||||
if 卡池.value == "模式二":
|
||||
await interaction.response.send_message("模式二尚未實裝,敬請期待!", ephemeral=True)
|
||||
return
|
||||
|
||||
# 模式一邏輯
|
||||
result = lottery.scratch(interaction.user.id)
|
||||
if result is None:
|
||||
await interaction.response.send_message("你的代幣不足,無法玩刮刮樂!", ephemeral=True)
|
||||
return
|
||||
|
||||
answer_line = "# ||" + " ".join(str(n) for n in result["opponent"]) + "||"
|
||||
rows = [
|
||||
"# ||" + " ".join(str(n) for n in result["player"][i:i+3]) + "||"
|
||||
for i in range(0, 9, 3)
|
||||
]
|
||||
scratch_board = "\n".join(["對手的號碼:",answer_line,"您的號碼:"] + rows)
|
||||
|
||||
|
||||
await interaction.response.send_message(f"刮刮樂開始!祝你好運~\n{scratch_board}")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
TOKEN = os.getenv("DISCORD_BOT_TOKEN")
|
||||
bot.run(TOKEN)
|
||||
@@ -0,0 +1,2 @@
|
||||
numpy
|
||||
discord.py
|
||||
Reference in new issue
Block a user