From 5ae0e5777162fa7a60db90412c8d2965e800a8b7 Mon Sep 17 00:00:00 2001 From: TopiSenpai Date: Thu, 6 Jan 2022 20:29:41 +0100 Subject: [PATCH 1/4] Squashed commit of the following: commit da09c43454723d6a10117d0e2f2494585bdcd4ba Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu Jan 6 15:41:26 2022 +0100 Bump jooq from 3.15.5 to 3.16.0 commit fe3f8ebd739e22e5d45ccbedfcab095e828c3546 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon Jan 3 14:29:25 2022 +0100 Bump javalin from 4.1.1 to 4.2.0 commit 788760e1f46494ad28a083a4363caf70ebafc6b0 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu Dec 30 14:34:26 2021 +0100 Bump discord-webhooks from 0.7.4 to 0.7.5 commit cba71b809bb3780f861c9391ebaaffb8abee8cd9 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed Dec 29 14:02:56 2021 +0100 Bump com.github.johnrengelman.shadow from 7.1.1 to 7.1.2 commit 99c4d8bcb51001037fd37eb49647898edd4ea9fd Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu Dec 23 14:04:04 2021 +0100 Bump logback-classic from 1.3.0-alpha11 to 1.3.0-alpha12 commit 97738eac51aeef2442d06a92b62851fc81ec9532 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue Dec 21 17:49:15 2021 +0100 Bump sentry-logback from 5.5.1 to 5.5.2 commit 731c867cfa771de64fbf51a41f57402123c63186 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun Dec 19 23:11:28 2021 +0100 Bump simpleclient_hotspot from 0.13.0 to 0.14.1 commit 719dfeb589ce4b63433b8efa3b3d174a5f720478 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun Dec 19 23:10:39 2021 +0100 Bump simpleclient_httpserver from 0.13.0 to 0.14.1 commit ef3cc9324e53f725e4fc938a00d4f0cc7eff19a4 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun Dec 19 23:10:29 2021 +0100 Bump simpleclient from 0.13.0 to 0.14.1 commit c04fbc1e8aadc3f88c1ca74ef68d22a7e1048d00 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri Dec 17 14:03:44 2021 +0100 Bump logback-classic from 1.3.0-alpha10 to 1.3.0-alpha11 commit 9a75e384650c40ec6571c439f0e2155c435d4216 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri Dec 17 14:03:15 2021 +0100 Bump JDA from 4.4.0_351 to 4.4.0_352 commit 2cbb21c7f67b3b58f97dd5b8839f61b8a2a24125 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri Dec 17 14:03:03 2021 +0100 Bump sentry-logback from 5.5.0 to 5.5.1 commit ca0755e52ad6723b574eb97e679bb219b6082312 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed Dec 15 14:21:20 2021 +0100 Bump com.github.johnrengelman.shadow from 7.1.0 to 7.1.1 commit 8952fa7c9cf468a2cc6a8054a84cb24233372a7f Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue Dec 14 14:15:35 2021 +0100 Bump simpleclient from 0.12.0 to 0.13.0 commit d834daddaa11d2fc8a20c7a969b3fc39a9e23ca8 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue Dec 14 14:15:27 2021 +0100 Bump sentry-logback from 5.4.3 to 5.5.0 commit 910b132dbb1e474064c3177fcff892472c3dd945 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue Dec 14 14:15:16 2021 +0100 Bump simpleclient_hotspot from 0.12.0 to 0.13.0 commit ef1bbe3953d65d4d8e25a682e9ce59789a1caf8c Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue Dec 14 14:14:43 2021 +0100 Bump simpleclient_httpserver from 0.12.0 to 0.13.0 commit de2e62e93e4102f4a8199934fdf7b6f05f82cf0f Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon Dec 13 18:58:38 2021 +0100 Bump classgraph from 4.8.137 to 4.8.138 commit a01a44ec36e13d268b0f6470f5314a43fb440ae0 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon Dec 13 18:58:33 2021 +0100 Bump discord-webhooks from 0.7.3 to 0.7.4 commit 6d0f1955498a7beb8f0f012ae960ab0d79174bea Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri Dec 3 14:04:31 2021 +0100 Bump caffeine from 3.0.4 to 3.0.5 commit df8ac8d376264c37f5aa7bd67e6b80b97d120c8a Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri Dec 3 14:04:19 2021 +0100 Bump discord-webhooks from 0.7.2 to 0.7.3 commit 7729ee5d63e64df44767b2c6b8cbc7ab5c3e6152 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri Dec 3 14:04:10 2021 +0100 Bump jooq from 3.15.4 to 3.15.5 commit 01ca27ae040d49cefadc12e7a83b4a928f60f8de Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue Nov 30 17:28:44 2021 +0100 Bump JDA from 4.4.0_350 to 4.4.0_351 commit 9fe94bf49aa656ad64aeb55689f45dc95a55cd7c Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue Nov 30 17:28:33 2021 +0100 Bump sentry-logback from 5.4.2 to 5.4.3 commit f16c53b72a1463b05493bc767e4d5749ce185eb7 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun Nov 28 19:53:34 2021 +0100 Bump classgraph from 4.8.136 to 4.8.137 commit dbe4c0ef8795b95e0abe3f98678d7c9464e1f486 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun Nov 28 19:53:28 2021 +0100 Bump JDA from 4.3.0_348 to 4.4.0_350 commit 4333b24f6db7f9e6b24f9b5cfef240148c02a572 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri Nov 26 14:06:21 2021 +0100 Bump classgraph from 4.8.135 to 4.8.136 commit 2210f0a070ef7b19757f6dd69142898588075334 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu Nov 25 14:27:03 2021 +0100 Bump sentry-logback from 5.4.1 to 5.4.2 commit 028765dd0fb82b2b31f3e5f98c49e6bd96399b2f Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed Nov 24 14:29:35 2021 +0100 Bump JDA from 4.3.0_346 to 4.3.0_348 commit a84a75f1ed1383cc8b744a2d714e1a9eda156285 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon Nov 22 14:03:53 2021 +0100 Bump okhttp from 4.9.2 to 4.9.3 commit 181e0d425f5f5b635aae4f098bb2f1ee3e611e65 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon Nov 22 14:03:44 2021 +0100 Bump classgraph from 4.8.134 to 4.8.135 commit 9cabbfdb26a8fa2ee42bdec9d409fb80c3437c21 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat Nov 20 13:22:30 2021 +0100 Bump classgraph from 4.8.133 to 4.8.134 commit 135a51ee8eaecb72091a5082f6d161eb6d669cd2 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri Nov 19 14:19:24 2021 +0100 Bump sentry-logback from 5.4.0 to 5.4.1 commit 72173624c0757c989016491f5e552c8392c54ccb Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed Nov 17 14:24:08 2021 +0100 Bump classgraph from 4.8.132 to 4.8.133 commit 038e2003b7f8b4693d9656e30b63a0402843ad55 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun Nov 14 14:57:23 2021 +0100 Bump classgraph from 4.8.131 to 4.8.132 commit 542b02d3a8a72a722ce74101e72b8e25d890e957 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri Nov 12 14:03:58 2021 +0100 Bump sentry-logback from 5.3.0 to 5.4.0 commit 71c5434b9e15474295c52f76ea485766f646507a Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue Nov 9 14:07:22 2021 +0100 Bump classgraph from 4.8.130 to 4.8.131 commit 6b314267e9be2101c58cef9adbe9664366b693f2 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon Nov 8 14:03:49 2021 +0100 Bump JDA from 4.3.0_340 to 4.3.0_346 commit 2ffb28c0413f636096ca4272316a38024a217334 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon Nov 8 14:03:45 2021 +0100 Bump classgraph from 4.8.129 to 4.8.130 commit cf8e5e3cae51c60b24bba74d5bc832dadb0e423e Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat Nov 6 23:49:32 2021 +0100 Bump spotify-web-api-java from 6.5.4 to 7.0.0 commit d32c16459297633f522237718e6e80422e019716 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat Nov 6 23:49:03 2021 +0100 Bump JDA from 4.3.0_339 to 4.3.0_340 commit 821aaf40091136d2073d1ad8b397ed1fac1560fe Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun Oct 31 15:29:24 2021 +0100 Bump postgresql from 42.3.0 to 42.3.1 commit 9e0fb17d6351574fdf506ed71a1436a37ade6db4 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri Oct 29 14:07:10 2021 +0200 Bump sentry-logback from 5.2.4 to 5.3.0 commit 3b505838362f97d6ccdd41a812c23cff2fdc3c67 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu Oct 28 14:27:33 2021 +0200 Bump jooq from 3.15.3 to 3.15.4 commit cff89f20b30c7b2aacda170c4c074224478a25b1 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu Oct 28 14:27:27 2021 +0200 Bump classgraph from 4.8.128 to 4.8.129 commit f9d72fb4522de123dfd8615fff381f0753fb749f Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat Oct 23 23:16:03 2021 +0200 Bump JDA from 4.3.0_335 to 4.3.0_339 commit 809b42f7afb29ade9f7203fd5a7dd36c9b8477cb Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu Oct 21 14:10:54 2021 +0200 Bump JDA from 4.3.0_334 to 4.3.0_335 commit 0ac39dafa838b95d9b40c89349c2203a71d1d31a Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue Oct 19 14:14:37 2021 +0200 Bump postgresql from 42.2.24 to 42.3.0 commit 6ed789f44b7a93a39b44da668474f0a728e1ee2c Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue Oct 19 14:14:10 2021 +0200 Bump sentry-logback from 5.2.3 to 5.2.4 commit f6a5ed9e4f9f20859487c5edcf486fd5348e1ef5 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri Oct 15 14:10:15 2021 +0200 Bump sentry-logback from 5.2.2 to 5.2.3 commit 33cedb1a720584a0017986c832dec386ea95d7de Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu Oct 14 14:12:00 2021 +0200 Bump classgraph from 4.8.126 to 4.8.128 commit 71e60743ed239c62286ed8693725132b90549e2e Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue Oct 12 14:12:45 2021 +0200 Bump sentry-logback from 5.2.1 to 5.2.2 commit 161ac39995891835e6c792221b9d6e02bd339110 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon Oct 11 14:07:27 2021 +0200 Bump classgraph from 4.8.125 to 4.8.126 commit 5cc6270755e3650e563d4547ecfffe9cc646891f Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun Oct 10 12:53:52 2021 +0200 Bump JDA from 4.3.0_333 to 4.3.0_334 commit af9eb14d8a3781343e554ab2169f867cad4a5b41 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun Oct 10 12:53:42 2021 +0200 Bump javalin from 4.1.0 to 4.1.1 commit 8bd370dc05d0b11de121b25b56f54149cd1ef41c Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu Oct 7 14:04:31 2021 +0200 Bump classgraph from 4.8.123 to 4.8.125 commit 972f83f76b2df9a9b68058768c2aa381b2d6e970 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue Oct 5 14:08:40 2021 +0200 Bump com.github.johnrengelman.shadow from 7.0.0 to 7.1.0 commit 33621e7bab0a513ba61a680f4ae46b2dc5777c82 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue Oct 5 14:08:30 2021 +0200 Bump sentry-logback from 5.2.0 to 5.2.1 commit b5220ab1c45a987b7342d53260e469bdda0f8be8 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue Oct 5 14:08:23 2021 +0200 Bump classgraph from 4.8.121 to 4.8.123 commit b50bedd7fe97aa074112561c1043f2f10e52722d Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon Oct 4 14:06:55 2021 +0200 Bump javalin from 4.0.1 to 4.1.0 commit 62f655f05c97fff89efd0060929d19c54c34ccc3 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon Oct 4 14:06:07 2021 +0200 Bump JDA from 4.3.0_331 to 4.3.0_333 commit 49be83c8694c171ef565c81b60e10c7bef3772a3 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon Oct 4 14:06:01 2021 +0200 Bump discord-webhooks from 0.5.8 to 0.7.2 commit ff69ee545246a809d0927ee93fa13304c0c146a9 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon Oct 4 14:05:52 2021 +0200 Bump classgraph from 4.8.117 to 4.8.121 commit 5c15c14be39415ac5762484ec5f60d5afcbde4ef Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri Oct 1 19:17:56 2021 +0200 Bump okhttp from 4.9.1 to 4.9.2 commit 70a86c794617ccdf0d7221a45ee183819804a95d Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed Sep 29 14:04:26 2021 +0200 Bump classgraph from 4.8.116 to 4.8.117 commit 809e7aeaeed9ba6c3dd2fd96120870dcee7fcfb1 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun Sep 26 14:26:05 2021 +0200 Bump javalin from 4.0.0 to 4.0.1 commit 05da19ae45999b82dd5e8ecbf3f963d9ddbecc9a Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu Sep 23 14:13:25 2021 +0200 Bump postgresql from 42.2.23 to 42.2.24 commit 6bfa6e5580bf6793ca69454f82437553c1222340 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu Sep 23 11:15:05 2021 +0200 Bump JDA from 4.3.0_330 to 4.3.0_331 commit db9c2060eb5e6433978bac1cfb4bdbe66a2265e3 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed Sep 22 15:59:06 2021 +0200 Bump sentry-logback from 5.1.2 to 5.2.0 commit 19e4d15a6dc8120af6a8f350fdaf973d75c77851 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon Sep 20 14:04:24 2021 +0200 Bump JDA from 4.3.0_327 to 4.3.0_330 commit 80ab7f54686e336c1051036df88720c30191e591 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun Sep 19 14:52:15 2021 +0200 Bump jooq from 3.15.2 to 3.15.3 commit 61cb683dc8654c7d311914fa44ab839f4331a271 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun Sep 19 14:52:08 2021 +0200 Bump JDA from 4.3.0_324 to 4.3.0_327 commit c389719eeaeb43e50edc4e4c7daee3e2b7a86489 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue Sep 14 14:07:27 2021 +0200 Bump javalin from 3.13.11 to 4.0.0 commit 722de475e1c76446e4507d9a6d88ce41e7b29a1d Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon Sep 13 13:02:37 2021 +0200 Bump caffeine from 3.0.3 to 3.0.4 commit 104c10e097884dc36a53e4b80be7ddf5f4f02d34 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu Sep 9 14:15:18 2021 +0200 Bump classgraph from 4.8.115 to 4.8.116 commit 8999aaece1d7ebc5034d9df079ae581cfa88e55d Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue Sep 7 22:39:50 2021 +0200 Bump JDA from 4.3.0_323 to 4.3.0_324 commit 9ca5ee372cad4cbb056596e9c58435f5d50eab3e Merge: 879d80d0 fa0c2006 Author: TopiSenpai Date: Tue Sep 7 20:39:40 2021 +0200 Merge branch 'development' into dependencies commit 879d80d012f451b71f8bbbf847c0f16d628a83c1 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon Sep 6 23:05:15 2021 +0200 Bump groovy-jsr223 from 3.0.8 to 3.0.9 commit 0b3e384561931fba355e3ed6706960ec5e276d41 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon Sep 6 14:02:53 2021 +0200 Bump JDA from 4.3.0_315 to 4.3.0_323 commit cf35fef32db9c47ba4ef2e8b2a716a9e989a2cd6 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri Sep 3 14:12:21 2021 +0200 Bump JDA from 4.3.0_314 to 4.3.0_315 commit c7acc979c81d8d17bbee10e352184c76f99b2e42 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed Sep 1 00:12:28 2021 +0200 Bump JDA from 4.3.0_313 to 4.3.0_314 commit 93622459c2937913924aca755d7191e1cb7bfb63 Author: caneleex Date: Mon Aug 30 20:27:25 2021 +0200 bump jooq commit f066cda31b512867a3ec9bc5adfe9785c34b99c1 Author: caneleex Date: Mon Aug 30 20:26:58 2021 +0200 bump BotListHandler commit 70f98aafdd048c2a48f9a9c4f039adf76efb7a90 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon Aug 30 14:10:07 2021 +0200 Bump simpleclient_httpserver from 0.11.0 to 0.12.0 commit 104ce505f7b3e806271f2696de347f586fb40f48 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon Aug 30 14:09:49 2021 +0200 Bump JDA from 4.3.0_310 to 4.3.0_313 commit f02d54eeae73b3c32d7e14a9e3ee396c437637e5 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon Aug 30 14:09:40 2021 +0200 Bump simpleclient from 0.11.0 to 0.12.0 commit 49e58d21fcc07b2309e6c3f56d74cabe902f21e6 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon Aug 30 14:09:00 2021 +0200 Bump simpleclient_hotspot from 0.11.0 to 0.12.0 commit 36a2dcd58945f53a15e5a7e54693efad3f461299 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu Aug 26 14:03:02 2021 +0200 Bump jooq from 3.15.1 to 3.15.2 commit 4361e6147d945118451eac3b6fb73a9a7a2ceeb8 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu Aug 26 14:02:55 2021 +0200 Bump sentry-logback from 5.1.1 to 5.1.2 commit 5f56ce6a255d187cc92160327230acc01a1a26c4 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue Aug 24 14:03:33 2021 +0200 Bump logback-classic from 1.3.0-alpha9 to 1.3.0-alpha10 commit 172cb1e0917f97ffd5a0f2df98a8303071fea51b Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun Aug 22 23:51:13 2021 +0200 Bump javalin from 3.13.10 to 3.13.11 commit 52a4653ebe5074c46049f7b6b7c1e0eabdb284c8 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun Aug 22 23:50:50 2021 +0200 Bump nu.studer.jooq from 6.0 to 6.0.1 commit 1ad921da75d2bdfbf7d851ffa61000c23dd51e25 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu Aug 19 23:39:22 2021 +0200 Bump sentry-logback from 5.1.0 to 5.1.1 commit 1bb8e7f74e9a1939692f3be0c0b79b3ce85ec885 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed Aug 18 22:44:01 2021 +0200 Bump JDA from 4.3.0_309 to 4.3.0_310 commit 953771c5fe22abf121fc46ea247e601e7fcd7ecd Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue Aug 17 20:14:33 2021 +0200 Bump sentry-logback from 5.0.1 to 5.1.0 commit 34b64d3d78ba0876756f1de5206dc2a44dde0dd2 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue Aug 17 14:10:33 2021 +0200 Bump classgraph from 4.8.114 to 4.8.115 commit b9b7cd00eacb1629c9f708e53eb98f9d991a32dd Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat Aug 14 14:51:12 2021 +0200 Bump classgraph from 4.8.113 to 4.8.114 commit bd5456b571e3a24dff1e513088a65e3af2738ef9 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri Aug 13 18:32:45 2021 +0200 Bump JDA from 4.3.0_307 to 4.3.0_309 commit ab2ed0e6b4d4e7793c4d83aeb0c73d848e087459 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri Aug 13 14:05:20 2021 +0200 Bump logback-classic from 1.3.0-alpha7 to 1.3.0-alpha9 commit 93219e807939054871870dc30dc3b660975d65c5 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed Aug 11 14:57:32 2021 +0200 Bump classgraph from 4.8.112 to 4.8.113 commit 9f5f770dd66fb8dabd676c2038bd41e1cf82db95 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed Aug 11 14:57:24 2021 +0200 Bump logback-classic from 1.3.0-alpha6 to 1.3.0-alpha7 commit 38765f0ac7ae08ba9f14a25938b02683038a035d Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun Aug 8 13:45:05 2021 +0200 Bump classgraph from 4.8.111 to 4.8.112 commit 05ce8d2ab48826c921fc9a65cda1f9b20d170c80 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun Aug 8 13:45:01 2021 +0200 Bump JDA from 4.3.0_306 to 4.3.0_307 commit a125453108530fbcbf90be4514972659198f0ee3 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri Aug 6 14:18:26 2021 +0200 Bump JDA from 4.3.0_305 to 4.3.0_306 commit 78d3df246406b1d094d1ceda1b4d2d3fe79442d0 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu Aug 5 14:03:07 2021 +0200 Bump JDA from 4.3.0_304 to 4.3.0_305 commit 39eea989e32fa82a4f2cf5de3074e2d07204d6f4 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed Aug 4 14:05:15 2021 +0200 Bump classgraph from 4.8.110 to 4.8.111 commit c42196e08184209395f87db15cfcfe076d5075ee Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue Aug 3 14:03:21 2021 +0200 Bump JDA from 4.3.0_303 to 4.3.0_304 commit ea46a1a8264d5f7fce9ae4a26e50bb0785af946f Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon Aug 2 14:37:00 2021 +0200 Bump JDA from 4.3.0_301 to 4.3.0_303 commit 4ee3676f269d4b280419b4cf1e79f99157011e78 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun Aug 1 18:32:05 2021 +0200 Bump JDA from 4.3.0_300 to 4.3.0_301 commit cd6e72a3b3c47d85356ae70be1f02c3f18c09487 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat Jul 31 18:58:16 2021 +0200 Bump JDA from 4.3.0_299 to 4.3.0_300 commit 6a03fdb4ef9d814a82206f9bed805d0362fb2b56 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat Jul 31 18:57:50 2021 +0200 Bump discord-webhooks from 0.5.7 to 0.5.8 commit 0582035faa005bda15c8baf3b660ec125227fed5 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu Jul 29 14:23:25 2021 +0200 Bump logback-classic from 1.3.0-alpha5 to 1.3.0-alpha6 commit 289265ca05e010c6953ace304bb389eb6c67a778 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed Jul 28 14:03:54 2021 +0200 Bump JDA from 4.3.0_298 to 4.3.0_299 --- build.gradle | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/build.gradle b/build.gradle index a4709db9..3bc2f00f 100644 --- a/build.gradle +++ b/build.gradle @@ -1,7 +1,7 @@ plugins { id 'java' id 'application' - id 'com.github.johnrengelman.shadow' version '7.1.0' + id 'com.github.johnrengelman.shadow' version '7.1.2' id 'nu.studer.jooq' version '6.0.1' } @@ -17,11 +17,11 @@ repositories { dependencies { // discord/jda related - implementation('net.dv8tion:JDA:4.3.0_339') { + implementation('net.dv8tion:JDA:4.4.0_352') { exclude group: 'club.minnced', module: 'opus-java' } implementation 'com.jagrosh:jda-utilities:3.0.5' - implementation 'club.minnced:discord-webhooks:0.7.2' + implementation 'club.minnced:discord-webhooks:0.7.5' implementation 'dev.mlnr:BotListHandler-jda:2.0.0_11' // audio @@ -29,17 +29,17 @@ dependencies { exclude group: 'com.sedmelluq', module: 'lavaplayer' } implementation 'com.sedmelluq:lavaplayer:1.3.78' - implementation 'se.michaelthelin.spotify:spotify-web-api-java:6.5.4' + implementation 'se.michaelthelin.spotify:spotify-web-api-java:7.0.0' // database implementation 'com.zaxxer:HikariCP:5.0.0' - implementation 'org.jooq:jooq:3.15.4' - implementation 'org.postgresql:postgresql:42.3.0' + implementation 'org.jooq:jooq:3.16.0' + implementation 'org.postgresql:postgresql:42.3.1' jooqGenerator 'org.postgresql:postgresql:42.3.0' // logging - implementation 'ch.qos.logback:logback-classic:1.3.0-alpha10' - implementation 'io.sentry:sentry-logback:5.2.4' + implementation 'ch.qos.logback:logback-classic:1.3.0-alpha12' + implementation 'io.sentry:sentry-logback:5.5.2' // eval implementation 'org.codehaus.groovy:groovy-jsr223:3.0.9' @@ -50,15 +50,15 @@ dependencies { implementation 'io.jsonwebtoken:jjwt-jackson:0.11.2' // Prometheus - implementation 'io.prometheus:simpleclient:0.12.0' - implementation 'io.prometheus:simpleclient_hotspot:0.12.0' - implementation 'io.prometheus:simpleclient_httpserver:0.12.0' + implementation 'io.prometheus:simpleclient:0.14.1' + implementation 'io.prometheus:simpleclient_hotspot:0.14.1' + implementation 'io.prometheus:simpleclient_httpserver:0.14.1' // other - implementation 'io.javalin:javalin:4.1.1' - implementation 'io.github.classgraph:classgraph:4.8.129' - implementation 'com.github.ben-manes.caffeine:caffeine:3.0.4' - implementation 'com.squareup.okhttp3:okhttp:4.9.2' + implementation 'io.javalin:javalin:4.2.0' + implementation 'io.github.classgraph:classgraph:4.8.138' + implementation 'com.github.ben-manes.caffeine:caffeine:3.0.5' + implementation 'com.squareup.okhttp3:okhttp:4.9.3' } jooq { From 760cd93deb3c63123002480e71efd90abfea6ae1 Mon Sep 17 00:00:00 2001 From: TopiSenpai Date: Fri, 7 Jan 2022 03:31:41 +0100 Subject: [PATCH 2/4] remove last parts of spotify, move to lavalink client without lavaplayer as dependency, fix some deprecated method uses --- Dockerfile-dev | 6 - build.gradle | 91 ++++++------ .../commands/music/ForwardCommand.java | 2 +- .../kittybot/commands/music/SeekCommand.java | 2 +- .../commands/roles/roles/ListCommand.java | 2 +- .../de/kittybot/kittybot/main/KittyBot.java | 3 +- .../kittybot/modules/AnnouncementModule.java | 8 +- .../kittybot/modules/CommandsModule.java | 14 +- .../kittybot/modules/GuildLoggingModule.java | 2 +- .../kittybot/modules/InteractionsModule.java | 1 + .../kittybot/modules/MusicModule.java | 9 +- .../kittybot/modules/NotificationModule.java | 2 +- .../kittybot/modules/PaginatorModule.java | 6 +- .../kittybot/modules/RequestModule.java | 4 +- .../kittybot/modules/SpotifyModule.java | 135 ------------------ .../kittybot/objects/module/Modules.java | 2 +- .../kittybot/objects/music/AudioLoader.java | 27 ++-- .../kittybot/objects/music/MusicManager.java | 39 +++-- .../objects/music/TrackScheduler.java | 38 ++--- .../slashcommands/application/Category.java | 2 +- .../response/InteractionRespondAction.java | 2 +- .../de/kittybot/kittybot/utils/Config.java | 6 - .../kittybot/kittybot/utils/MusicUtils.java | 14 +- src/main/resources/logback.xml | 10 +- 24 files changed, 134 insertions(+), 293 deletions(-) delete mode 100644 Dockerfile-dev delete mode 100644 src/main/java/de/kittybot/kittybot/modules/SpotifyModule.java diff --git a/Dockerfile-dev b/Dockerfile-dev deleted file mode 100644 index 2ac4374d..00000000 --- a/Dockerfile-dev +++ /dev/null @@ -1,6 +0,0 @@ -FROM gradle:6.6.1-jdk11 - -WORKDIR /home/kittybot - -COPY ./src ./home/kittybot/src - diff --git a/build.gradle b/build.gradle index 3bc2f00f..d347ee77 100644 --- a/build.gradle +++ b/build.gradle @@ -1,93 +1,91 @@ plugins { - id 'java' - id 'application' - id 'com.github.johnrengelman.shadow' version '7.1.2' - id 'nu.studer.jooq' version '6.0.1' + id "java" + id "application" + id "com.github.johnrengelman.shadow" version "7.1.2" + id "nu.studer.jooq" version "6.0.1" } -group 'de.kittybot' -mainClassName = 'de.kittybot.kittybot.main.Main' +group "de.kittybot" +mainClassName = "de.kittybot.kittybot.main.Main" +sourceCompatibility = 1.11 +compileJava.options.encoding = "UTF-8" + repositories { - maven { url 'https://m2.dv8tion.net/releases' } - maven { url 'https://jitpack.io' } + maven { url "https://m2.dv8tion.net/releases" } + maven { url "https://jitpack.io" } mavenCentral() jcenter() // this is still required because of jda utilities } dependencies { // discord/jda related - implementation('net.dv8tion:JDA:4.4.0_352') { - exclude group: 'club.minnced', module: 'opus-java' + implementation("net.dv8tion:JDA:4.4.0_352") { + exclude group: "club.minnced", module: "opus-java" } - implementation 'com.jagrosh:jda-utilities:3.0.5' - implementation 'club.minnced:discord-webhooks:0.7.5' - implementation 'dev.mlnr:BotListHandler-jda:2.0.0_11' + implementation "com.jagrosh:jda-utilities:3.0.5" + implementation "club.minnced:discord-webhooks:0.7.5" + implementation "dev.mlnr:BotListHandler-jda:2.0.0_11" // audio - implementation('com.github.KittyBot-Org:Lavalink-Client:d48f1a6') { - exclude group: 'com.sedmelluq', module: 'lavaplayer' - } - implementation 'com.sedmelluq:lavaplayer:1.3.78' - implementation 'se.michaelthelin.spotify:spotify-web-api-java:7.0.0' + implementation "com.github.KittyBot-Org:Lavalink-Client:91ba078" // database - implementation 'com.zaxxer:HikariCP:5.0.0' - implementation 'org.jooq:jooq:3.16.0' - implementation 'org.postgresql:postgresql:42.3.1' - jooqGenerator 'org.postgresql:postgresql:42.3.0' - + implementation "com.zaxxer:HikariCP:5.0.0" + implementation "org.jooq:jooq:3.16.0" + implementation "org.postgresql:postgresql:42.3.1" + jooqGenerator "org.postgresql:postgresql:42.3.1" // logging - implementation 'ch.qos.logback:logback-classic:1.3.0-alpha12' - implementation 'io.sentry:sentry-logback:5.5.2' + implementation "ch.qos.logback:logback-classic:1.2.8" + implementation "io.sentry:sentry-logback:5.5.2" // eval - implementation 'org.codehaus.groovy:groovy-jsr223:3.0.9' + implementation "org.codehaus.groovy:groovy-jsr223:3.0.9" // jjwt - implementation 'io.jsonwebtoken:jjwt-api:0.11.2' - implementation 'io.jsonwebtoken:jjwt-impl:0.11.2' - implementation 'io.jsonwebtoken:jjwt-jackson:0.11.2' + implementation "io.jsonwebtoken:jjwt-api:0.11.2" + implementation "io.jsonwebtoken:jjwt-impl:0.11.2" + implementation "io.jsonwebtoken:jjwt-jackson:0.11.2" // Prometheus - implementation 'io.prometheus:simpleclient:0.14.1' - implementation 'io.prometheus:simpleclient_hotspot:0.14.1' - implementation 'io.prometheus:simpleclient_httpserver:0.14.1' + implementation "io.prometheus:simpleclient:0.14.1" + implementation "io.prometheus:simpleclient_hotspot:0.14.1" + implementation "io.prometheus:simpleclient_httpserver:0.14.1" // other - implementation 'io.javalin:javalin:4.2.0' - implementation 'io.github.classgraph:classgraph:4.8.138' - implementation 'com.github.ben-manes.caffeine:caffeine:3.0.5' - implementation 'com.squareup.okhttp3:okhttp:4.9.3' + implementation "io.javalin:javalin:4.2.0" + implementation "io.github.classgraph:classgraph:4.8.138" + implementation "com.github.ben-manes.caffeine:caffeine:3.0.5" + implementation "com.squareup.okhttp3:okhttp:4.9.3" } jooq { - version = '3.15.2' + version = "3.15.2" configurations { main { generateSchemaSourceOnCompilation = false generationTool { logging = org.jooq.meta.jaxb.Logging.WARN jdbc { - driver = 'org.postgresql.Driver' + driver = "org.postgresql.Driver" url = "jdbc:postgresql://${KITTYBOT_DB_HOST}:${KITTYBOT_DB_PORT}/${KITTYBOT_DB_DATABASE}" user = KITTYBOT_DB_USER password = KITTYBOT_DB_PASSWORD } generator { - name = 'org.jooq.codegen.DefaultGenerator' + name = "org.jooq.codegen.DefaultGenerator" database { - name = 'org.jooq.meta.postgres.PostgresDatabase' - inputSchema = 'public' - includes = '.*' - excludes = '' + name = "org.jooq.meta.postgres.PostgresDatabase" + inputSchema = "public" + includes = ".*" + excludes = "" } generate { records = true fluentSetters = true } target { - packageName = 'de.kittybot.kittybot.jooq' + packageName = "de.kittybot.kittybot.jooq" directory = "src/main/jooq" } strategy.name = "org.jooq.codegen.DefaultGeneratorStrategy" @@ -98,8 +96,5 @@ jooq { } ext { - moduleName = 'KittyBot' + moduleName = "KittyBot" } - -sourceCompatibility = 1.11 -compileJava.options.encoding = 'UTF-8' diff --git a/src/main/java/de/kittybot/kittybot/commands/music/ForwardCommand.java b/src/main/java/de/kittybot/kittybot/commands/music/ForwardCommand.java index 6aea7c8b..2627930f 100644 --- a/src/main/java/de/kittybot/kittybot/commands/music/ForwardCommand.java +++ b/src/main/java/de/kittybot/kittybot/commands/music/ForwardCommand.java @@ -32,7 +32,7 @@ public void run(Options options, GuildInteraction ia){ var lavalinkPlayer = scheduler.getPlayer(); var position = lavalinkPlayer.getTrackPosition(); var newPos = position + forward; - if(newPos > scheduler.getPlayingTrack().getDuration()){ + if(newPos > scheduler.getPlayingTrack().getInfo().getLength()){ scheduler.next(true); ia.reply("Skipped to next track"); return; diff --git a/src/main/java/de/kittybot/kittybot/commands/music/SeekCommand.java b/src/main/java/de/kittybot/kittybot/commands/music/SeekCommand.java index b0da4127..a23c13bc 100644 --- a/src/main/java/de/kittybot/kittybot/commands/music/SeekCommand.java +++ b/src/main/java/de/kittybot/kittybot/commands/music/SeekCommand.java @@ -30,7 +30,7 @@ public void run(Options options, GuildInteraction ia){ } var newPos = options.getLong("seconds") * 1000; var lavalinkPlayer = scheduler.getPlayer(); - if(newPos > scheduler.getPlayingTrack().getDuration()){ + if(newPos > scheduler.getPlayingTrack().getInfo().getLength()){ scheduler.next(true); ia.reply("Skipped to next track"); return; diff --git a/src/main/java/de/kittybot/kittybot/commands/roles/roles/ListCommand.java b/src/main/java/de/kittybot/kittybot/commands/roles/roles/ListCommand.java index bb571928..d3d8249c 100644 --- a/src/main/java/de/kittybot/kittybot/commands/roles/roles/ListCommand.java +++ b/src/main/java/de/kittybot/kittybot/commands/roles/roles/ListCommand.java @@ -53,7 +53,7 @@ public void run(Options options, GuildInteraction ia){ return; } ia.acknowledge().queue(success -> - ia.getChannel().sendMessage(embed).queue(message -> { + ia.getChannel().sendMessageEmbeds(embed).queue(message -> { ia.get(ReactionRoleModule.class).add(message.getGuild().getIdLong(), message.getIdLong()); sortedRoles.forEach(role -> message.addReaction("test:" + role.getEmoteId()).queue()); }) diff --git a/src/main/java/de/kittybot/kittybot/main/KittyBot.java b/src/main/java/de/kittybot/kittybot/main/KittyBot.java index 48031047..a21b9908 100644 --- a/src/main/java/de/kittybot/kittybot/main/KittyBot.java +++ b/src/main/java/de/kittybot/kittybot/main/KittyBot.java @@ -58,8 +58,7 @@ public KittyBot() throws IOException, MissingConfigValuesException, LoginExcepti .disableCache( CacheFlag.MEMBER_OVERRIDES, CacheFlag.ACTIVITY, - CacheFlag.CLIENT_STATUS, - CacheFlag.ROLE_TAGS + CacheFlag.CLIENT_STATUS ) .setMemberCachePolicy(MemberCachePolicy.VOICE) .setChunkingFilter(ChunkingFilter.NONE) diff --git a/src/main/java/de/kittybot/kittybot/modules/AnnouncementModule.java b/src/main/java/de/kittybot/kittybot/modules/AnnouncementModule.java index fc930a8a..9246ec9f 100644 --- a/src/main/java/de/kittybot/kittybot/modules/AnnouncementModule.java +++ b/src/main/java/de/kittybot/kittybot/modules/AnnouncementModule.java @@ -53,7 +53,7 @@ public void onGuildMessageReceived(@NotNull GuildMessageReceivedEvent event){ return; } if((msg.contains("<@" + Config.BOT_ID + ">") || msg.contains("<@!" + Config.BOT_ID + ">")) && msg.contains("help")){ - event.getChannel().sendMessage(new EmbedBuilder() + event.getChannel().sendMessageEmbeds(new EmbedBuilder() .setColor(Colors.KITTYBOT_BLUE) .setAuthor("KittyBot Slash Commands Update", event.getJDA().getSelfUser().getEffectiveAvatarUrl(), Config.ORIGIN_URL) .setDescription("KittyBot now uses the new slash commands.\n" + @@ -92,7 +92,7 @@ public void onGuildJoin(@Nonnull GuildJoinEvent event){ if(channel == null || !channel.canTalk()){ return; } - channel.sendMessage(embed).queue(); + channel.sendMessageEmbeds(embed).queue(); return; } guild.retrieveAuditLogs().type(ActionType.BOT_ADD).limit(1).cache(false).queue(entries -> { @@ -105,14 +105,14 @@ public void onGuildJoin(@Nonnull GuildJoinEvent event){ return; } - user.openPrivateChannel().flatMap(channel -> channel.sendMessage(embed)).queue( + user.openPrivateChannel().flatMap(channel -> channel.sendMessageEmbeds(embed)).queue( null, error -> { var channel = guild.getDefaultChannel(); if(channel == null || !channel.canTalk()){ return; } - channel.sendMessage(embed).queue(); + channel.sendMessageEmbeds(embed).queue(); } ); }); diff --git a/src/main/java/de/kittybot/kittybot/modules/CommandsModule.java b/src/main/java/de/kittybot/kittybot/modules/CommandsModule.java index 4e5420b6..819ce3b2 100644 --- a/src/main/java/de/kittybot/kittybot/modules/CommandsModule.java +++ b/src/main/java/de/kittybot/kittybot/modules/CommandsModule.java @@ -88,15 +88,15 @@ public void deployCommands(long guildId, Map commands){ LOG.info("Registering commands {}...", guildId == -1 ? "global" : "for guild " + guildId); var rqBody = RequestBody.create( - DataArray.fromCollection(commands.values().stream().map(Command::toJSON).collect(Collectors.toList())).toJson(), - MediaType.parse("application/json") + MediaType.parse("application/json"), + DataArray.fromCollection(commands.values().stream().map(Command::toJSON).collect(Collectors.toList())).toJson() ); var route = guildId == -1L ? COMMANDS_CREATE.compile(String.valueOf(Config.BOT_ID)) : GUILD_COMMANDS_CREATE.compile(String.valueOf(Config.BOT_ID), String.valueOf(guildId)); try(var resp = newCall(route, rqBody).execute()){ if(!resp.isSuccessful()){ var body = resp.body(); - LOG.error("Registering commands failed. Request Body: {}, Response Body: {}", commands.toString(), body == null ? "null" : body.string()); + LOG.error("Registering commands failed. Request Body: {}, Response Body: {}", commands, body == null ? "null" : body.string()); } var body = resp.body(); if(body == null){ @@ -142,13 +142,13 @@ public Map getCommands(){ } public long registerGuildCommand(long guildId, DataObject command){ - var rqBody = RequestBody.create(command.toJson(), MediaType.parse("application/json")); + var rqBody = RequestBody.create(MediaType.parse("application/json"), command.toJson()); var route = GUILD_COMMAND_CREATE.compile(String.valueOf(Config.BOT_ID), String.valueOf(guildId)); try(var resp = newCall(route, rqBody).execute()){ if(!resp.isSuccessful()){ var body = resp.body(); - LOG.error("Registering command failed. Request Body: {}, Response Body: {}", command.toString(), body == null ? "null" : body.string()); + LOG.error("Registering command failed. Request Body: {}, Response Body: {}", command, body == null ? "null" : body.string()); return -1L; } var body = resp.body(); @@ -182,7 +182,7 @@ public boolean deleteGuildCommand(long guildId, long commandId){ } public boolean editGuildCommand(long guildId, long commandId, DataObject command){ - var rqBody = RequestBody.create(command.toJson(), MediaType.parse("application/json")); + var rqBody = RequestBody.create(MediaType.parse("application/json"), command.toJson()); var route = GUILD_COMMAND_EDIT.compile(String.valueOf(Config.BOT_ID), String.valueOf(guildId), String.valueOf(commandId)); try(var resp = newCall(route, rqBody).execute()){ @@ -220,7 +220,7 @@ public DataArray getGuildCommands(long guildId){ public void deleteAllCommands(long guildId){ LOG.info("Deleting commands {}...", guildId == -1 ? "global" : "for guild " + guildId); - var rqBody = RequestBody.create(DataArray.empty().toString(), MediaType.parse("application/json")); + var rqBody = RequestBody.create(MediaType.parse("application/json"), DataArray.empty().toString()); var route = guildId == -1L ? COMMANDS_CREATE.compile(String.valueOf(Config.BOT_ID)) : GUILD_COMMANDS_CREATE.compile(String.valueOf(Config.BOT_ID), String.valueOf(guildId)); try(var resp = newCall(route, rqBody).execute()){ diff --git a/src/main/java/de/kittybot/kittybot/modules/GuildLoggingModule.java b/src/main/java/de/kittybot/kittybot/modules/GuildLoggingModule.java index a295a9f0..c1304e8e 100644 --- a/src/main/java/de/kittybot/kittybot/modules/GuildLoggingModule.java +++ b/src/main/java/de/kittybot/kittybot/modules/GuildLoggingModule.java @@ -120,7 +120,7 @@ private void logEvent(GenericGuildEvent event, Color color, User user, String ev if(channel == null){ return; } - channel.sendMessage(new EmbedBuilder() + channel.sendMessageEmbeds(new EmbedBuilder() .setColor(color) .setDescription(String.format(message, args)) .setFooter(eventName, user == null ? null : user.getEffectiveAvatarUrl()) diff --git a/src/main/java/de/kittybot/kittybot/modules/InteractionsModule.java b/src/main/java/de/kittybot/kittybot/modules/InteractionsModule.java index 27040860..370246d9 100644 --- a/src/main/java/de/kittybot/kittybot/modules/InteractionsModule.java +++ b/src/main/java/de/kittybot/kittybot/modules/InteractionsModule.java @@ -123,6 +123,7 @@ else if(interaction.isFromGuild()){ } } catch(Exception e){ + LOG.error("Error while executing command", e); interaction.error(e.getMessage()); } return; diff --git a/src/main/java/de/kittybot/kittybot/modules/MusicModule.java b/src/main/java/de/kittybot/kittybot/modules/MusicModule.java index 55bb8e9f..a53b4ecc 100644 --- a/src/main/java/de/kittybot/kittybot/modules/MusicModule.java +++ b/src/main/java/de/kittybot/kittybot/modules/MusicModule.java @@ -30,7 +30,6 @@ public class MusicModule extends Module implements Serializable{ public static final Pattern URL_PATTERN = Pattern.compile("^(https?|ftp|file)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]?"); - public static final Pattern SPOTIFY_URL_PATTERN = Pattern.compile("(https?://)?(www\\.)?open\\.spotify\\.com/(user/[a-zA-Z0-9-_]+/)?(?track|album|playlist)/(?[a-zA-Z0-9-_]+)"); private Map musicPlayers; @@ -66,7 +65,7 @@ public void onGuildMessageReactionAdd(@NotNull GuildMessageReactionAddEvent even var messageId = event.getMessageIdLong(); var currentTrack = scheduler.getPlayingTrack(); var userId = event.getUserIdLong(); - var requesterId = currentTrack == null ? -1L : currentTrack.getUserData(Long.class); + var requesterId = currentTrack == null ? -1L : currentTrack.getUserData(Long.class) == null ? -1L : currentTrack.getUserData(Long.class); var settings = this.modules.get(SettingsModule.class).getSettings(event.getGuild().getIdLong()); if(messageId != scheduler.getControllerMessageId()){ @@ -202,12 +201,6 @@ public void play(GuildInteraction ia, String query, SearchProvider searchProvide ia.acknowledge().queue(); var manager = this.musicPlayers.computeIfAbsent(ia.getGuildId(), guildId -> new MusicManager(this.modules, guildId, ia.getChannelId())); - var matcher = SPOTIFY_URL_PATTERN.matcher(query); - if(matcher.find()){ - this.modules.get(SpotifyModule.class).load(ia, manager, matcher); - return; - } - if(!URL_PATTERN.matcher(query).matches()){ switch(searchProvider){ case YOUTUBE: diff --git a/src/main/java/de/kittybot/kittybot/modules/NotificationModule.java b/src/main/java/de/kittybot/kittybot/modules/NotificationModule.java index 77c036f4..c107f2b5 100644 --- a/src/main/java/de/kittybot/kittybot/modules/NotificationModule.java +++ b/src/main/java/de/kittybot/kittybot/modules/NotificationModule.java @@ -63,7 +63,7 @@ private void schedule(Set notifs){ return; } guild.retrieveMemberById(notification.getUserId()).flatMap(member -> - channel.sendMessage(member.getAsMention()).embed( + channel.sendMessage(member.getAsMention()).setEmbeds( new EmbedBuilder() .setAuthor("Notification", Category.NOTIFICATION.getUrl(), Category.NOTIFICATION.getEmoteUrl()) .setColor(Colors.NOTIFICATION) diff --git a/src/main/java/de/kittybot/kittybot/modules/PaginatorModule.java b/src/main/java/de/kittybot/kittybot/modules/PaginatorModule.java index 48d80f87..0b5e9ae3 100644 --- a/src/main/java/de/kittybot/kittybot/modules/PaginatorModule.java +++ b/src/main/java/de/kittybot/kittybot/modules/PaginatorModule.java @@ -59,13 +59,13 @@ public void onGuildMessageReactionAdd(@NotNull GuildMessageReactionAddEvent even if(Emoji.ARROW_LEFT.get().equals(code)){ if(currentPage != 0){ paginator.previousPage(); - event.getChannel().editMessageById(event.getMessageIdLong(), paginator.constructEmbed()).queue(); + event.getChannel().editMessageEmbedsById(event.getMessageIdLong(), paginator.constructEmbed()).queue(); } } else if(Emoji.ARROW_RIGHT.get().equals(code)){ if(currentPage != maxPages - 1){ paginator.nextPage(); - event.getChannel().editMessageById(event.getMessageIdLong(), paginator.constructEmbed()).queue(); + event.getChannel().editMessageEmbedsById(event.getMessageIdLong(), paginator.constructEmbed()).queue(); } } else if(Emoji.WASTEBASKET.get().equals(code)){ @@ -84,7 +84,7 @@ public void create(TextChannel channel, long authorId, int maxPages, BiFunction< } public void create(int maxPages, BiFunction embedFunction, MessageEmbed embedBuilder, MessageChannel channel, long userId){ - channel.sendMessage(embedBuilder).queue(message -> { + channel.sendMessageEmbeds(embedBuilder).queue(message -> { var paginator = new Paginator(message, userId, maxPages, embedFunction); this.paginators.put(paginator.getMessageId(), paginator); if(channel instanceof GuildChannel && !((GuildChannel) channel).getGuild().getSelfMember().hasPermission(Permission.MESSAGE_HISTORY, Permission.MESSAGE_ADD_REACTION)){ diff --git a/src/main/java/de/kittybot/kittybot/modules/RequestModule.java b/src/main/java/de/kittybot/kittybot/modules/RequestModule.java index f710a0a2..fe3e3ab7 100644 --- a/src/main/java/de/kittybot/kittybot/modules/RequestModule.java +++ b/src/main/java/de/kittybot/kittybot/modules/RequestModule.java @@ -126,7 +126,7 @@ public String executeRequest(Request request, API api){ public void postToHastebin(String content, Consumer callback){ this.requestBuilder.url(API.HASTEBIN.getUrl() + "/documents"); - this.requestBuilder.post(RequestBody.create(content, MediaType.parse("text/html; charset=utf-8"))); + this.requestBuilder.post(RequestBody.create(MediaType.parse("text/html; charset=utf-8"), content)); executeAsync(this.requestBuilder.build(), (call, response) -> { var body = response.body(); String key = null; @@ -155,7 +155,7 @@ public void uploadCommands(Collection commands){ var json = DataArray.fromCollection(commands.stream().map(Command::toDiscordServicesJSON).collect(Collectors.toList())); this.requestBuilder.url("https://api.discordservices.net/bot/" + Config.BOT_ID + "/commands"); - this.requestBuilder.post(RequestBody.create(json.toJson(), MediaType.parse("application/json"))); + this.requestBuilder.post(RequestBody.create(MediaType.parse("application/json"), json.toJson())); this.requestBuilder.header("Authorization", Config.DISCORD_SERVICES_TOKEN); executeAsync(this.requestBuilder.build(), (call, response) -> {}, (call, response) -> { var body = response.body(); diff --git a/src/main/java/de/kittybot/kittybot/modules/SpotifyModule.java b/src/main/java/de/kittybot/kittybot/modules/SpotifyModule.java deleted file mode 100644 index dfff41c2..00000000 --- a/src/main/java/de/kittybot/kittybot/modules/SpotifyModule.java +++ /dev/null @@ -1,135 +0,0 @@ -package de.kittybot.kittybot.modules; - -import com.wrapper.spotify.SpotifyApi; -import com.wrapper.spotify.model_objects.specification.Track; -import com.wrapper.spotify.requests.authorization.client_credentials.ClientCredentialsRequest; -import de.kittybot.kittybot.objects.module.Module; -import de.kittybot.kittybot.objects.music.MusicManager; -import de.kittybot.kittybot.objects.music.SearchProvider; -import de.kittybot.kittybot.slashcommands.interaction.GuildInteraction; -import de.kittybot.kittybot.utils.Config; -import de.kittybot.kittybot.utils.Utils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; -import java.util.concurrent.TimeUnit; -import java.util.regex.Matcher; -import java.util.stream.Collectors; - -@SuppressWarnings("unused") -public class SpotifyModule extends Module{ - - private static final Logger LOG = LoggerFactory.getLogger(SpotifyModule.class); - - private SpotifyApi spotify; - private ClientCredentialsRequest clientCredentialsRequest; - private int hits; - - @Override - protected void onEnable(){ - this.spotify = new SpotifyApi.Builder().setClientId(Config.SPOTIFY_CLIENT_ID).setClientSecret(Config.SPOTIFY_CLIENT_SECRET).build(); - this.clientCredentialsRequest = this.spotify.clientCredentials().build(); - this.modules.scheduleAtFixedRate(this::refreshAccessToken, 0, 1, TimeUnit.HOURS); - this.hits = 0; - } - - private void refreshAccessToken(){ - try{ - this.spotify.setAccessToken(this.clientCredentialsRequest.execute().getAccessToken()); - this.hits = 0; - } - catch(Exception e){ - this.hits++; - if(this.hits < 10){ - LOG.warn("Updating the access token failed. Retrying in 10 seconds", e); - this.modules.schedule(this::refreshAccessToken, 10, TimeUnit.SECONDS); - return; - } - LOG.error("Updating the access token failed. Retrying in 20 seconds", e); - this.modules.schedule(this::refreshAccessToken, 20, TimeUnit.SECONDS); - } - } - - public void load(GuildInteraction ia, MusicManager manager, Matcher matcher){ - var identifier = matcher.group("identifier"); - switch(matcher.group("type")){ - case "album": - loadAlbum(identifier, ia, manager); - break; - case "track": - loadTrack(identifier, ia, manager); - break; - case "playlist": - loadPlaylist(identifier, ia, manager); - break; - } - } - - private void loadAlbum(String id, GuildInteraction ia, MusicManager manager){ - this.spotify.getAlbumsTracks(id).build().executeAsync().thenAcceptAsync(tracks -> { - var items = tracks.getItems(); - var toLoad = new ArrayList(); - for(var track : items){ - toLoad.add(track.getArtists()[0].getName() + " " + track.getName()); - } - loadTracks(id, ia, manager, toLoad); - }).exceptionally(throwable -> { - ia.editError(throwable.getMessage().contains("invalid id") ? "Album not found" : "There was an error while loading the album").queue(); - return null; - }); - } - - private void loadTrack(String id, GuildInteraction ia, MusicManager manager){ - this.spotify.getTrack(id).build().executeAsync().thenAcceptAsync(track -> - this.modules.get(MusicModule.class).play(ia, track.getArtists()[0].getName() + " " + track.getName(), SearchProvider.YOUTUBE) - ).exceptionally(throwable -> { - ia.editError(throwable.getMessage().contains("invalid id") ? "Track not found" : "There was an error while loading the track").queue(); - return null; - }); - } - - private void loadPlaylist(String id, GuildInteraction ia, MusicManager manager){ - this.spotify.getPlaylistsItems(id).build().executeAsync().thenAcceptAsync(tracks -> { - var items = tracks.getItems(); - var toLoad = new ArrayList(); - for(var item : items){ - var track = (Track) item.getTrack(); - toLoad.add(track.getArtists()[0].getName() + " " + track.getName()); - } - loadTracks(id, ia, manager, toLoad); - }).exceptionally(throwable -> { - ia.editError(throwable.getMessage().contains("Invalid playlist Id") ? "Playlist not found" : "There was an error while loading the playlist").queue(); - return null; - }); - } - - private void loadTracks(String id, GuildInteraction ia, MusicManager manager, List toLoad){ - var restClient = manager.getScheduler().getLink().getRestClient(); - Utils.all(toLoad.stream().map(restClient::getYoutubeSearchResult).collect(Collectors.toList())) - .thenAcceptAsync(results -> { - var tracks = results.stream().map(result -> { - if(result.isEmpty()){ - return null; - } - var track = result.get(0); - track.setUserData(ia.getUserId()); - return track; - }).filter(Objects::nonNull).collect(Collectors.toList()); - - if(tracks.isEmpty()){ - ia.followupError("No tracks on youtube found"); - return; - } - manager.connectToChannel(ia); - manager.getScheduler().queue(ia, tracks.remove(0), tracks); - }) - .exceptionally(error -> { - ia.editError("Something went wrong while fetching your tracks: \n" + error.getMessage()).queue(); - return null; - }); - } - -} diff --git a/src/main/java/de/kittybot/kittybot/objects/module/Modules.java b/src/main/java/de/kittybot/kittybot/objects/module/Modules.java index 05465471..704149fd 100644 --- a/src/main/java/de/kittybot/kittybot/objects/module/Modules.java +++ b/src/main/java/de/kittybot/kittybot/objects/module/Modules.java @@ -64,7 +64,7 @@ private void loadModules(){ var dependencies = instance.getDependencies(); if(dependencies != null && !dependencies.stream().allMatch(this.modules::containsKey)){ queue.add(instance); - LOG.info("Added '{}' back to the queue. Dependencies: {} (Dependency circle jerk incoming!)", instance.getClass().getSimpleName(), dependencies.toString()); + LOG.info("Added '{}' back to the queue. Dependencies: {} (Dependency circle jerk incoming!)", instance.getClass().getSimpleName(), dependencies); continue; } instance.onEnable(); diff --git a/src/main/java/de/kittybot/kittybot/objects/music/AudioLoader.java b/src/main/java/de/kittybot/kittybot/objects/music/AudioLoader.java index 139f8ad4..830ce588 100644 --- a/src/main/java/de/kittybot/kittybot/objects/music/AudioLoader.java +++ b/src/main/java/de/kittybot/kittybot/objects/music/AudioLoader.java @@ -1,17 +1,18 @@ package de.kittybot.kittybot.objects.music; -import com.sedmelluq.discord.lavaplayer.player.AudioLoadResultHandler; -import com.sedmelluq.discord.lavaplayer.tools.FriendlyException; -import com.sedmelluq.discord.lavaplayer.track.AudioPlaylist; -import com.sedmelluq.discord.lavaplayer.track.AudioTrack; import de.kittybot.kittybot.slashcommands.interaction.GuildInteraction; +import lavalink.client.io.FriendlyException; +import lavalink.client.io.LoadResultHandler; +import lavalink.client.player.track.Playlist; +import lavalink.client.player.track.Track; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.util.Collections; +import java.util.List; import java.util.stream.Collectors; -public class AudioLoader implements AudioLoadResultHandler{ +public class AudioLoader implements LoadResultHandler{ private static final Logger LOG = LoggerFactory.getLogger(AudioLoader.class); @@ -24,28 +25,32 @@ public AudioLoader(GuildInteraction ia, MusicManager manager){ } @Override - public void trackLoaded(AudioTrack track){ + public void trackLoaded(Track track){ this.manager.connectToChannel(ia); track.setUserData(ia.getUserId()); this.manager.getScheduler().queue(ia, track, Collections.emptyList()); } @Override - public void playlistLoaded(AudioPlaylist playlist){ + public void playlistLoaded(Playlist playlist){ this.manager.connectToChannel(this.ia); for(var track : playlist.getTracks()){ track.setUserData(this.ia.getUserId()); } var firstTrack = playlist.getTracks().get(0); - if(playlist.isSearchResult()){ - this.manager.getScheduler().queue(this.ia, firstTrack, Collections.emptyList()); - return; - } var toPlay = playlist.getSelectedTrack() == null ? firstTrack : playlist.getSelectedTrack(); this.manager.getScheduler().queue(this.ia, toPlay, playlist.getTracks().stream().filter(track -> !track.equals(toPlay)).collect(Collectors.toList())); } + @Override + public void searchResultLoaded(List tracks){ + this.manager.connectToChannel(this.ia); + var track = tracks.get(0); + track.setUserData(this.ia.getUserId()); + this.manager.getScheduler().queue(this.ia, track, Collections.emptyList()); + } + @Override public void noMatches(){ this.ia.reply("No track found"); diff --git a/src/main/java/de/kittybot/kittybot/objects/music/MusicManager.java b/src/main/java/de/kittybot/kittybot/objects/music/MusicManager.java index 37d35f06..48149ed7 100644 --- a/src/main/java/de/kittybot/kittybot/objects/music/MusicManager.java +++ b/src/main/java/de/kittybot/kittybot/objects/music/MusicManager.java @@ -1,7 +1,5 @@ package de.kittybot.kittybot.objects.music; -import com.sedmelluq.discord.lavaplayer.source.AudioSourceManager; -import com.sedmelluq.discord.lavaplayer.track.AudioTrack; import de.kittybot.kittybot.modules.LavalinkModule; import de.kittybot.kittybot.modules.MusicModule; import de.kittybot.kittybot.objects.enums.Emoji; @@ -13,6 +11,7 @@ import lavalink.client.io.Link; import lavalink.client.io.jda.JdaLink; import lavalink.client.player.event.PlayerEventListenerAdapter; +import lavalink.client.player.track.Track; import net.dv8tion.jda.api.EmbedBuilder; import net.dv8tion.jda.api.MessageBuilder; import net.dv8tion.jda.api.Permission; @@ -91,13 +90,13 @@ else if(track == null){ embed.setColor(Color.GREEN) .addField("Playing", Emoji.FORWARD.get() + " " + MusicUtils.formatTrack(track), false); } - embed.setThumbnail(getThumbnail(track.getIdentifier(), track.getSourceManager())) - .addField("Author", info.author, true) - .addField("Length", TimeUtils.formatDuration(track.getDuration()), true) + embed.setThumbnail(getThumbnail(info.getIdentifier(), info.getSourceName())) + .addField("Author", info.getAuthor(), true) + .addField("Length", TimeUtils.formatDuration(info.getLength()), true) .addField("Requested by", MessageUtils.getUserMention(track.getUserData(Long.class)), true); } embed - .addField("Volume", (int) (this.scheduler.getFilters().getVolume() * 100) + "%", true) + .addField("Volume", this.scheduler.getVolume() + "%", true) .addField("Repeat Mode", this.scheduler.getRepeatMode().getName(), true) .setTimestamp(Instant.now()); return embed; @@ -117,7 +116,7 @@ public void sendMusicController(){ if(!channel.canTalk()){ return; } - channel.sendMessage(embed.build()).queue(message -> { + channel.sendMessageEmbeds(embed.build()).queue(message -> { this.scheduler.setControllerId(message.getIdLong()); if(!channel.getGuild().getSelfMember().hasPermission(channel, Permission.MESSAGE_ADD_REACTION)){ return; @@ -140,14 +139,10 @@ public void updateMusicController(){ if(!channel.getGuild().getSelfMember().hasPermission(channel, Permission.MESSAGE_HISTORY)){ return; } - channel.editMessageById(this.scheduler.getControllerMessageId(), new MessageBuilder().setEmbed(buildMusicController().build()).build()).override(true).queue(); + channel.editMessageById(this.scheduler.getControllerMessageId(), new MessageBuilder().setEmbeds(buildMusicController().build()).build()).override(true).queue(); } - public String getThumbnail(String identifier, AudioSourceManager source){ - if(source == null){ - return null; - } - var sourceName = source.getSourceName(); + public String getThumbnail(String identifier, String sourceName){ String thumbnail; switch(sourceName){ case "youtube": @@ -171,20 +166,20 @@ public DataObject toJSON(){ .put("history", tracksToJSON(this.scheduler.getHistory())); } - private DataArray tracksToJSON(List tracks){ + private DataArray tracksToJSON(List tracks){ return DataArray.fromCollection(tracks.stream().map(this::trackToJSON).collect(Collectors.toList())); } - private DataObject trackToJSON(AudioTrack track){ + private DataObject trackToJSON(Track track){ var info = track.getInfo(); return DataObject.empty() - .put("identifier", info.identifier) - .put("uri", info.uri) - .put("title", info.title) - .put("author", info.author) - .put("length", info.length) - .put("source_name", track.getSourceManager().getSourceName()) - .put("is_stream", info.isStream); + .put("identifier", info.getIdentifier()) + .put("uri", info.getUri()) + .put("title", info.getTitle()) + .put("author", info.getAuthor()) + .put("length", info.getLength()) + .put("source_name", info.getSourceName()) + .put("is_stream", info.isStream()); } public TrackScheduler getScheduler(){ diff --git a/src/main/java/de/kittybot/kittybot/objects/music/TrackScheduler.java b/src/main/java/de/kittybot/kittybot/objects/music/TrackScheduler.java index c2e59dc2..b7be2cb7 100644 --- a/src/main/java/de/kittybot/kittybot/objects/music/TrackScheduler.java +++ b/src/main/java/de/kittybot/kittybot/objects/music/TrackScheduler.java @@ -1,7 +1,5 @@ package de.kittybot.kittybot.objects.music; -import com.sedmelluq.discord.lavaplayer.track.AudioTrack; -import com.sedmelluq.discord.lavaplayer.track.AudioTrackEndReason; import de.kittybot.kittybot.modules.SettingsModule; import de.kittybot.kittybot.objects.module.Modules; import de.kittybot.kittybot.slashcommands.interaction.GuildInteraction; @@ -14,9 +12,13 @@ import lavalink.client.player.IPlayer; import lavalink.client.player.LavalinkPlayer; import lavalink.client.player.event.PlayerEventListenerAdapter; +import lavalink.client.player.track.Track; +import lavalink.client.player.track.TrackEndReason; import net.dv8tion.jda.api.EmbedBuilder; import net.dv8tion.jda.api.entities.Member; import net.dv8tion.jda.api.entities.TextChannel; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.time.Instant; import java.util.Collections; @@ -29,8 +31,8 @@ public class TrackScheduler extends PlayerEventListenerAdapter{ private final Modules modules; private final Link link; private final LavalinkPlayer player; - private final LinkedList queue; - private final LinkedList history; + private final LinkedList queue; + private final LinkedList history; private final long guildId; private final long channelId; private long controllerMessageId; @@ -62,14 +64,14 @@ public void onPlayerResume(IPlayer player){ } @Override - public void onTrackStart(IPlayer player, AudioTrack track){ + public void onTrackStart(IPlayer player, Track track){ this.manager.sendMusicController(); this.manager.cancelDestroy(); } @Override - public void onTrackEnd(IPlayer player, AudioTrack track, AudioTrackEndReason endReason){ - this.history.push(track.makeClone()); + public void onTrackEnd(IPlayer player, Track track, TrackEndReason endReason){ + this.history.push(track); if(!endReason.mayStartNext){ this.manager.updateMusicController(); return; @@ -77,10 +79,10 @@ public void onTrackEnd(IPlayer player, AudioTrack track, AudioTrackEndReason end next(false, track); } - public void next(boolean force, AudioTrack track){ + public void next(boolean force, Track track){ if(this.repeatMode == RepeatMode.SONG && !force){ if(track != null){ - this.player.playTrack(track.makeClone()); + this.player.playTrack(track); } return; } @@ -92,11 +94,11 @@ public void next(boolean force, AudioTrack track){ } this.player.playTrack(next); if(this.repeatMode == RepeatMode.QUEUE && track != null){ - this.queue.offer(track.makeClone()); + this.queue.offer(track); } } - public void queue(GuildInteraction ia, AudioTrack toPlay, List tracks){ + public void queue(GuildInteraction ia, Track toPlay, List tracks){ var shouldPlay = this.player.getPlayingTrack() == null; if(!shouldPlay){ this.queue.offer(toPlay); @@ -171,7 +173,7 @@ public boolean shuffle(){ } public void increaseVolume(int volumeStep){ - var newVol = ((int) this.player.getFilters().getVolume()) * 100 + volumeStep; + var newVol = this.player.getVolume() + volumeStep; if(newVol <= 0){ newVol = 10; } @@ -183,23 +185,27 @@ public void increaseVolume(int volumeStep){ } public void setVolume(int volume){ - this.player.getFilters().setVolume(volume / 100.0f).commit(); + this.player.setVolume(volume); this.manager.updateMusicController(); } + public int getVolume(){ + return this.player.getVolume(); + } + public long getControllerMessageId(){ return this.controllerMessageId; } - public LinkedList getQueue(){ + public LinkedList getQueue(){ return this.queue; } - public LinkedList getHistory(){ + public LinkedList getHistory(){ return this.history; } - public AudioTrack getPlayingTrack(){ + public Track getPlayingTrack(){ return this.player.getPlayingTrack(); } diff --git a/src/main/java/de/kittybot/kittybot/slashcommands/application/Category.java b/src/main/java/de/kittybot/kittybot/slashcommands/application/Category.java index f88e21f8..5cc5cda8 100644 --- a/src/main/java/de/kittybot/kittybot/slashcommands/application/Category.java +++ b/src/main/java/de/kittybot/kittybot/slashcommands/application/Category.java @@ -42,7 +42,7 @@ public DataObject toJSON(){ } public String getUrl(){ - return "http://" + Config.ORIGIN_URL + "/commands#" + this.name.toLowerCase(); + return "https://" + Config.ORIGIN_URL + "/commands#" + this.name.toLowerCase(); } public String getEmoteUrl(){ diff --git a/src/main/java/de/kittybot/kittybot/slashcommands/interaction/response/InteractionRespondAction.java b/src/main/java/de/kittybot/kittybot/slashcommands/interaction/response/InteractionRespondAction.java index c95a57f8..e2bf3039 100644 --- a/src/main/java/de/kittybot/kittybot/slashcommands/interaction/response/InteractionRespondAction.java +++ b/src/main/java/de/kittybot/kittybot/slashcommands/interaction/response/InteractionRespondAction.java @@ -72,7 +72,7 @@ public RequestBody finalizeData(){ } protected RequestBody asJSON(){ - return RequestBody.create(getJSON().toJson(), Requester.MEDIA_TYPE_JSON); + return RequestBody.create(Requester.MEDIA_TYPE_JSON, getJSON().toJson()); } protected DataObject getJSON(){ diff --git a/src/main/java/de/kittybot/kittybot/utils/Config.java b/src/main/java/de/kittybot/kittybot/utils/Config.java index bb29e14b..eede6b5f 100644 --- a/src/main/java/de/kittybot/kittybot/utils/Config.java +++ b/src/main/java/de/kittybot/kittybot/utils/Config.java @@ -37,9 +37,6 @@ public class Config{ public static String SIGNING_KEY; - public static String SPOTIFY_CLIENT_ID; - public static String SPOTIFY_CLIENT_SECRET; - public static String TOP_GG_TOKEN; public static String DISCORD_EXTREME_LIST_TOKEN; public static String DISCORD_BOATS_TOKEN; @@ -106,9 +103,6 @@ public static void init(String path) throws IOException, MissingConfigValuesExce SIGNING_KEY = json.getString("signing_key", ""); - SPOTIFY_CLIENT_ID = json.getString("spotify_client_id", ""); - SPOTIFY_CLIENT_SECRET = json.getString("spotify_client_secret", ""); - DISCORD_BOTS_TOKEN = getBotListToken(json, "discord_bots_token"); TOP_GG_TOKEN = getBotListToken(json, "top_gg_token"); DISCORD_EXTREME_LIST_TOKEN = getBotListToken(json, "discord_extreme_list_token"); diff --git a/src/main/java/de/kittybot/kittybot/utils/MusicUtils.java b/src/main/java/de/kittybot/kittybot/utils/MusicUtils.java index 0764e31a..a970dad9 100644 --- a/src/main/java/de/kittybot/kittybot/utils/MusicUtils.java +++ b/src/main/java/de/kittybot/kittybot/utils/MusicUtils.java @@ -1,11 +1,11 @@ package de.kittybot.kittybot.utils; -import com.sedmelluq.discord.lavaplayer.track.AudioTrack; import de.kittybot.kittybot.modules.PaginatorModule; import de.kittybot.kittybot.modules.SettingsModule; import de.kittybot.kittybot.objects.module.Modules; import de.kittybot.kittybot.objects.music.TrackScheduler; import de.kittybot.kittybot.slashcommands.interaction.GuildInteraction; +import lavalink.client.player.track.Track; import net.dv8tion.jda.api.Permission; import net.dv8tion.jda.api.entities.TextChannel; @@ -17,7 +17,7 @@ public class MusicUtils{ private MusicUtils(){} - public static String formatTracks(String message, Collection tracks){ + public static String formatTracks(String message, Collection tracks){ var trackMessage = new StringBuilder(message).append("\n"); for(var track : tracks){ var name = formatTrackWithInfo(track) + "\n"; @@ -29,14 +29,14 @@ public static String formatTracks(String message, Collection tracks) return trackMessage.toString(); } - public static String formatTrackWithInfo(AudioTrack track){ + public static String formatTrackWithInfo(Track track){ var info = track.getInfo(); - return formatTrack(track) + " - " + TimeUtils.formatDuration(info.length) + " [" + MessageUtils.getUserMention(track.getUserData(Long.class)) + "]"; + return formatTrack(track) + " - " + TimeUtils.formatDuration(info.getLength()) + " [" + MessageUtils.getUserMention(track.getUserData(Long.class)) + "]"; } - public static String formatTrack(AudioTrack track){ + public static String formatTrack(Track track){ var info = track.getInfo(); - return MessageUtils.maskLink("`" + info.title + "`", info.uri); + return MessageUtils.maskLink("`" + info.getTitle() + "`", info.getUri()); } public static boolean checkCommandRequirements(GuildInteraction ia, TrackScheduler scheduler){ @@ -77,7 +77,7 @@ public static boolean checkMusicPermissions(GuildInteraction ia, TrackScheduler return true; } - public static void sendTracks(Collection tracks, Modules modules, TextChannel channel, long authorId, String baseMessage){ + public static void sendTracks(Collection tracks, Modules modules, TextChannel channel, long authorId, String baseMessage){ if(channel == null){ return; } diff --git a/src/main/resources/logback.xml b/src/main/resources/logback.xml index e32dc004..3fd50110 100644 --- a/src/main/resources/logback.xml +++ b/src/main/resources/logback.xml @@ -1,6 +1,8 @@ + + INFO @@ -19,14 +21,6 @@ - - - - - - - - From 12c1aa3f67cb21f7067e699e241bf34182ec4995 Mon Sep 17 00:00:00 2001 From: TopiSenpai Date: Fri, 7 Jan 2022 03:55:06 +0100 Subject: [PATCH 3/4] update lavalink client --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index d347ee77..5144fd98 100644 --- a/build.gradle +++ b/build.gradle @@ -28,7 +28,7 @@ dependencies { implementation "dev.mlnr:BotListHandler-jda:2.0.0_11" // audio - implementation "com.github.KittyBot-Org:Lavalink-Client:91ba078" + implementation "com.github.KittyBot-Org:Lavalink-Client:5.0.0" // database implementation "com.zaxxer:HikariCP:5.0.0" From b37edc733f64f0f12566857becf872376631b1c8 Mon Sep 17 00:00:00 2001 From: TopiSenpai Date: Fri, 7 Jan 2022 04:16:55 +0100 Subject: [PATCH 4/4] revert AudioTrack to Track name changes --- build.gradle | 2 +- .../kittybot/objects/music/AudioLoader.java | 10 ++++----- .../kittybot/objects/music/MusicManager.java | 6 ++--- .../objects/music/TrackScheduler.java | 22 +++++++++---------- .../kittybot/kittybot/utils/MusicUtils.java | 10 ++++----- 5 files changed, 25 insertions(+), 25 deletions(-) diff --git a/build.gradle b/build.gradle index 5144fd98..6d5a5f9d 100644 --- a/build.gradle +++ b/build.gradle @@ -28,7 +28,7 @@ dependencies { implementation "dev.mlnr:BotListHandler-jda:2.0.0_11" // audio - implementation "com.github.KittyBot-Org:Lavalink-Client:5.0.0" + implementation "com.github.KittyBot-Org:Lavalink-Client:1.0.0" // database implementation "com.zaxxer:HikariCP:5.0.0" diff --git a/src/main/java/de/kittybot/kittybot/objects/music/AudioLoader.java b/src/main/java/de/kittybot/kittybot/objects/music/AudioLoader.java index 830ce588..9936b4c5 100644 --- a/src/main/java/de/kittybot/kittybot/objects/music/AudioLoader.java +++ b/src/main/java/de/kittybot/kittybot/objects/music/AudioLoader.java @@ -3,8 +3,8 @@ import de.kittybot.kittybot.slashcommands.interaction.GuildInteraction; import lavalink.client.io.FriendlyException; import lavalink.client.io.LoadResultHandler; -import lavalink.client.player.track.Playlist; -import lavalink.client.player.track.Track; +import lavalink.client.player.track.AudioPlaylist; +import lavalink.client.player.track.AudioTrack; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -25,14 +25,14 @@ public AudioLoader(GuildInteraction ia, MusicManager manager){ } @Override - public void trackLoaded(Track track){ + public void trackLoaded(AudioTrack track){ this.manager.connectToChannel(ia); track.setUserData(ia.getUserId()); this.manager.getScheduler().queue(ia, track, Collections.emptyList()); } @Override - public void playlistLoaded(Playlist playlist){ + public void playlistLoaded(AudioPlaylist playlist){ this.manager.connectToChannel(this.ia); for(var track : playlist.getTracks()){ track.setUserData(this.ia.getUserId()); @@ -44,7 +44,7 @@ public void playlistLoaded(Playlist playlist){ } @Override - public void searchResultLoaded(List tracks){ + public void searchResultLoaded(List tracks){ this.manager.connectToChannel(this.ia); var track = tracks.get(0); track.setUserData(this.ia.getUserId()); diff --git a/src/main/java/de/kittybot/kittybot/objects/music/MusicManager.java b/src/main/java/de/kittybot/kittybot/objects/music/MusicManager.java index 48149ed7..bb96bf90 100644 --- a/src/main/java/de/kittybot/kittybot/objects/music/MusicManager.java +++ b/src/main/java/de/kittybot/kittybot/objects/music/MusicManager.java @@ -11,7 +11,7 @@ import lavalink.client.io.Link; import lavalink.client.io.jda.JdaLink; import lavalink.client.player.event.PlayerEventListenerAdapter; -import lavalink.client.player.track.Track; +import lavalink.client.player.track.AudioTrack; import net.dv8tion.jda.api.EmbedBuilder; import net.dv8tion.jda.api.MessageBuilder; import net.dv8tion.jda.api.Permission; @@ -166,11 +166,11 @@ public DataObject toJSON(){ .put("history", tracksToJSON(this.scheduler.getHistory())); } - private DataArray tracksToJSON(List tracks){ + private DataArray tracksToJSON(List tracks){ return DataArray.fromCollection(tracks.stream().map(this::trackToJSON).collect(Collectors.toList())); } - private DataObject trackToJSON(Track track){ + private DataObject trackToJSON(AudioTrack track){ var info = track.getInfo(); return DataObject.empty() .put("identifier", info.getIdentifier()) diff --git a/src/main/java/de/kittybot/kittybot/objects/music/TrackScheduler.java b/src/main/java/de/kittybot/kittybot/objects/music/TrackScheduler.java index b7be2cb7..5313dc2a 100644 --- a/src/main/java/de/kittybot/kittybot/objects/music/TrackScheduler.java +++ b/src/main/java/de/kittybot/kittybot/objects/music/TrackScheduler.java @@ -12,8 +12,8 @@ import lavalink.client.player.IPlayer; import lavalink.client.player.LavalinkPlayer; import lavalink.client.player.event.PlayerEventListenerAdapter; -import lavalink.client.player.track.Track; -import lavalink.client.player.track.TrackEndReason; +import lavalink.client.player.track.AudioTrack; +import lavalink.client.player.track.AudioTrackEndReason; import net.dv8tion.jda.api.EmbedBuilder; import net.dv8tion.jda.api.entities.Member; import net.dv8tion.jda.api.entities.TextChannel; @@ -31,8 +31,8 @@ public class TrackScheduler extends PlayerEventListenerAdapter{ private final Modules modules; private final Link link; private final LavalinkPlayer player; - private final LinkedList queue; - private final LinkedList history; + private final LinkedList queue; + private final LinkedList history; private final long guildId; private final long channelId; private long controllerMessageId; @@ -64,13 +64,13 @@ public void onPlayerResume(IPlayer player){ } @Override - public void onTrackStart(IPlayer player, Track track){ + public void onTrackStart(IPlayer player, AudioTrack track){ this.manager.sendMusicController(); this.manager.cancelDestroy(); } @Override - public void onTrackEnd(IPlayer player, Track track, TrackEndReason endReason){ + public void onTrackEnd(IPlayer player, AudioTrack track, AudioTrackEndReason endReason){ this.history.push(track); if(!endReason.mayStartNext){ this.manager.updateMusicController(); @@ -79,7 +79,7 @@ public void onTrackEnd(IPlayer player, Track track, TrackEndReason endReason){ next(false, track); } - public void next(boolean force, Track track){ + public void next(boolean force, AudioTrack track){ if(this.repeatMode == RepeatMode.SONG && !force){ if(track != null){ this.player.playTrack(track); @@ -98,7 +98,7 @@ public void next(boolean force, Track track){ } } - public void queue(GuildInteraction ia, Track toPlay, List tracks){ + public void queue(GuildInteraction ia, AudioTrack toPlay, List tracks){ var shouldPlay = this.player.getPlayingTrack() == null; if(!shouldPlay){ this.queue.offer(toPlay); @@ -197,15 +197,15 @@ public long getControllerMessageId(){ return this.controllerMessageId; } - public LinkedList getQueue(){ + public LinkedList getQueue(){ return this.queue; } - public LinkedList getHistory(){ + public LinkedList getHistory(){ return this.history; } - public Track getPlayingTrack(){ + public AudioTrack getPlayingTrack(){ return this.player.getPlayingTrack(); } diff --git a/src/main/java/de/kittybot/kittybot/utils/MusicUtils.java b/src/main/java/de/kittybot/kittybot/utils/MusicUtils.java index a970dad9..c5270403 100644 --- a/src/main/java/de/kittybot/kittybot/utils/MusicUtils.java +++ b/src/main/java/de/kittybot/kittybot/utils/MusicUtils.java @@ -5,7 +5,7 @@ import de.kittybot.kittybot.objects.module.Modules; import de.kittybot.kittybot.objects.music.TrackScheduler; import de.kittybot.kittybot.slashcommands.interaction.GuildInteraction; -import lavalink.client.player.track.Track; +import lavalink.client.player.track.AudioTrack; import net.dv8tion.jda.api.Permission; import net.dv8tion.jda.api.entities.TextChannel; @@ -17,7 +17,7 @@ public class MusicUtils{ private MusicUtils(){} - public static String formatTracks(String message, Collection tracks){ + public static String formatTracks(String message, Collection tracks){ var trackMessage = new StringBuilder(message).append("\n"); for(var track : tracks){ var name = formatTrackWithInfo(track) + "\n"; @@ -29,12 +29,12 @@ public static String formatTracks(String message, Collection tracks){ return trackMessage.toString(); } - public static String formatTrackWithInfo(Track track){ + public static String formatTrackWithInfo(AudioTrack track){ var info = track.getInfo(); return formatTrack(track) + " - " + TimeUtils.formatDuration(info.getLength()) + " [" + MessageUtils.getUserMention(track.getUserData(Long.class)) + "]"; } - public static String formatTrack(Track track){ + public static String formatTrack(AudioTrack track){ var info = track.getInfo(); return MessageUtils.maskLink("`" + info.getTitle() + "`", info.getUri()); } @@ -77,7 +77,7 @@ public static boolean checkMusicPermissions(GuildInteraction ia, TrackScheduler return true; } - public static void sendTracks(Collection tracks, Modules modules, TextChannel channel, long authorId, String baseMessage){ + public static void sendTracks(Collection tracks, Modules modules, TextChannel channel, long authorId, String baseMessage){ if(channel == null){ return; }