Class PostAction

    • Constructor Summary

      Constructors 
      Constructor Description
      PostAction()
      Empty constructor to create the PostAction instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void disableAutoPost()
      Shuts down the scheduler, to stop the automatic posting.
      void enableAutoPost​(@NotNull java.lang.String botId, int guilds, @NotNull BotBlockAPI botBlockAPI)
      Starts posting of the guild count each n minutes.
      void enableAutoPost​(@NotNull net.dv8tion.jda.api.JDA jda, @NotNull BotBlockAPI botBlockAPI)
      Starts posting of the guild count each n minutes.
      void enableAutoPost​(@NotNull net.dv8tion.jda.api.sharding.ShardManager shardManager, @NotNull BotBlockAPI botBlockAPI)
      Starts posting of the guild count each n minutes.
      void enableAutoPost​(java.lang.Long botId, int guilds, @NotNull BotBlockAPI botBlockAPI)
      Starts posting of the guild count each n minutes.
      void postGuilds​(@NotNull java.lang.String botId, int guilds, @NotNull BotBlockAPI botBlockAPI)
      Posts the guild count with the provided bot id.
      void postGuilds​(@NotNull net.dv8tion.jda.api.JDA jda, @NotNull BotBlockAPI botBlockAPI)
      Posts the guild count provided through the JDA instance.
      void postGuilds​(@NotNull net.dv8tion.jda.api.sharding.ShardManager shardManager, @NotNull BotBlockAPI botBlockAPI)
      Posts the guild count from the provided ShardManager instance.
      void postGuilds​(java.lang.Long botId, int guilds, @NotNull BotBlockAPI botBlockAPI)
      Posts the guild count with the provided bot id.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PostAction

        public PostAction()
        Empty constructor to create the PostAction instance.
    • Method Detail

      • disableAutoPost

        public void disableAutoPost()
        Shuts down the scheduler, to stop the automatic posting.
      • enableAutoPost

        public void enableAutoPost​(@NotNull
                                   @NotNull net.dv8tion.jda.api.JDA jda,
                                   @NotNull
                                   @NotNull BotBlockAPI botBlockAPI)
        Starts posting of the guild count each n minutes.
        The delay in which this happens is set using BotBlockAPI.Builder.setUpdateInteval(int) BotBlockAPI.Builder#setUpdateInterval(int)}

        The scheduler will stop (cancel) the task, when an Exception appears!

        Parameters:
        jda - The JDA instance to use.
        botBlockAPI - The BotBlockAPI instance to use.
      • enableAutoPost

        public void enableAutoPost​(java.lang.Long botId,
                                   int guilds,
                                   @NotNull
                                   @NotNull BotBlockAPI botBlockAPI)
        Starts posting of the guild count each n minutes.
        The delay in which this happens is set using BotBlockAPI.Builder.setUpdateInteval(int) BotBlockAPI.Builder#setUpdateInterval(int)}

        The scheduler will stop (cancel) the task, when an Exception appears!

        Parameters:
        botId - The ID of the bot as Long.
        guilds - The guild count.
        botBlockAPI - The BotBlockAPI instance to use.
      • enableAutoPost

        public void enableAutoPost​(@NotNull
                                   @NotNull net.dv8tion.jda.api.sharding.ShardManager shardManager,
                                   @NotNull
                                   @NotNull BotBlockAPI botBlockAPI)
        Starts posting of the guild count each n minutes.
        The delay in which this happens is set using BotBlockAPI.Builder.setUpdateInteval(int) BotBlockAPI.Builder#setUpdateInterval(int)}

        The scheduler will stop (cancel) the task, when an Exception appears!

        Parameters:
        shardManager - The ShardManager instance to use.
        botBlockAPI - The BotBlockAPI instance to use.
      • enableAutoPost

        public void enableAutoPost​(@NotNull
                                   @NotNull java.lang.String botId,
                                   int guilds,
                                   @NotNull
                                   @NotNull BotBlockAPI botBlockAPI)
        Starts posting of the guild count each n minutes.
        The delay in which this happens is set using BotBlockAPI.Builder.setUpdateInteval(int) BotBlockAPI.Builder#setUpdateInterval(int)}

        The scheduler will stop (cancel) the task, when an Exception appears!

        Parameters:
        botId - The ID of the bot as String.
        guilds - The guild count.
        botBlockAPI - The BotBlockAPI instance to use.
      • postGuilds

        public void postGuilds​(@NotNull
                               @NotNull net.dv8tion.jda.api.JDA jda,
                               @NotNull
                               @NotNull BotBlockAPI botBlockAPI)
                        throws java.io.IOException,
                               RatelimitedException
        Posts the guild count provided through the JDA instance.
        It's recommended to use postGuilds(ShardManager, BotBlockAPI if you're using a sharded bot.

        When the amount of shards a bot has is bigger than one will shard_id and shard_count be added.

        Parameters:
        jda - The JDA instance.
        botBlockAPI - The BotBlockAPI instance.
        Throws:
        java.io.IOException - When the post request couldn't be performed.
        RatelimitedException - When we exceed the rate-limit of the BotBlock API.
      • postGuilds

        public void postGuilds​(java.lang.Long botId,
                               int guilds,
                               @NotNull
                               @NotNull BotBlockAPI botBlockAPI)
                        throws java.io.IOException,
                               RatelimitedException
        Posts the guild count with the provided bot id.
        Parameters:
        botId - The ID of the bot.
        guilds - The guild count.
        botBlockAPI - The BotBlockAPI instance.
        Throws:
        java.io.IOException - When the post request couldn't be performed.
        RatelimitedException - When we exceed the rate-limit of the BotBlock API.
      • postGuilds

        public void postGuilds​(@NotNull
                               @NotNull net.dv8tion.jda.api.sharding.ShardManager shardManager,
                               @NotNull
                               @NotNull BotBlockAPI botBlockAPI)
                        throws java.io.IOException,
                               RatelimitedException
        Posts the guild count from the provided ShardManager instance.
        The guild count of each shard will be added as an JSONArray.
        Parameters:
        shardManager - The ShardManager instance.
        botBlockAPI - The BotBlockAPI instance.
        Throws:
        java.io.IOException - When the post request couldn't be performed.
        RatelimitedException - When we exceed the rate-limit of the BotBlock API.
      • postGuilds

        public void postGuilds​(@NotNull
                               @NotNull java.lang.String botId,
                               int guilds,
                               @NotNull
                               @NotNull BotBlockAPI botBlockAPI)
                        throws java.io.IOException,
                               RatelimitedException
        Posts the guild count with the provided bot id.
        Parameters:
        botId - The ID of the bot.
        guilds - The guild count.
        botBlockAPI - The BotBlockAPI instance.
        Throws:
        java.io.IOException - When the post request couldn't be performed.
        RatelimitedException - When we exceed the rate-limit of the BotBlock API.