npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

monhu-discordjs

v0.0.5

Published

MonitorHumanが作った、簡単にDiscordのBotを作成するNPMモジュール

Downloads

14

Readme

MonHu-Discord.js

MonitorHumanが作った、簡単にDiscordのBotを作成するNPMモジュール

使い方

必要なソフト

必要なソフトは以下のとおりです。 予めインストールしておいてください。

  • Node.js v12
  • NPM v6
  • 適当なテキストエディタ(メモ帳可)

導入

導入は至って簡単です。

まず、適当なフォルダを作成します。 導入するには、コマンドプロントかPowerShellを開き、先程作成したフォルダに行きます。

cd ※先程のフォルダのパスで移動できます。

移動したら、npm i monhu-discordjsを実行しましょう。

導入は完了です。

Botの作成

Discordのアプリケーションを作成する。

Discordはアプリケーションの中にBotという形で存在します。 そのアプリケーションを作成して、Botを作ります。

Discord Developer Portal に行って、アプリケーションを作成します。

※すでにログインを済ませた状態で話を進めます。

アプリケーションを作成したら、Botを作成します。

Botを作成するには、画面左側のBotのタブを開き、Botを作成します。

このときに出来る、token(トークン)をメモ(PCで)をしておいてください。

メモが終わったら、画面左側のOAuth2のタブを開き、SCOPESのチェックのところのbotのみを押し招待リンクを生成してください。

その招待リンクを開き、導入したいサーバーに参加させてあげてください。

これで、Botの準備は完了!

プログラムを書く

MonHu Discord.jsは非常に簡単に作られて、簡単にご利用いただけます。

先程作成したフォルダの中に、main.jsのJSファイルを用意します。

次に、main.jsの中に、

const mondjs = require("monhu-discordjs")

mondjs.config("./config.json")
mondjs.login("トークン")

を書きます。

mondjs.login("トークン")のトークンの部分に先程メモ等をしたトークンを貼り付けてください。

JSファイルの準備は完了!

次に、config.jsonを作成します。

中身は、

{
    "受け取るメッセージ": "お返しするメッセージ",
    "こんにちは!": "こんにちは!!",
    "!ping": "Pong!\n{ping}msです。"
}

など、好きなことを書いておきましょう!

これでプログラムを書くのは完了です。

実行

実行は、node main.jsです。

簡単ですね!

実行が出来たら、コマンドプロント等に準備が出来ましたと言われます。

コマンドプロント等のウィンドウは閉じないで、そのままにしておきましょう。

完了。

これでBotは動いてるはずです。

何か不備等がございましたら、開発者がいるサーバーに行ってきましょう!

サポート

このモジュールについては、開発者がいるサーバーにご質問等をお願いいたします。

MonHu Discord.jsのサポートがほしいです!と言えば反応してくれます。

楽しいDiscord生活を。MonHuでした。