Search in sources :

Example 41 with JDAImpl

use of net.dv8tion.jda.internal.JDAImpl in project JDA by DV8FromTheWorld.

the class DirectAudioControllerImpl method disconnect.

@Override
public void disconnect(@Nonnull Guild guild) {
    Checks.notNull(guild, "Guild");
    JDAImpl jda = getJDA();
    WebSocketClient client = jda.getClient();
    client.queueAudioDisconnect(guild);
}
Also used : JDAImpl(net.dv8tion.jda.internal.JDAImpl) WebSocketClient(net.dv8tion.jda.internal.requests.WebSocketClient)

Example 42 with JDAImpl

use of net.dv8tion.jda.internal.JDAImpl in project JDA by DV8FromTheWorld.

the class DirectAudioControllerImpl method reconnect.

@Override
public void reconnect(@Nonnull AudioChannel channel) {
    Checks.notNull(channel, "Audio Channel");
    JDAImpl jda = getJDA();
    WebSocketClient client = jda.getClient();
    client.queueAudioReconnect(channel);
}
Also used : JDAImpl(net.dv8tion.jda.internal.JDAImpl) WebSocketClient(net.dv8tion.jda.internal.requests.WebSocketClient)

Example 43 with JDAImpl

use of net.dv8tion.jda.internal.JDAImpl in project SkyBot by DuncteBot.

the class ChangeLogCommand method execute.

@Override
public void execute(@Nonnull CommandContext ctx) {
    if (embedJson == null || embedJson.isEmpty()) {
        fetchLatetstGitHubCommits(ctx);
        return;
    }
    final JDAImpl jda = (JDAImpl) ctx.getJDA();
    final MessageEmbed embed = jda.getEntityBuilder().createMessageEmbed(DataObject.fromJson(embedJson));
    sendEmbed(ctx, new EmbedBuilder(embed));
}
Also used : EmbedBuilder(net.dv8tion.jda.api.EmbedBuilder) MessageEmbed(net.dv8tion.jda.api.entities.MessageEmbed) JDAImpl(net.dv8tion.jda.internal.JDAImpl)

Aggregations

JDAImpl (net.dv8tion.jda.internal.JDAImpl)43 Nonnull (javax.annotation.Nonnull)19 Route (net.dv8tion.jda.internal.requests.Route)12 RestActionImpl (net.dv8tion.jda.internal.requests.RestActionImpl)10 DataObject (net.dv8tion.jda.api.utils.data.DataObject)8 DataArray (net.dv8tion.jda.api.utils.data.DataArray)7 EntityBuilder (net.dv8tion.jda.internal.entities.EntityBuilder)6 CheckReturnValue (javax.annotation.CheckReturnValue)5 AuditableRestActionImpl (net.dv8tion.jda.internal.requests.restaction.AuditableRestActionImpl)5 ExceptionEvent (net.dv8tion.jda.api.events.ExceptionEvent)4 InsufficientPermissionException (net.dv8tion.jda.api.exceptions.InsufficientPermissionException)4 ArrayList (java.util.ArrayList)3 LoginException (javax.security.auth.login.LoginException)3 EmbedBuilder (net.dv8tion.jda.api.EmbedBuilder)3 JDA (net.dv8tion.jda.api.JDA)3 WebSocketClient (net.dv8tion.jda.internal.requests.WebSocketClient)3 Parser (com.jagrosh.jagtag.Parser)2 ByteBuffer (java.nio.ByteBuffer)2 List (java.util.List)2 MessageConfig (me.duncte123.botcommons.messaging.MessageConfig)2