Code Monkey home page Code Monkey logo

discord-bot's Introduction

Go Report Card Go Doc Release Chat on Discord

Jexia Discord Bot

A Discord bot covering all of the functions needed on Jexia's Discord server.

Variables Description Example Value
token The token provided by Discord to authenticate the gateway and API requests Discord Token
prefix The value prefixing the commands that are called though a Discord message !
address The value of the API server 0.0.0.0:80
Endpoints Description Events Supported
/github/{channelID} This is the endpoint for receiving GitHub's webhook payload events. Should be added as if it was a webhook. The message will be sent the the Discord channel matching channelID. release
Commands Description Permissions Required
ping This command simply returns the time taken to respond to an event. none

discord-bot's People

Contributors

baileyjm02 avatar jeroenrinzema avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

discord-bot's Issues

Rethink internal types

There is currently a dependancy of the internal discord package in both the github and commands packages due to the Discord message type. This dependancy needs to be removed and replaced with a global type that covers the functions needed in all instances. This should live in a internal/pkg/types package, for example, and should not import any external or internal packages. This helps achive the aim of having an importable type, allowing the decoupling of all internal packages.

Add test cases for HTTP requests

We currently don't have any tests, as a start point, tests for the following are needed:

  • GitHub webhook
  • Send message API request
  • Ping command (This may require a special use case)

Create Jexia API wrapper

Creating the Jexia API wrapper should allow for data to be stored and retrieved from the database for the following actions:

  • Subscribe to repository events
    • Allow users to select which repository to watch
    • Store the channel the message will be sent to
  • Store guild settings for each repository in an object
  • Analytical data
    • Number of events recieved over the payload
    • Number of command requests sent

Session does not reconnect

When Discord requests the client to reconnect, the session crashes with a fatal error:

(session.go:61) s.read: failed to read JSON message: failed to get reader: received close frame: status = StatusGoingAway and reason = "Discord WebSocket requesting client reconnect." 

By the look of it, the message is not being read properly and is therefore failing.

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.