Git Product home page Git Product logo

jdiscord.id's Introduction

JDiscord.id

JDiscordID is the User Information Grabber Asynchronous Libarary for Discord Only by Using UserID. Easy To Use also can get Public Data of Any Discord User by its UserID.

Why?

I got some free time so i made this and maybe i use this in future because most of the Discord API Wrappers don't provide global user data and only shows details about user in a Guild. (if they do so idk i just made this)

Version : 0.1

Add to your projects

Easy to add in your projects using gradle, maven or jar

Gradle

  • Add it in your root build.gradle at the end of repositories:
allprojects {
		repositories {
			maven { url 'https://jitpack.io' }
		}
	}
  • Add the dependency (replace version with the version on top)
dependencies {
	        implementation 'com.github.shivam1608:JDiscord.id:0.1'
	}

Maven

  • Add the repository in pom.xml file
	<repositories>
		<repository>
		    <id>jitpack.io</id>
		    <url>https://jitpack.io</url>
		</repository>
	</repositories>

  • Add the dependency (replace version with the version on top)
<dependency>
	    <groupId>com.github.shivam1608</groupId>
	    <artifactId>JDiscord.id</artifactId>
	    <version>0.1</version>
	</dependency>

Jar

Download the jar from this repo or release page

out/artifact/JReplDB_Jar

How to Get Token

DOCS

Here's the Docs to Use Lib

First Create an Instance

JDiscordID id = new JDiscordID("TOKEN_HERE");
  • Then Implement the EventAdapter
public class xyz implements EventAdapter{}
  • The Register the Implemented Class
id.registerEventAdapter(new xyz());

And Now Its all setup and ready to go

Search() Method

It is the only method to search for user by their IDs

id.search("USER_ID_HERE");

How to read the response?

It is very easy to read response as we have already implemented the EventAdapter

@Override
    public void onUserFound(User user) {
        //....
    }

    @Override
    public void onUserNotFound(Response response) {
       //......
    }

    @Override
    public void onError(Response response) {
    //....
    }

Different Methods are called according to sitution

Quick Start

import me.shivzee.JDiscordID;
import me.shivzee.io.EventAdapter;
import me.shivzee.utils.Response;
import me.shivzee.utils.User;

public class Main implements EventAdapter {

    public static void main(String[] args) {
        JDiscordID id = new JDiscordID("TOKEN_HERE");
        id.registerEventAdapter(new Main());
        id.search("USERID_HERE");
    }

    @Override
    public void onUserFound(User user) {
       //.....
    }

    @Override
    public void onUserNotFound(Response response) {
        //.....
    }

    @Override
    public void onError(Response response) {
        //.......
    }
}

The User.class

Methods

        System.out.println("UserID : "+user.getUserID());
        System.out.println("Username : "+user.getName());
        System.out.println("Discriminator : "+user.getDiscriminator());
        System.out.println("AvatarUrl : "+user.getAvatarUrl());
        System.out.println("Time Created : "+user.getTimeCreated());
        System.out.println("Flags : "+user.getPublicFlags());
        System.out.println("isBot? : "+user.isBot());
        System.out.println("Raw JSON Response : "+user.getJsonRaw());

The Response.class

Methods

        System.out.println("Status : "+response.getStatus());
        System.out.println("Error/Response : "+response.getResponse());
        System.out.println("ResponseCode : "+ response.getResponseCode());

Credits

jdiscord.id's People

Contributors

shivam1608 avatar

Stargazers

 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.