Thanks to visit codestin.com
Credit goes to github.com

Skip to content

VEDA00133912/ts-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bun-bot

Discord.js v14 を使用した Bun 向けの Discord BOTサンプル
TypeScriptです

ディレクトリ構成

bun-bot/
├─ src/
├─ assets/             # 画像や静的ファイル
├─ commands/           # スラッシュコマンド
├─ events/             # Discordイベントハンドラ
├─ lib/                # 外部API呼び出しや共通ライブラリ
├─ utils/              # ユーティリティ関数
├─ types/              # 型定義ファイル
├─ types.ts            # Bot 全体で使う共通型定義
├─ index.ts            # エントリーポイント(BOT起動ファイル)
├─ registerCommands.ts # コマンド登録処理
├─ .env
├─ .gitignore
├─ bun.lock
├─ package.json
└─ tsconfig.json

環境構築

Linux / macOS

curl -fsSL https://bun.sh/install | bash

Windows (PowerShell)

powershell -c "irm bun.sh/install.ps1 | iex"

パス反映

source ~/.bashrc

インストールできたか確認(versionでれば成功)

bun --version

インストール

git clone https://github.com/veda00133912/bun-bot.git
cd bun-bot
bun install

環境変数設定

プロジェクトルートに.envを作成して設定

DISCORD_TOKEN=BOTのTOKEN
CLIENT_ID=BOTのID
GUILD_ID=DiscordサーバーID
XGD_API_KEY=x.gdのAPIキー

起動

変更があった場合自動で再起動してくれるやつ

npm run dev

普通に起動

npm start

run

コマンド

c1 c2 c3

About

RilumeのTS化をやってみる

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published