Code Monkey home page Code Monkey logo

discord-chuck-norris's Introduction

Discord-Golang-Bot

This is a Discord Chuck Norris bot that returns you a Chuck Norris joke when asked for. Integrate it with your Discord server in under five minutes.

App GIF

Requirements

  1. hasura CLI tool
  2. A Discord server

Setup Guide

Get the project

$ hasura quickstart rishi/discord-golang-bot

Create a webhook to send messages on your channel

  1. Go to your Discord server.

  2. Click on the down arrow next to your server name and click on Server Settings.

  3. Select the Webhooks section from the left pannel. Create a webhook.

  4. Copy the Webhook URL and add it to project secrets since it contains a secret token that you do not want to explicitly mention in the code.

$ hasura secret update discord.webhook <webhook_url>

Create a bot on discord

  1. Create an application.

  2. Now, in your application home page, scroll down to Bots and create a bot.

  3. Make the bot public.

  4. Make sure that the Require OAuth2 Code Grant checkbox is not checked.

  5. Add the bot to your server by clicking on Generate OAuth URL and navigating to the generated URL from the browser.

  6. Copy the bot token and add it to the project secrets.

$ hasura secret update discord.bot.token <bot_token>

Push the project to the cluster

$ git add .
$ git commit -m "First commit"
$ git push hasura master

Usage

Type !joke in the server chat and see the magic :)

Modification

This project can also be used as a starter for building more complex Discord bots. The source code for the bot lies in the microservices/bot/app/src/ directory.

You might also want to look at the Dockerfile and the k8s.yaml at microservices/bot/ if you are to add some extra packages or environment variables.

References

  1. Special thanks to "bwmarrin" for the discord bindings for golang.
  2. Built on top of Hasura boilerplate hello-golang-raw.

discord-chuck-norris's People

Contributors

0x777 avatar anirudhmurali avatar ecthiender avatar jaisontj avatar praveenweb avatar rakeshkky avatar rikinsk avatar shahidhk avatar vksci123 avatar wawhal avatar

Stargazers

 avatar  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.