Search in sources :

Example 1 with IShard

use of sx.blah.discord.api.IShard in project DisCal-Discord-Bot by NovaFox161.

the class DevCommand method moduleReload.

private void moduleReload(MessageReceivedEvent event) {
    IMessage msg = Message.sendMessage("Reloading DisCal! This may take a moment!", event);
    for (IShard s : msg.getClient().getShards()) {
        s.logout();
        s.login();
    }
    Message.sendMessage("DisCal successfully reloaded!", event);
}
Also used : IShard(sx.blah.discord.api.IShard) IMessage(sx.blah.discord.handle.obj.IMessage)

Example 2 with IShard

use of sx.blah.discord.api.IShard in project DisCal-Discord-Bot by NovaFox161.

the class DevCommand method moduleTestShards.

private void moduleTestShards(MessageReceivedEvent event) {
    Message.sendMessage("Testing shard responses...", event);
    StringBuilder r = new StringBuilder();
    for (IShard s : Main.client.getShards()) {
        r.append(s.getInfo()[0]).append(": ").append(s.isReady()).append("\n");
    }
    Message.sendMessage(r.toString(), event);
}
Also used : IShard(sx.blah.discord.api.IShard)

Example 3 with IShard

use of sx.blah.discord.api.IShard in project Shadbot by Shadorc.

the class NetUtils method postStats.

public static void postStats() {
    LogUtils.infof("Posting statistics...");
    for (IShard shard : Shadbot.getClient().getShards()) {
        NetUtils.postStatsOn("https://bots.discord.pw", APIKey.BOTS_DISCORD_PW_TOKEN, shard);
        NetUtils.postStatsOn("https://discordbots.org", APIKey.DISCORD_BOTS_ORG_TOKEN, shard);
    }
    LogUtils.infof("Statistics posted.");
}
Also used : IShard(sx.blah.discord.api.IShard)

Aggregations

IShard (sx.blah.discord.api.IShard)3 IMessage (sx.blah.discord.handle.obj.IMessage)1