一個使用node.js實作的discord bot
受jasonkao402的項目啟發(實際上就是抄了不少)
Alice的battle功能源自米米警察的aibattle系列指令(最初用於測試API調用)
此機器人需要安裝以下依賴模組:
discord.js 14.27.0lodash 4.18.1file-type 22.0.1moment 2.30.1openai 6.49.0
請在assets下新增:
cats資料夾quotes資料夾private-battle_API_config.jsonprivate-chat_API_config.jsonbot_assets.jsoncats.jsondefined_function.jsonmessage_repository.jsonpersona.jsonquotes.jsonuser_repository.json
相關配置如下:
空資料夾。
空字料夾。
如果要在battle與chat功能中使用不同的API配置請用private-開頭自行修改源碼的配置搜索,否則可以統一使用API_config.json作為檔案名稱。
url: API要發送請求的網址key: API keyrpm: 每分鐘可發送多少請求concurrent_limit: 同時可發送多少請求allowed_image: 該API是否允許發送圖片round_robin_quota: 該API允許連續請求幾次avalible_model: 可用模型列表current_use: 當前正在使用哪種模型max_tokens: 同open ai API的同名參數
temperature: 同open ai API的同名參數presence_penalty: 同open ai API的同名參數frequency_penalty: 同open ai API的同名參數top_p: 同open ai API的同名參數extra_body: 同open ai API的同名參數
token: 機器人的tokenclientId: 機器人的client idowner: 傭有者的discord idtest_server_guildId: 測試伺服器的伺服器idopening_channel: 用於在機器人上線時發送提醒訊息的頻道iddebug_channel: 用於在程式報錯時直接發送錯誤訊息的頻道idCOT_channel: 用於紀錄chat回傳的COT的頻道idquote_command_available: 空陣列battle_command_available: 空陣列chatable_channel: 空陣列
空陣列
空陣列
空陣列
空陣列
或者你可以根據/persona_help指令的說明加入system的persona(我懶得寫了)
空陣列
空陣列
我寫這些幹嘛...
算了反正也沒人看。