Skip to content
A Discord-Framework made in Java on top of Discord 4J. Made for making the creation of Bot's for Discord quicker
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src/main/java/com/mjr/discordframework
.classpath
.gitignore
.project
README.md
pom.xml

README.md

Discord-Framework

A Discord-Framework made in Java on top of Discord 4J. Made for making the creation of Bot's for Discord quicker

Basic, How to use/Example of usage

MainClass

public class MainClass {
	public static DiscordBot bot;
	
	public static void main(String[] args) {
		bot = new DiscordBot("TOKENHERE");
	}
}

DiscordBot Class

public class DiscordBot extends DiscordBotBase {
	public DiscordBot(String token) {
		super(token);
		setupEvents();
	}

	@Override
	public void onOutputMessage(MessageType type, String message) {
		if (type == MessageType.Error)
			this.sendMessage(DiscordBotUtilities.getChannelByID(this.getClient(), Snowflake.of("CHANNEL_ID_HERE")), "Error: " + message)

		else
			System.out.println(message);
	}

	@Override
	public void setupEvents() {
		this.getDispatcher().on(MessageCreateEvent.class).onErrorContinue((t, o) -> this.onOutputMessage(MessageType.Error, "Error while processing ReactionRemoveEvent Error: " + t.getMessage())).subscribe(event -> event.getMessage().getContent().ifPresent(c -> System.out.println("Message was created here is the content" + event.getMessage().getContent().get())));
	}
}

Current Version: 1.1.3

With Maven

In your pom.xml add:

<repositories>
  <repository>
    <id>maven.mjrlegends.com</id>
    <url>https://maven.mjrlegends.com/</url>
  </repository>
</repositories>

<dependencies>
  <dependency>
    <groupId>com.mjr.discordframework</groupId>
    <artifactId>Discord-Framework</artifactId>
    <version>@VERSION@</version>
  </dependency>
</dependencies>

With Gradle

In your build.gradle add:

repositories {
  	maven {
	    name 'MJRLegends'
	    url = "https://maven.mjrlegends.com/"
    }
}

dependencies {
  compile "com.mjr.discordframework:Discord-Framework:@VERSION@"
}

Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. For more information on the license see https://tldrlegal.com/license/creative-commons-attribution-noncommercial-noderivs-(cc-nc-nd)#summary

You can’t perform that action at this time.