Code Monkey home page Code Monkey logo

discord-connect's Introduction

Discord Connect

Implements Discord OAUTH2 within ease. OOP-like API!

Explore API

Documentation

Download

go get github.com/Z3NTL3/discord-connect

Example

package main

import (
	"fmt"
	"log"
	"reflect"
	"time"

	discordconnect "github.com/Z3NTL3/discord-connect"
)

func main() {
	application := discordconnect.AppContext{
		// Dummy app context
		Client_id: "1131879305987760208",
		Client_secret: "9spr9szfgLvEsV0TjsqH0OaIJ97lVjMR",
		Code: "7ey3za64UPN4DA0xgIYTAGZ4HKSWOW",
		Grant_type: "authorization_code",
		Redirect_uri: "http://localhost:2000/api/v1/discord/callback",
	}

	client := discordconnect.Initialize(time.Duration(time.Second * 5), application)
	
	// client.SetProxy("http://root:root@localhost:9050")
	err, resp := client.Connect(); if err != nil {
		log.Fatal(err)
	}

	ctx := reflect.ValueOf(*resp)
	for i := 0; i < ctx.NumField(); i++ {
		if ctx.Field(i).CanInt() {
			fmt.Println("["+ctx.Type().Field(i).Name+"]", ctx.Field(i).Int())
			continue
		}

		fmt.Println("["+ctx.Type().Field(i).Name+"]", ctx.Field(i).String())
	}
}

discord-connect's People

Contributors

z3ntl3 avatar

Stargazers

Wisdom Moore 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.