dcchbot 1.9.1__py3-none-any.whl → 1.9.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
dcchbot/__init__.py CHANGED
@@ -1,5 +1,6 @@
1
1
  #init
2
2
  from .main import run
3
- print("Discord chinese bot v1.9.1 ok")
3
+ cu_ver = "1.9.3"
4
+ print(f"Discord chinese bot v{cu_ver} ok")
4
5
  print("by I_am_from_taiwan")
5
6
  run()
dcchbot/main.py CHANGED
@@ -13,11 +13,11 @@ from discord.ext import commands
13
13
  from discord.utils import utcnow
14
14
  import random as rd
15
15
  package = "dcchbot"
16
- CURRENT_VERSION = "1.9.1"
16
+ CURRENT_VERSION = "1.9.3"
17
17
  API_URL = f"https://pypi.org/pypi/{package}/json"
18
18
  test = rd.random()
19
19
  ttt = time.time()
20
- tb = tb.walk_tb
20
+ tb = tb
21
21
  try:
22
22
  response = requests.get(API_URL, timeout=5)
23
23
  response.raise_for_status() # HTTP 錯誤會直接丟例外
@@ -39,8 +39,6 @@ token = None
39
39
  bot: commands.Bot | None = None
40
40
  CODER_ID = 1317800611441283139
41
41
  _now = datetime.now()
42
- tmp_owner_id = None
43
- tmp_log_channel_id = None
44
42
  # thread-safe queue 用於在任意 thread 放 log,並由 bot loop 背景 worker 傳送到 Discord
45
43
  _log_queue: "queue.Queue[str]" = queue.Queue()
46
44
  now_version = "1.9.1"
@@ -110,23 +108,25 @@ async def _discord_log_worker(bot_instance: commands.Bot, channel_id: int):
110
108
 
111
109
  # ─── Bot 程式主體與指令 ─────────────────────────────────
112
110
  def run():
113
- global OWNER_ID, LOG_CHANNEL_ID, token, bot,tmp_owner_id,tmp_log_channel_id
111
+ global OWNER_ID, LOG_CHANNEL_ID, token, bot
114
112
 
115
113
  # 互動式輸入(你也可以改成從環境變數讀取)
116
- tmp_owner_id = input("請輸入你的 Discord User ID:\n> ").strip()
117
- if isinstance(tmp_owner_id,int):
118
- OWNER_ID = tmp_owner_id
119
- tmp_owner_id = None
120
- else:
121
- print("格式錯誤,請重新輸入")
122
- logger.error("E:vError ownerid")
123
- tmp_log_channel_id = input("請輸入你的 Log 頻道 ID:\n> ").strip()
124
- if isinstance(tmp_log_channel_id,int):
125
- LOG_CHANNEL_ID = tmp_log_channel_id
126
- tmp_log_channel_id = None
127
- else:
128
- print("格式錯誤,請重新輸入")
129
- logger.error("E:vError channelid")
114
+ while True:
115
+ OWNER_ID = input("請輸入你的 Discord User ID:\n> ").strip()
116
+ if not OWNER_ID or not str(OWNER_ID).isdigit():
117
+ print("格式錯誤,請重新輸入")
118
+ logger.error("E:vError ownerid")
119
+ else:
120
+ OWNER_ID=int(OWNER_ID)
121
+ break
122
+ while True:
123
+ LOG_CHANNEL_ID = input("請輸入你的 Log 頻道 ID:\n> ").strip()
124
+ if not LOG_CHANNEL_ID or not str(LOG_CHANNEL_ID).isdigit():
125
+ print("格式錯誤,請重新輸入")
126
+ logger.error("E:vError channelid")
127
+ else:
128
+ LOG_CHANNEL_ID = int(LOG_CHANNEL_ID)
129
+ break
130
130
  token = input("請輸入你的 Discord Bot Token:\n> ").strip()
131
131
 
132
132
  intents = discord.Intents.all()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dcchbot
3
- Version: 1.9.1
3
+ Version: 1.9.3
4
4
  Summary: 一個簡單的中文 Discord 管理機器人,支援 GUI 按鈕封鎖/禁言/警告
5
5
  Author-email: I_am_from_taiwan <102109040j@gmail.com>
6
6
  License: MIT
@@ -0,0 +1,9 @@
1
+ dcchbot/__init__.py,sha256=TuQRGtSD8Z8WeNCtlvqz-fVxh2ZS87QSmN4VCJent0s,127
2
+ dcchbot/__main__.py,sha256=5FwoJspcKFt5_1AlXoxlWROiQSp9wgnFEltU6ufz9QE,30
3
+ dcchbot/main.py,sha256=f4iGx993EFBS_NDOo0Udw3sksPx-6CRl_dZYkt82iAU,25230
4
+ dcchbot-1.9.3.dist-info/licenses/LICENSE,sha256=_5HM5sddbG63Amw1X9WfCK-_5xBLHlAV_HaUKBqeTpE,1063
5
+ dcchbot-1.9.3.dist-info/METADATA,sha256=zO4-mSJG2-azgFSkisTMn6ho3m1Q3eH-cuvJgcV3CUQ,440
6
+ dcchbot-1.9.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
7
+ dcchbot-1.9.3.dist-info/entry_points.txt,sha256=90T16CGc_Tx-4pFaLCcbuuh7Vi9l4gsLovBkydqxP9Y,45
8
+ dcchbot-1.9.3.dist-info/top_level.txt,sha256=jiDTz8UmwZgXN9KzokwDRYhoWxsVmWcnqmrANeTFMck,8
9
+ dcchbot-1.9.3.dist-info/RECORD,,
@@ -1,9 +0,0 @@
1
- dcchbot/__init__.py,sha256=qGk3E_IN6HKlEC4mc6W-Oj2hkq_-Q9YDUldjiQAwOoY,105
2
- dcchbot/__main__.py,sha256=5FwoJspcKFt5_1AlXoxlWROiQSp9wgnFEltU6ufz9QE,30
3
- dcchbot/main.py,sha256=rCvSnc60i3vQzvMvrWlh0g5EY_whH1_trPmCpA2gX_0,25240
4
- dcchbot-1.9.1.dist-info/licenses/LICENSE,sha256=_5HM5sddbG63Amw1X9WfCK-_5xBLHlAV_HaUKBqeTpE,1063
5
- dcchbot-1.9.1.dist-info/METADATA,sha256=sKgnRRGj1swr9IIhohAv6o9dt1E8Jj6I3ByzRBnD3CI,440
6
- dcchbot-1.9.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
7
- dcchbot-1.9.1.dist-info/entry_points.txt,sha256=90T16CGc_Tx-4pFaLCcbuuh7Vi9l4gsLovBkydqxP9Y,45
8
- dcchbot-1.9.1.dist-info/top_level.txt,sha256=jiDTz8UmwZgXN9KzokwDRYhoWxsVmWcnqmrANeTFMck,8
9
- dcchbot-1.9.1.dist-info/RECORD,,