Code Monkey home page Code Monkey logo

gitcord's Introduction

GitCord


Discord

Work with Github feeds efficiently, specifically made for discord bots.

Features

  • Easy, simple & efficient
  • Can be used in many other projects other than discord bots
  • Upto 50 repositories feeds (supports "all" option to get rid of long-chain)
  • Detailed & beginner-friendly documentation
  • Supports 90% of the events

Example

const GitCord = require("gitcord");
// You can pass options in the constructor
// "token" is used for setting your Github token, increases requests limit
// "all" is used for getting all the repositories, upto 50 repositories
const cord = new Github("GITHUB_ACCOUNT_USERNAME", {
  token: "GITHUB_TOKEN",
  repositories: ["...", "..."],
  all: false,
});

cord.on("start", (data) => doSomethingWithData(data));
cord.on("newEvent", (data) => doSomethingWithData(data));
cord.on("repositoryCreate", (data) => doSomethingWithData(data));

cord.initialize();

๐Ÿฑโ€๐Ÿ How to use on Discord ?

const { Client } = require("discord.js");
const GitCord = require("gitcord");

const client = new Client({ intents: ["GUILDS", "GUILD_MESSAGES"] });
const cord = new GitCord("GITHUB_ACCOUNT_USERNAME", {
  token: "GITHUB_TOKEN",
  repositories: ["...", "..."],
});

client.on("ready", () => {
  console.log("Connected to the discord, now ready for fight :D");
});

cord.on("start", () => {
  console.log("Connected to the github, now ready for war :D");
});

// "newEvent" gets triggered on every github event
// meaning it will even get triggered on unknown events.
cord.on("newEvent", (eventData) => {
  // `eventData` is the unknown-parsed data
  // its recommended to use specific events to avoid confusion and issues.
  client.channels.cache
    .get("LOGS_CHANNEL_ID")
    .send({ embeds: [eventData.embed] });
});

client.login("DISCORD_BOT_TOKEN");

// Same as `client.login()` but for GitCord.

cord.initialize();

Miscellaneous

  • ๐Ÿ“ƒ Documentation: Check Wiki
  • ๐Ÿ— Modules used: axios
  • ๐ŸŽ‡ Sponser: Download riad shadaw legexds!!!!
  • โœจ Links: Discord, Youtube

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.