Update app.py
Browse files
app.py
CHANGED
|
@@ -317,8 +317,23 @@ async def console_input():
|
|
| 317 |
async def simulate_discord_bot_operation(input_text):
|
| 318 |
# 模擬處理輸入的操作
|
| 319 |
await asyncio.sleep(1) # 模擬延遲
|
| 320 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 321 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 322 |
def process_input(input_text):
|
| 323 |
loop = asyncio.new_event_loop()
|
| 324 |
asyncio.set_event_loop(loop)
|
|
|
|
| 317 |
async def simulate_discord_bot_operation(input_text):
|
| 318 |
# 模擬處理輸入的操作
|
| 319 |
await asyncio.sleep(1) # 模擬延遲
|
| 320 |
+
server_id = 741530746040221728
|
| 321 |
+
channel_id = 1279810458844401714
|
| 322 |
+
|
| 323 |
+
# 獲取最後一條消息
|
| 324 |
+
last_message = await fetch_last_message(server_id, channel_id)
|
| 325 |
+
if last_message is None:
|
| 326 |
+
print("無法獲取消息。")
|
| 327 |
+
return
|
| 328 |
+
|
| 329 |
+
print("輸入密碼: ", end='', flush=True)
|
| 330 |
+
password = await asyncio.get_event_loop().run_in_executor(None, sys.stdin.readline)
|
| 331 |
+
password = password.strip().lower()
|
| 332 |
|
| 333 |
+
if password == last_message.strip().lower():
|
| 334 |
+
return f"處理結果: {"密碼正確"}"
|
| 335 |
+
else:
|
| 336 |
+
return f"處理結果: {"密碼錯誤"}"
|
| 337 |
def process_input(input_text):
|
| 338 |
loop = asyncio.new_event_loop()
|
| 339 |
asyncio.set_event_loop(loop)
|