Discord4J 2.7.0 support

master
Pingex aka Raphaël 9 years ago
parent b1a59cbb15
commit 56ca209148

@ -38,7 +38,7 @@ dependencies {
compile group: 'commons-beanutils', name: 'commons-beanutils', version: '1.9.2'
// Discord Gateway API
compile group: 'com.github.austinv11', name: 'Discord4j', version: '2.6.1'
compile group: 'com.github.austinv11', name: 'Discord4j', version: '2.7.0'
// Util
compile group: 'net.jodah', name: 'failsafe', version: '0.8.3'

@ -10,13 +10,8 @@ general.plugins_dir = plugins
# Data storage location
general.storage_dir = data
# Initial connection token...
# Initial connection token
discord.token = tokenGoesHere
# ... or username/password combination if you don't use bot mode
# comment out discord.token if using us/pw tuple
#discord.username = email
#discord.password = superSecretPassword
# Command prefix
commands.prefix = !

@ -37,9 +37,7 @@ public class DiscordCommandableFramework
PluginLoader.getInstance().bulkLoadPlugins();
// Set up initial connection
ClientBuilder builder = new ClientBuilder();
if(Configuration.isConnectionToken()) builder.withToken(Configuration.CONNECTION_TOKEN);
else builder.withLogin(Configuration.CONNECTION_USERNAME, Configuration.CONNECTION_PASSWORD);
ClientBuilder builder = new ClientBuilder().withToken(Configuration.CONNECTION_TOKEN);
GatewayConnectionManager.registerConnection(builder);
// Register internal commands

@ -72,20 +72,4 @@ public class GatewayConnectionManager
LOGGER.debug("Update done. diff: +{} -{}", toRegister, toUnregister);
}
/**
* Reconnect a disconnected gateway connection
*/
@Deprecated
public static void reconnect()
{
try
{
connection.login();
}
catch (DiscordException e)
{
LOGGER.warn("User #" + connection.getOurUser().getID() + " failed to reconnect to the gateway.", e);
}
}
}