@@ -42,6 +42,11 @@ public class PingService {
4242 * */
4343 public static AtomicBoolean standby = new AtomicBoolean (true );
4444
45+ /**
46+ * The version of the bot as string
47+ * */
48+ private String version = null ;
49+
4550 /**
4651 * Initialize with default values
4752 * */
@@ -55,10 +60,19 @@ public PingService(String key) {
5560 }
5661
5762 /**
58- * Initializes the object with a `pingInterval` in seconds and the api key
63+ * Initializes the object with the api key and bot-version
5964 * */
60- public PingService (String key , int pingInterval ) {
65+ public PingService (String key , String botVersion ) {
6166 this .apiKey = key ;
67+ this .version = botVersion ;
68+ }
69+
70+ /**
71+ * Initializes the object with a `pingInterval` in seconds, the bot's verision and the api key
72+ * */
73+ public PingService (String key , String botVersion , int pingInterval ) {
74+ this .apiKey = key ;
75+ this .version = botVersion ;
6276 this .interval = pingInterval ;
6377 }
6478
@@ -119,6 +133,10 @@ private void execute() throws Throwable {
119133 con .setRequestProperty ("User-Agent" , "Redunda Library" );
120134
121135 String parameters = "key=" +this .apiKey ;
136+
137+ //add version parameter if available
138+ if (this .version != null )
139+ parameters = parameters +"&version=" +this .version ;
122140
123141 // Send post request
124142 con .setDoOutput (true );
0 commit comments