Code Monkey home page Code Monkey logo

abc's Introduction

Discord.js Ver14 BotSample

コマンドごとにファイル分けされたBotを作るサンプル
Replitの方はこちらをご覧ください


このテンプレートは鮎月さんのV13テンプレートをV14に翻訳したものとなります。

主な仕様

  • discord.js Ver14, @discordjs/rest Ver10, @discordjs/builders, discord-api-typesを使用
  • 各種イベントや、コマンドごとにファイル分けが可能。処理も各ファイルに記述することで基幹処理部分(index.js)のコードが長くならないように。

使い方(Replit以外)

  1. git clone -b master https://github.com/ritsu-me/V14bot.git を実行して、このソースをクローンする
  2. npm install --omit=devで関連ライブラリをインストールする
  3. config.js内部の案内の通りIDをペーストする
  4. .env.EXAMPLEの.EXAMPLEの部分を外し、BOT_TOKEN=に続く部分にここで取得したBotのトークンを貼る
  5. index.jsを実行

Replitでの使い方

  1. git clone -b master https://github.com/ritsu-me/V14bot.git を実行して、このソースをクローンする
  2. npm install --omit=devで関連ライブラリをインストールする
  3. config.js内部の案内の通りIDをペーストする
  4. .env.EXAMPLEというファイルを削除し、Replitの「Secrets」という項目(鍵のマーク)にkeyにBOT_TOKEN、valueにここで取得したBotのトークンを貼る
  5. index.jsの7行目とadd_command.jsの4行目のrequire("dotenv").config()を消す
  6. index.jsを実行

コマンド追加方法(共通)

ターミナル、コマンドプロンプト等でnode add_command.jsを実行することで追加されます。

上記の方法でエラーや不具合がありましたらDiscord:律-Ritsu#0001のDMまでお願いします。
エラー等はお近くのNode.js有識者の方にお願いします。
当方ではDiscordを引退したためサポートしておりません。

2023年1月24日一部修正
2023年3月13日サポート終了

abc's People

Contributors

dependabot[bot] avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.