Coder Social home page Coder Social logo

hackerhero0x01 / discord-bot Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mangalakulal105/discord-bot

0.0 0.0 0.0 5.05 MB

License: Apache License 2.0

Shell 0.11% JavaScript 1.20% TypeScript 78.14% CSS 0.39% HTML 0.08% Dockerfile 0.60% Svelte 19.47%

discord-bot's Introduction

AWS Amplify Discord Bot: "hey-amplify"

This repository contains the source code for the AWS Amplify Discord Server's bot!

Features

  • auto-threads "help" channels; if a channel follows the <category>-help naming convention messages will automatically get converted into threads
    • thread data is tracked by title, original poster ID, and whether the thread is solved (GET /api/questions)
  • dashboard component to visualize questions and channel "health"
  • support for GitHub to Discord webhooks (used for posting release notes)
  • command: /admin mirror <repository> accepts a REPOSITORY and posts the thread to GitHub Discussions
  • command: /contribute - accepts an Amplify project argument and returns the GitHub contribution URL
  • command: /github - accepts an Amplify project argument and returns the GitHub repository URL
  • command: /giverole - accepts a ROLE and USER argument to grant a role (NOTE: this command is disabled by default for @everyone)
  • command: /login sends an ephemeral link to login to GitHub and link accounts
  • command: /thread - command suite for thread owners
    • /thread rename <title> - allows thread owners to rename their threads
    • /thread archive - allows thread owners to optionally archive their thread
    • /thread solved - allows thread owners to mark their question (thread) as "solved", which changes prepended ? with โœ…
    • /thread reopen - allows thread owners to "reopen" their question (thread), which changes prepended โœ… with ?
  • supports multiple guilds

Getting Started

Pre-requisites:

  • Node.js v18.x
  • pnpm v7.13.1

Quick Start

  1. gh repo fork aws-amplify/discord-bot
  2. pnpm setup-dev
  3. Using .env.sample as a template, create a .env file and add necessary Discord environment values
  4. Run the application with pnpm dev
  5. As the server owner navigate to http://localhost:3000/, log in, and visit /admin to configure the instance

Setting up a Discord Bot

  1. (optional) create a new Discord server or create from the AWS Amplify Discord server template

  2. Register Discord bot

  3. Make note of the App ID to add the bot to your Discord server using the following URL

    https://discord.com/api/oauth2/authorize?client_id=<app-id>&permissions=335812774976&scope=bot%20applications.commands
    
  4. Enable OAuth and add http://localhost:3000/api/auth/callback/discord as a redirect

  5. Make note of the OAuth secrets and populate .env

Required Bot Permissions

The URL noted in step 2 above has the permissions integer of 335812774976 which includes the following bot permissions:

bot permissions

Contributing

Learn how to get started with our contribution guide

discord-bot's People

Contributors

josefaidt avatar web-flow avatar github-actions[bot] avatar nadetastic avatar anilmaktala avatar esauerbo avatar mauerbac avatar ykethan avatar arundna avatar atierian avatar palpatim avatar dependabot[bot] avatar hackerhero0x01 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.