Skip to content

IanDesuyo/AIKyaru

Repository files navigation

AI キャル v3

為公主連結所設計的 Discord 聊天機器人

PyPI - Python Version Discord Invite bot Notion document

安裝方式

前置需求

在開始安裝前, 請先完成下列步驟

Docker

要使用 Docker 運行, 你可以直接使用下列指令來建置與運行

docker build -t ai_kyaru .

docker run -d \
    --name ai_kyaru \
    -e BOT_TOKEN=YOUR_BOT_TOKEN \
    -v /path/to/config.json:/app/config.json \
    ai_kyaru

手動安裝

在開始安裝前, 建議先使用 virtualenv 創建虛擬環境, 並設置環境變數TOKEN

pip3 install -r requirements.txt

BOT_TOKEN=YOUR_BOT_TOKEN

python3 main.py

設定說明

除了 Discord 機器人的 Token 外, 其餘設定皆儲存於config.json

首次設定時, 請先參考config.json.example內的格式並修改設定值

{
  "status": "online", // 機器人的上線狀態
  "activity": {
    // 根據下方設定, 結果為 "正在看 .help|ヤバイわよ!!"
    "type": 3, // 機器人的狀態, playing=0, streaming=1, listening=2, watching=3
    "prefix": ".help|", // 機器人狀態的前綴
    "default_text": "ヤバイわよ!!" // 預設狀態文字
  },
  "prefix": ".", // 指令前綴
  "cogs": [
    // 需要載入的Cogs
    "cogs.admin", // 管理員功能
    "cogs.rubiBank", // 盧幣銀行
    "cogs.character", // 角色相關資訊查詢
    "cogs.profileCard", // 個人檔案
    "cogs.common", // 基本功能, 如體力計算及抽卡模擬
    "cogs.newsForward", // 簡易設定公告轉發
    "cogs.preferences", // 偏好設定
    "cogs.clan", // 戰隊系統
    "cogs.response", // 基本回覆
    "cogs.tasks" // 排程任務
  ],
  "helpTitle": "哈囉~ 歡迎使用 AI キャル", // 使用help時的主要提示文字
  "AssetsURL": "https://randosoru.me/static/assets", // 圖片素材之網址
  "RediveJP_DB": [
    "https://redive.estertion.win/db/redive_jp.db.br", // 日版資料庫
    "https://redive.estertion.win/last_version_jp.json" // 日版資料庫版本
  ],
  "RediveTW_DB": [
    "https://randosoru.me/redive_db/redive_tw.db.br", // 台版資料庫
    "https://randosoru.me/redive_db/version.json" // 台版資料庫版本
  ],
  "keywordGSheet": {
    // 於Google Sheets上的角色關鍵字匹配表
    "key": "12QiLoCODWr4TRVGqwXROCYenh2xz-ZXqhDMgzUi7Gz4",
    "gid": "755815818"
  },
  "DEBUG_CHANNEL": null, // Discord文字頻道ID, 供傳送錯誤訊息用
  "MONGODB_URL": "mongodb://username:password@host:port", // MongoDB網址
  "GUILD_API_URL": "https://guild.randosoru.me/api", // 戰隊管理協會API
  "GUILD_API_TOKEN": "GUILD_API_TOKEN", // API Token
  "GAME_API_URL": "https://example.com", // 個人檔案API
  "GAME_API_TOKEN": "GAME_API_TOKEN", // API Token
  "PCRwiki": "https://pcredivewiki.tw/Character/Detail", // 蘭德索爾圖書館 角色資訊頁面之網址
  "EmojiServers": {
    // 抽卡模擬時所使用之emojis, emoji名稱需為4位數unit_id
    "1": [802234826413178920], // 1星角色之Discord伺服器ID
    "2": [802241470878187570], // 2星角色之Discord伺服器ID
    "3": [802241643121999883], // 3星角色之Discord伺服器ID
    "Pickup": [850065739590139957] // Pickup角色之Discord伺服器ID
  },
  "RankData": {
    // Rank推薦來源
    "emonight": {
      // 漪夢奈特emonight所提供之Google Sheets表格
      "key": "",
      "gid": "",
      "sql": "select%20*"
    },
    "nonplume": {
      // 無羽nonplume所提供之Google Sheets表格
      "key": "",
      "gid": "",
      "sql": "select%20*"
    }
  }
}

備註:

  • 上方 Google Sheets 之keygid可於網址內獲取, 例如 https://docs.google.com/spreadsheets/d/{key}/edit#gid={gid}
  • 4 位數 unit_id 之格式為1xxx, 如凱留為1060
  • 若需使用戰隊管理協會 API, 請聯繫我申請

About

A Discord bot for Princess Connect Re:Dive.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published