/gatekeeper

🔐A discord Verification Bot(using hCaptcha.)

Primary LanguageJavaScriptMIT LicenseMIT

↓↓↓日本語は下にあるよ↓↓↓

Run on Repl.it

English

🔐 A Discord Verification Bot

overview

This is an verification bot that is easy to configure using hCaptcha and has strong protection.

This repository is inspired of nates/ward! Thanks for nate!

🔌 Requirements

  • Node.js(Version 16.9.x or later)
  • npm(or yarn)
  • Execution environment(I used replit)
  • expectations :D

📲 Install

npm install

or...

yarn install

🖍️ Setup

Rest assured ... these are really easy!

  1. Bot Create

Let's finish these

  1. Bot Priviliged Intents

Privileged Intents image

Please turn on both settings for this image.

  1. Bot configure

    1. Put your Discord Bot's Super Secret Dynamic Token in .env!
    token=YOUR_SUPER_SECRET_TOKEN

    or replit...
    Replit env image

    1. Let's change the contents of config.json.
      (The first line that says memo is a comment.)
    • domain
    • guild_id
      • The ID of the server that uses this verification bot.
    • role_id
      • An array of role IDs given when verified.
    • use_button
      • Whether to use the MessageComponent (MessageButton) when verificating. If you encounter a problem on Discord such as the button cannot be seen and you want to switch to verification by reaction, set this to false.
    • bot_owner_id
      • An array of IDs of people who can place this bot's verification panel. If anyone else sends a panel command, a warning will be displayed in the log.
    • use_japanese
      • If the member uses English, set it to false.
    1. Get the hCaptcha site key and secret key with here.

    Once you have the coolest site key and secret key, put them in your .env.

    site_key=YOUR_SITE_KEY
    secret_key=YOUR_SUPER_SECRET_KEY

    or replit...
    replit_env_sitekey_image replit_env_secretkey_image

Complete! FOOOOOO!
Now let's start the bot! Then the bot should be online!

  1. Verification Panel Run !verify on the channel where you want to wake up the verification panel... panel

(If you don't see the panel, go to the troubleshooting section)

🔫 troubleshooting

  • The panel does not appear when I send !verify

    • Calm down and make sure your bot has VIEW_CHANNEL, SEND_MESSAGES, EMBED_LINKS, and READ_MESSAGE_HISTORY permissions on that channel!
    • Check for typos. I often see !verifi,1verify, "verify and so on.
    • Have you changed the bot prefix?
    • Did you mean that you changed the bot prefix, but you changed the japanese.js file and it wasn't reflected in english.js?
  • 'Verify' button is not displayed (panel is displayed)

    • It may be a Discord bug. Set use_button in config.json to false, then run !verify again to make it a reaction.
  • Logged in... is displayed in the Console, but Logged in as 〇〇! Is not displayed.

    • Check again to make sure the token is correct.
    • There is a possibility of Discord rate limiting. Try again in an hour.
  • At the verification webpage, hCaptcha has failed to initialize. Please see the developer tools console for more information.

    • Make sure the hCaptcha site key and secret key are set correctly.
  • When I press the 'Vefify' button, the Console says 'Type Error: Cannot read property 'id' of null' and Bot is thinking forever on Discord.

    • Is both 'Privileged Intents' turned on in the Developer Portal? If it is off, turn it on.
  • Verification is complete and the web page says 'Verified!', But no role has been granted and the Console shows Missing Permissions or Missing Access.

    • Make sure the bot has MANAGE_ROLES permissions and the Verified role is below the bot's top role.
    • Make sure the role ID and server ID are correct.

_ If the problem persists, please let us know in Issues or pull requests! _

日本語

🔐 Discord認証Bot

概要

これはhCaptchaを使用したDiscordでの認証Botです。

このリポジトリはnates/wardに影響されています! nateさんありがとう!

🔌 必要条件

  • Node.js(バージョン16.9.x以降)
  • npm(または yarn)
  • 開発環境(私はreplitを使用しています)
  • 完成したものへの期待()

📲 Install

npm install

もしくは

yarn install

🖍️ セットアップ

心配しないでね!かんたんだよ!

  1. ボットアカウント作成

Qiitaの記事とか見て終わらせてね

  1. 特権インテント

Privileged Intents image

この画像の**すべて(2つ)**の設定をONにしてね。

  1. Bot設定

    1. あなたの超スーパーシークレットトークンを.envに入れてね!
    token=とーくん

    Replitなら...
    Replit env image

    1. config.jsonの中身を変えよう!
      (最初に「memo」って書いてあるものはコメントです。)
    • domain
    • guild_id
      • 認証Botを使用するサーバーのID。
    • role_id
      • 認証が完了したときに付与されるロールIDの配列。
    • use_button
      • 認証URLを発行するときにメッセージコンポーネント(ボタン)を使用するかどうか。これをfalseにすると、リアクションを使用するようになります。
    • bot_owner_id
      • 認証パネルを作れる人のIDの配列。
    • use_japanese
      • 日本語を使用するサーバーではtrueにしてください。
    1. ここでhCaptchaのサイトキーと超スーパーシークレットキーを入手してください。

    入手できたら、.envにそれを入れてください。

    site_key=サイトキー
    secret_key=超スーパーシークレットキー

    Replitなら...
    replit_env_sitekey_image replit_env_secretkey_image

終了! FOOOOOO!
Botを動かしてみましょう!オンラインになるはずです!

  1. 認証パネル !verifyを送信してみましょう!認証パネルが出てくると思います! panel

(もし認証パネルが出てこない場合、トラブルシューティングセクションに写ってください。)

🔫 トラブルシューティング

  • !verifyを打っても認証パネルが出てこない

    • まず落ち着いて、Botにチャンネルを見るメッセージを送信埋め込みリンクメッセージの履歴を見る権限がこのチャンネルで許可されてることを確認してね!
    • 打ち間違いしてない?!verifiとか、1verify"verifyとかね。
    • Botのプレフィックス変えてない?
    • プレフィックスを変更したつもりが、english.jsだけ変更してて、japanese.js変更してないとかない?
  • パネルは出てくるけど、「認証」ボタンが出てこない

    • たぶんこれDiscordのバグだから、config.jsonuse_buttonfalseにして、もう一度!verifyしてリアクション認証にしてみて!
  • ログイン中...ってコンソールに出るけど、〇〇でログイン完了!と出ない

    • トークンがあってるか確認してみて!
    • Discordのレートリミットの可能性があるから、1時間後に試してみて!
  • 認証のウェブページでhCaptcha has failed to initialize. Please see the developer tools console for more information.と出る

    • hCaptchaのサイトキーとシークレットキーがあっているか確認してみて!
  • 「認証」ボタンを押したら、discord上では永遠に「考え中...」と出て、コンソール上では「Cannot read property 'id' of null」と出ている

    • 'Privileged Intents'オンにした?
  • 認証ページで「認証しました!」と出たけど、ロールが付与されておらず、コンソールにMissing PermissionsMissing Accessと出ている

    • Botにロールの管理権限があって、認証ロールがBotの一番上のロールより下であることを確認してね!
    • ロールIDとサーバーIDがあっているか確認してね!

_ これ以外の問題が起きたら、Issuespull requestsを気軽に立ててね! _