Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
4670c5e
Finish rewriting the updater and make modules for other parts of the bot
Dragovorn Feb 7, 2019
e1343ce
Write some basic code for JFX
Dragovorn Feb 7, 2019
0fe9673
Major refactor to Updater main and minor refactor to other classes
Dragovorn Mar 10, 2019
e14bd1f
worked on basic GUI library
Dragovorn Mar 23, 2019
ccf7ac8
Mass refactor GUI code, added some more classes to the API too
Dragovorn Jun 28, 2019
3852797
Finish up scenes and rename DragonBotApplication to Main, because tha…
Dragovorn Jun 28, 2019
2b76363
Write initial framework of the bot, also refactor GUIs again
Dragovorn Jun 29, 2019
0d1ed0e
try and fix travis
Dragovorn Jun 29, 2019
1b9b276
pls travis why are you broken now
Dragovorn Jun 29, 2019
92c5aa0
Pull scenes out to an interface, and begin populating them
Dragovorn Jun 29, 2019
0dbedcb
Begin expanding API and begin developing configuration system, when t…
Dragovorn Jun 30, 2019
5942151
make configuration saving testable
Dragovorn Jul 1, 2019
28575cc
Document and further implement oop in configurations
Dragovorn Jul 1, 2019
1713b5b
Finish configuration code
Dragovorn Jul 1, 2019
e8ce3da
come up with a temporary solution to advanced json for configurations
Dragovorn Jul 1, 2019
e2004f4
Expand tests to cover new functionality in configuration
Dragovorn Jul 1, 2019
b26d02b
begin implementing configurations and fix a bug with them too
Dragovorn Jul 1, 2019
ddb2986
Rewrite GUI system to avoid double object construction
Dragovorn Jul 1, 2019
a3f2af9
remove extra method call in BotAccountScene, it's no longer required …
Dragovorn Jul 1, 2019
0dcd5fd
Add comments to the new GUI code for future me, because something tel…
Dragovorn Jul 1, 2019
aa70b33
resolve build warnings using maven build profiles, aka maven wizardry
Dragovorn Jul 1, 2019
763715d
Fix resources in core, tried to avoid over-filtering, but ended up br…
Dragovorn Jul 1, 2019
4c26d57
Clean up GUI classes to avoid using strings as references and make it…
Dragovorn Jul 1, 2019
ec83d93
I really like watching the gource of this repo so i wrote a script to…
Dragovorn Jul 1, 2019
5543645
Add shutdown hook, add confirmation on logout, and begin working on l…
Dragovorn Jul 1, 2019
75f9c27
Rewrite GUIs to handle sub-stages and make the twitch account login o…
Dragovorn Jul 5, 2019
4437f4f
Work more on twitch access_token from the login page
Dragovorn Jul 6, 2019
8fda679
Successfully get access_token, now for getting username from access_t…
Dragovorn Jul 6, 2019
eaff41e
Get login with Twitch working porperly!
Dragovorn Jul 9, 2019
90950fb
Fix test
Dragovorn Jul 9, 2019
b9afdb1
add shebang line
Dragovorn Jul 9, 2019
3b3ff8a
Minor tweaks to APIManager
Dragovorn Jul 9, 2019
57790c0
Refector connections and channels, time to make it connect to the IRC
Dragovorn Jul 10, 2019
ca29901
Resolve build issues, but im done coding for today
Dragovorn Jul 10, 2019
4c358c8
Literally the most aggressive refactor I've done in my life
Dragovorn Jul 10, 2019
bdaa704
Forgot a few other classes that needed refactoring
Dragovorn Jul 10, 2019
f0672f0
Time to start testing IRC connectivity
Dragovorn Jul 10, 2019
f436f08
Work on event handling and get ready to start debugging irc connectio…
Dragovorn Jul 11, 2019
7cc513e
Make event bus work!
Dragovorn Jul 11, 2019
2740954
Implement event bus and add events to API and listeners to twitch, be…
Dragovorn Jul 12, 2019
e0778e1
We're finally properly connecting to twitch!
Dragovorn Jul 12, 2019
3832c3c
Expand the message handler, almost ready to test it
Dragovorn Jul 13, 2019
72890b3
Twitch connectivity is 100% complete!
Dragovorn Jul 13, 2019
a44462a
Begin working on command handling, almost done with that, next comes …
Dragovorn Jul 14, 2019
517d8f4
Quickly clean up githubcomamnd code
Dragovorn Jul 14, 2019
63437f7
Almost done with command manager, just need to add overflow arguments…
Dragovorn Jul 15, 2019
9459be3
Get commands working!
Dragovorn Jul 16, 2019
e6b2303
Create basic plugin layout
Dragovorn Jul 16, 2019
5821847
Plugin loading is now complete, all that's left is minor GUI elements…
Dragovorn Jul 18, 2019
75310e3
drop dangling imports
Dragovorn Jul 18, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions .gitignore
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
**/.idea/
**/*.iml
**/.DS_Store
**/target/
**/dependency-reduced-pom.xml
**/out/
**/DragonBot/
**/.idea/
**/*.iml
**/.DS_Store
**/target/
**/dependency-reduced-pom.xml
**/out/
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

11 changes: 7 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
language: java
jdk: oraclejdk8
notifications:
email: false
language: java
sudo: required
dist: trusty
notifications:
email: false
jdk:
- oraclejdk8
42 changes: 21 additions & 21 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
MIT License

Copyright (c) 2019 Andrew Burr

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
MIT License
Copyright (c) 2019 Andrew Burr
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
47 changes: 7 additions & 40 deletions README.md
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,40 +1,7 @@
Dragon Bot
==========
The Dragon Bot is a [Twitch](https://twitch.tv/ "Twitch.tv") bot that allows other developers to make plugins and expand it to make it better,
this bot was created with the ideas that [Spigot](https://www.spigotmc.org/ "Spigot's Webpage") was created under. To allow the users to make their
own addons to it to make it fit their needs.

**This project uses Java 8 so please make sure you have it**

Plugins
-------
These are some plugins that I have made for the bot that serve as a nice way to introduce people to the API that comes with it.

- [Essentials](https://github.com/Dragovorn/essentials "Dragon Bot Essentials' Github") - A plugin aimed at adding essential functionality to the bot.

API
---
You can get access to the API by downloading the bot's jar file and including it in your build path
or you can run `mvn install` on the latest tag.

**I need to get around to putting the bot on my maven repo**

Compiling
---------
I use maven (as apparent by the presence of a `pom.xml`) so you can get 'nightly' builds
by cloning the repo and running `mvn package shade:shade`

Deprecation Policy
------------------
I like to clean deprecated things out as quickly as possible, sometimes something that is
not deprecated might get removed too because I replaced it with something I think to be more effective.

Feature Requesting
------------------
Please request a feature by either making a pull request with said feature or making an issue
requesting said feature.

Help me out
-----------
Help me continue working on this bot by donating so I can keep my workstation running
and maybe if I have enough money I can get a Jenkins build server running. [Donate here](https://twitch.streamlabs.com/Dragovorn)
Dragon Bot
==========
![Code size](https://img.shields.io/github/languages/code-size/Dragovorn/dragon-bot.svg)

At the moment the bot works *technically*, what does that mean? The bot can join a channel, load plugins,
process commands, and chat. But currently it doesn't have it's GUI fully complete, that means that an end
user cannot use it, but the code is feature complete.
45 changes: 45 additions & 0 deletions api/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>parent</artifactId>
<groupId>com.dragovorn.ircbot</groupId>
<version>2.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>api</artifactId>
<packaging>jar</packaging>
<profiles>
<profile>
<id>build-bot</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
</profile>
</profiles>
<build>
<finalName>dragonbotapi-${project.version}</finalName>
<defaultGoal>clean package</defaultGoal>
</build>
<dependencies>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>26.0-jre</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.5</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.2</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
3 changes: 3 additions & 0 deletions api/src/main/java/com/dragovorn/ircbot/api/IAPI.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package com.dragovorn.ircbot.api;

public interface IAPI { /* Marker class */ }
9 changes: 9 additions & 0 deletions api/src/main/java/com/dragovorn/ircbot/api/IAPIManager.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.dragovorn.ircbot.api;

public interface IAPIManager {

void registerAPI(IAPI api, Class<? extends IAPI> clazz);
void registerAPI(Class<? extends IAPI> clazz, Object... params);

<T extends IAPI> T getAPI(Class<T> clazz);
}
57 changes: 57 additions & 0 deletions api/src/main/java/com/dragovorn/ircbot/api/bot/IIRCBot.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
package com.dragovorn.ircbot.api.bot;

import com.dragovorn.ircbot.api.IAPIManager;
import com.dragovorn.ircbot.api.command.ICommandManager;
import com.dragovorn.ircbot.api.event.IEventBus;
import com.dragovorn.ircbot.api.factory.IFactory;
import com.dragovorn.ircbot.api.gui.IGuiManager;
import com.dragovorn.ircbot.api.irc.IDispatcher;
import com.dragovorn.ircbot.api.irc.IIRCServer;
import com.dragovorn.ircbot.api.plugin.IPluginManager;
import com.dragovorn.ircbot.api.user.IUser;
import com.dragovorn.ircbot.api.user.UserInfo;
import com.google.gson.Gson;
import org.apache.http.client.HttpClient;

import java.io.IOException;
import java.nio.file.Path;

public interface IIRCBot {

void startup();
void shutdown();
void connect() throws IOException;
void sendRaw(String line);

boolean isRunning();
boolean isLogRawLinesEnabled();

String getVersion();
String getName();

IGuiManager getGuiManager();

IAPIManager getAPIManager();

ICommandManager getCommandManager();

IIRCServer getServer();

IEventBus getEventBus();

Thread getMainThread();

Path getHomePath();

IUser getAccount();

IFactory<? extends IUser, UserInfo> getUserFactory();

IDispatcher getDispatcher();

IPluginManager getPluginManager();

HttpClient getHttpClient();

Gson getGSON();
}
14 changes: 14 additions & 0 deletions api/src/main/java/com/dragovorn/ircbot/api/bot/IRCBot.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.dragovorn.ircbot.api.bot;

public abstract class IRCBot implements IIRCBot {

private static IIRCBot instance;

public IRCBot() {
instance = this;
}

public static IIRCBot getInstance() {
return instance;
}
}
13 changes: 13 additions & 0 deletions api/src/main/java/com/dragovorn/ircbot/api/command/Command.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.dragovorn.ircbot.api.command;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface Command {

String value();
}
10 changes: 10 additions & 0 deletions api/src/main/java/com/dragovorn/ircbot/api/command/Executor.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package com.dragovorn.ircbot.api.command;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface Executor { }
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.dragovorn.ircbot.api.command;

import com.dragovorn.ircbot.api.exception.command.CommandExecutionException;
import com.dragovorn.ircbot.api.irc.IChannel;
import com.dragovorn.ircbot.api.irc.IConnection;
import com.dragovorn.ircbot.api.user.IUser;

public interface ICommandManager {

void setPrefix(char prefix);
void register(Object obj);
void setLogInvalidCommand(boolean logInvalidCommand);
void setLogInvalidArgument(boolean logInvalidArgument);
void execute(IChannel channel, IUser user, IConnection connection, String line) throws CommandExecutionException;

boolean isLogInvalidCommandEnabled();
boolean isLogInvalidArgumentEnabled();

char getPrefix();
}
17 changes: 17 additions & 0 deletions api/src/main/java/com/dragovorn/ircbot/api/command/Parameter.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.dragovorn.ircbot.api.command;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.PARAMETER)
public @interface Parameter {

String DEFAULT_NAME = "[DEFAULT NAME]";

ParameterType value();

String name() default DEFAULT_NAME;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.dragovorn.ircbot.api.command;

public enum ParameterType {
USER,
CHANNEL,
CONNECTION,
ARGUMENT
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package com.dragovorn.ircbot.api.command.argument;

public interface IArgument<T> {

void parse(String data);

boolean is(String data);

T get();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.dragovorn.ircbot.api.command.argument;

public class StringArgument implements IArgument<String> {

private String data;

@Override
public void parse(String data) {
this.data = data;
}

@Override
public boolean is(String data) {
return true;
}

@Override
public String get() {
return this.data;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package com.dragovorn.ircbot.api.command.argument.annotation;

import com.dragovorn.ircbot.api.command.argument.IArgument;

import java.lang.annotation.ElementType;
import java.lang.annotation.Repeatable;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Repeatable(Arguments.class)
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface Argument {

String key();

Class<? extends IArgument> clazz();

boolean required() default true;
boolean overflow() default false;
}
Loading