diff --git a/Cargo.lock b/Cargo.lock index e507787..9a5c56d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,18 +4,18 @@ version = 3 [[package]] name = "addr2line" -version = "0.22.0" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" dependencies = [ "gimli", ] [[package]] -name = "adler" -version = "1.0.2" +name = "adler2" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" [[package]] name = "aformat" @@ -38,7 +38,7 @@ dependencies = [ "bytestring", "proc-macro2", "quote", - "syn 2.0.82", + "syn 2.0.89", ] [[package]] @@ -67,22 +67,22 @@ dependencies = [ [[package]] name = "arrayvec" -version = "0.7.4" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" dependencies = [ "serde", ] [[package]] name = "async-trait" -version = "0.1.81" +version = "0.1.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107" +checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.82", + "syn 2.0.89", ] [[package]] @@ -93,23 +93,23 @@ checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" [[package]] name = "autocfg" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "backtrace" -version = "0.3.73" +version = "0.3.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" +checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" dependencies = [ "addr2line", - "cc", "cfg-if", "libc", "miniz_oxide", "object", "rustc-demangle", + "windows-targets 0.52.6", ] [[package]] @@ -142,7 +142,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.82", + "syn 2.0.89", "to-arraystring", ] @@ -160,15 +160,15 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.7.1" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" +checksum = "9ac0150caa2ae65ca5bd83f25c7de183dea78d4d366469f148435e2acfbad0da" [[package]] name = "bytestring" -version = "1.3.1" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d80203ea6b29df88012294f62733de21cfeab47f17b41af3a38bc30a03ee72" +checksum = "e465647ae23b2823b0753f50decb2d5a86d2bb2cac04788fafd1f80e45378e5f" dependencies = [ "bytes", ] @@ -185,9 +185,12 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.8" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "504bdec147f2cc13c8b57ed9401fd8a147cc66b67ad5cb241394244f2c947549" +checksum = "fd9de9f2205d5ef3fd67e685b0df337994ddd4495e2a28d185500d0e1edfea47" +dependencies = [ + "shlex", +] [[package]] name = "cfg-if" @@ -195,6 +198,12 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "cfg_aliases" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + [[package]] name = "chrono" version = "0.4.38" @@ -220,15 +229,15 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "cpufeatures" -version = "0.2.12" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +checksum = "16b80225097f2e5ae4e7179dd2266824648f3e2f49d9134d584b76389d31c4c3" dependencies = [ "libc", ] @@ -298,7 +307,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.82", + "syn 2.0.89", ] [[package]] @@ -309,7 +318,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core", "quote", - "syn 2.0.82", + "syn 2.0.89", ] [[package]] @@ -320,7 +329,7 @@ checksum = "5041cc499144891f3790297212f32a74fb938e5136a14943f338ef9e0ae276cf" dependencies = [ "cfg-if", "crossbeam-utils", - "hashbrown", + "hashbrown 0.14.5", "lock_api", "once_cell", "parking_lot_core", @@ -364,6 +373,17 @@ dependencies = [ "crypto-common", ] +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.89", +] + [[package]] name = "either" version = "1.13.0" @@ -372,23 +392,23 @@ checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" [[package]] name = "encoding_rs" -version = "0.8.34" +version = "0.8.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" +checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" dependencies = [ "cfg-if", ] [[package]] name = "enum-as-inner" -version = "0.6.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ffccbb6966c05b32ef8fbac435df276c4ae4d3dc55a8cd0eb9745e6c12f546a" +checksum = "a1e6a265c649f3f5979b601d26f1d05ada116434c87741c9493cb56218f76cbc" dependencies = [ - "heck 0.4.1", + "heck", "proc-macro2", "quote", - "syn 2.0.82", + "syn 2.0.89", ] [[package]] @@ -419,15 +439,15 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" +checksum = "486f806e73c5707928240ddc295403b1b93c96a02038563881c4a2fd84b81ac4" [[package]] name = "flate2" -version = "1.0.31" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f211bbe8e69bbd0cfdea405084f128ae8b4aaa6b0b522fc8f2b009084797920" +checksum = "c936bfdafb507ebbf50b8074c54fa31c5be9a1e7e5f467dd659697041407d07c" dependencies = [ "crc32fast", "miniz_oxide", @@ -465,9 +485,9 @@ dependencies = [ [[package]] name = "futures" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" +checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" dependencies = [ "futures-channel", "futures-core", @@ -479,9 +499,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" dependencies = [ "futures-core", "futures-sink", @@ -489,44 +509,44 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" [[package]] name = "futures-io" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" [[package]] name = "futures-macro" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.82", + "syn 2.0.89", ] [[package]] name = "futures-sink" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" [[package]] name = "futures-task" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" [[package]] name = "futures-util" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" dependencies = [ "futures-channel", "futures-core", @@ -572,21 +592,23 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", + "js-sys", "libc", "wasi", + "wasm-bindgen", ] [[package]] name = "gimli" -version = "0.29.0" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" [[package]] name = "h2" -version = "0.4.5" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa82e28a107a8cc405f0839610bdc9b15f1e25ec7d696aa5cf173edbcb1486ab" +checksum = "ccae279728d634d083c00f6099cb58f01cc99c145b84b8be2f6c74618d79922e" dependencies = [ "atomic-waker", "bytes", @@ -608,10 +630,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" [[package]] -name = "heck" -version = "0.4.1" +name = "hashbrown" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" [[package]] name = "heck" @@ -672,15 +694,15 @@ dependencies = [ [[package]] name = "httparse" -version = "1.9.4" +version = "1.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" +checksum = "7d71d3574edd2771538b901e6549113b4006ece66150fb69c0fb6d9a2adae946" [[package]] name = "hyper" -version = "1.4.1" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50dfd22e0e76d0f662d429a5f80fcaf3855009297eab6a0a9f8543834744ba05" +checksum = "97818827ef4f364230e16705d4706e2897df2bb60617d6ca15d598025a3c481f" dependencies = [ "bytes", "futures-channel", @@ -698,18 +720,18 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.27.2" +version = "0.27.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ee4be2c948921a1a5320b629c4193916ed787a7f7f293fd3f7f5a6c9de74155" +checksum = "08afdbb5c31130e3034af566421053ab03787c640246a446327f550d11bcb333" dependencies = [ "futures-util", "http", "hyper", "hyper-util", - "rustls 0.23.12", + "rustls", "rustls-pki-types", "tokio", - "tokio-rustls 0.26.0", + "tokio-rustls", "tower-service", "webpki-roots", ] @@ -732,9 +754,9 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.7" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cde7055719c54e36e95e8719f95883f22072a48ede39db7fc17a4e1d5281e9b9" +checksum = "df2dcfbe0677734ab2f3ffa7fa7bfd4706bfdc1ef393f2ee30184aed67e631b4" dependencies = [ "bytes", "futures-channel", @@ -745,16 +767,15 @@ dependencies = [ "pin-project-lite", "socket2", "tokio", - "tower", "tower-service", "tracing", ] [[package]] name = "iana-time-zone" -version = "0.1.60" +version = "0.1.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" +checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -773,6 +794,124 @@ dependencies = [ "cc", ] +[[package]] +name = "icu_collections" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locid" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_locid_transform" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_locid_transform_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" + +[[package]] +name = "icu_normalizer" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" + +[[package]] +name = "icu_properties" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" + +[[package]] +name = "icu_provider" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_provider_macros" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.89", +] + [[package]] name = "ident_case" version = "1.0.1" @@ -791,22 +930,33 @@ dependencies = [ [[package]] name = "idna" -version = "0.5.0" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" dependencies = [ - "unicode-bidi", - "unicode-normalization", + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" +dependencies = [ + "icu_normalizer", + "icu_properties", ] [[package]] name = "indexmap" -version = "2.3.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3fc2e30ba82dd1b3911c8de1ffc143c74a914a14e99514d7637e3099df5ea0" +checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" dependencies = [ "equivalent", - "hashbrown", + "hashbrown 0.15.2", ] [[package]] @@ -823,30 +973,30 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.9.0" +version = "2.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" +checksum = "ddc24109865250148c2e0f3d25d4f0f479571723792d3802153c60922a4fb708" [[package]] name = "itoa" -version = "1.0.11" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" +checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" [[package]] name = "js-sys" -version = "0.3.69" +version = "0.3.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" +checksum = "6a88f1bda2bd75b0452a14784937d796722fdebfe50df998aeb3f0b7603019a9" dependencies = [ "wasm-bindgen", ] [[package]] name = "libc" -version = "0.2.165" +version = "0.2.166" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcb4d3d38eab6c5239a362fa8bae48c03baf980a6e7079f063942d563ef3533e" +checksum = "c2ccc108bbc0b1331bd061864e7cd823c0cab660bbe6970e66e2c0614decde36" [[package]] name = "linked-hash-map" @@ -860,6 +1010,12 @@ version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" +[[package]] +name = "litemap" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" + [[package]] name = "lock_api" version = "0.4.12" @@ -915,18 +1071,18 @@ dependencies = [ [[package]] name = "miniz_oxide" -version = "0.7.4" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" +checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" dependencies = [ - "adler", + "adler2", ] [[package]] name = "mio" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4569e456d394deccd22ce1c1913e6ea0e54519f577285001215d33557431afe4" +checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" dependencies = [ "hermit-abi", "libc", @@ -986,9 +1142,9 @@ dependencies = [ [[package]] name = "object" -version = "0.36.3" +version = "0.36.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27b64972346851a39438c60b341ebc01bba47464ae329e55cf343eb93964efd9" +checksum = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e" dependencies = [ "memchr", ] @@ -1001,9 +1157,9 @@ checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" [[package]] name = "openssl" -version = "0.10.66" +version = "0.10.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" +checksum = "6174bc48f102d208783c2c84bf931bb75927a617866870de8a4ea85597f871f5" dependencies = [ "bitflags", "cfg-if", @@ -1022,7 +1178,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.82", + "syn 2.0.89", ] [[package]] @@ -1033,18 +1189,18 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-src" -version = "300.3.2+3.3.2" +version = "300.4.1+3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a211a18d945ef7e648cc6e0058f4c548ee46aab922ea203e0d30e966ea23647b" +checksum = "faa4eac4138c62414b5622d1b31c5c304f34b406b013c079c2bbc652fdd6678c" dependencies = [ "cc", ] [[package]] name = "openssl-sys" -version = "0.9.103" +version = "0.9.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" +checksum = "45abf306cbf99debc8195b66b7346498d7b10c210de50418b5ccd7ceba08c741" dependencies = [ "cc", "libc", @@ -1082,31 +1238,11 @@ version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" -[[package]] -name = "pin-project" -version = "1.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" -dependencies = [ - "pin-project-internal", -] - -[[package]] -name = "pin-project-internal" -version = "1.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.82", -] - [[package]] name = "pin-project-lite" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" +checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" [[package]] name = "pin-utils" @@ -1116,14 +1252,14 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" +checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" [[package]] name = "poise" version = "0.6.1" -source = "git+https://github.com/serenity-rs/poise?branch=serenity-next#e7c92b7a9b7dabb37fb879fabd65fa18bd00aad8" +source = "git+https://github.com/serenity-rs/poise?branch=serenity-next#414fdf78705d1950ec1c78dbb2f75d451a9956eb" dependencies = [ "async-trait", "derivative", @@ -1141,12 +1277,12 @@ dependencies = [ [[package]] name = "poise_macros" version = "0.6.1" -source = "git+https://github.com/serenity-rs/poise?branch=serenity-next#e7c92b7a9b7dabb37fb879fabd65fa18bd00aad8" +source = "git+https://github.com/serenity-rs/poise?branch=serenity-next#414fdf78705d1950ec1c78dbb2f75d451a9956eb" dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.82", + "syn 2.0.89", ] [[package]] @@ -1166,9 +1302,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.86" +version = "1.0.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" dependencies = [ "unicode-ident", ] @@ -1181,57 +1317,61 @@ checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" [[package]] name = "quinn" -version = "0.11.5" +version = "0.11.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c7c5fdde3cdae7203427dc4f0a68fe0ed09833edc525a03456b153b79828684" +checksum = "62e96808277ec6f97351a2380e6c25114bc9e67037775464979f3037c92d05ef" dependencies = [ "bytes", "pin-project-lite", "quinn-proto", "quinn-udp", "rustc-hash", - "rustls 0.23.12", + "rustls", "socket2", - "thiserror", + "thiserror 2.0.3", "tokio", "tracing", ] [[package]] name = "quinn-proto" -version = "0.11.8" +version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" +checksum = "a2fe5ef3495d7d2e377ff17b1a8ce2ee2ec2a18cde8b6ad6619d65d0701c135d" dependencies = [ "bytes", + "getrandom", "rand", "ring", "rustc-hash", - "rustls 0.23.12", + "rustls", + "rustls-pki-types", "slab", - "thiserror", + "thiserror 2.0.3", "tinyvec", "tracing", + "web-time", ] [[package]] name = "quinn-udp" -version = "0.5.4" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bffec3605b73c6f1754535084a85229fa8a30f86014e6c81aeec4abb68b0285" +checksum = "7d5a626c6807713b15cac82a6acaccd6043c9a5408c24baae07611fec3f243da" dependencies = [ + "cfg_aliases", "libc", "once_cell", "socket2", "tracing", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "quote" -version = "1.0.36" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ "proc-macro2", ] @@ -1288,9 +1428,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.3" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a908a6e00f1fdd0dfd9c0eb08ce85126f6d8bbda50017e74bc4a4b7d4a926a4" +checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f" dependencies = [ "bitflags", ] @@ -1309,9 +1449,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "368758f23274712b504848e9d5a6f010445cc8b87a7cdb4d7cbee666c1288da3" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" dependencies = [ "aho-corasick", "memchr", @@ -1353,7 +1493,7 @@ dependencies = [ "percent-encoding", "pin-project-lite", "quinn", - "rustls 0.23.12", + "rustls", "rustls-pemfile", "rustls-pki-types", "serde", @@ -1363,7 +1503,7 @@ dependencies = [ "system-configuration", "tokio", "tokio-native-tls", - "tokio-rustls 0.26.0", + "tokio-rustls", "tokio-util", "tower-service", "url", @@ -1444,6 +1584,7 @@ dependencies = [ name = "rustbot_tokens" version = "0.1.0" dependencies = [ + "poise", "tokenservice-client", "tokio", ] @@ -1462,9 +1603,9 @@ checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" [[package]] name = "rustix" -version = "0.38.34" +version = "0.38.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" +checksum = "d7f649912bc1495e167a6edee79151c84b1bad49748cb4f1f1167f459f6224f6" dependencies = [ "bitflags", "errno", @@ -1475,23 +1616,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.22.4" +version = "0.23.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf4ef73721ac7bcd79b2b315da7779d8fc09718c6b3d2d1b2d94850eb8c18432" -dependencies = [ - "log", - "ring", - "rustls-pki-types", - "rustls-webpki", - "subtle", - "zeroize", -] - -[[package]] -name = "rustls" -version = "0.23.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c58f8c84392efc0a126acce10fa59ff7b3d2ac06ab451a33f2741989b806b044" +checksum = "9c9cc1d47e243d655ace55ed38201c19ae02c148ae56412ab8750e8f0166ab7f" dependencies = [ "once_cell", "ring", @@ -1503,25 +1630,27 @@ dependencies = [ [[package]] name = "rustls-pemfile" -version = "2.1.3" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "196fe16b00e106300d3e45ecfcb764fa292a535d7326a29a5875c579c7417425" +checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50" dependencies = [ - "base64", "rustls-pki-types", ] [[package]] name = "rustls-pki-types" -version = "1.8.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc0a2ce646f8655401bb81e7927b812614bd5d91dbc968696be50603510fcaf0" +checksum = "16f1201b3c9a7ee8039bcadc17b7e605e2945b27eee7631788c1bd2b0643674b" +dependencies = [ + "web-time", +] [[package]] name = "rustls-webpki" -version = "0.102.6" +version = "0.102.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e6b52d4fda176fd835fdc55a835d4a89b8499cad995885a21149d5ad62f852e" +checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" dependencies = [ "ring", "rustls-pki-types", @@ -1542,11 +1671,11 @@ checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "schannel" -version = "0.1.23" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" +checksum = "1f29ebaa345f945cec9fbbc532eb307f0fdad8161f281b6369539c8d84876b3d" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -1561,7 +1690,6 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9bd1c54ea06cfd2f6b63219704de0b9b4f72dcc2b8fdef820be6cd799780e91e" dependencies = [ - "serde", "zeroize", ] @@ -1580,9 +1708,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.11.1" +version = "2.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75da29fe9b9b08fe9d6b22b5b4bcbc75d8db3aa31e639aa56bb62e9d46bfceaf" +checksum = "fa39c7303dc58b5543c94d22c1766b0d31f2ee58306363ea622b10bbc075eaa2" dependencies = [ "core-foundation-sys", "libc", @@ -1614,14 +1742,14 @@ checksum = "ad1e866f866923f252f05c889987993144fb74e722403468a4ebd70c3cd756c0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.82", + "syn 2.0.89", ] [[package]] name = "serde_json" -version = "1.0.132" +version = "1.0.133" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d726bfaff4b320266d395898905d0eba0345aae23b54aee3a737e260fd46db03" +checksum = "c7fceb2473b9166b2294ef05efcb65a3db80803f0b03ef86a5fc88a2b85ee377" dependencies = [ "itoa", "memchr", @@ -1631,9 +1759,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.7" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb5b1b31579f3811bf615c144393417496f152e12ac8b7663bf664f4a815306d" +checksum = "87607cb1398ed59d48732e575a4c28a7a8ebf2454b964fe3f224f2afc07909e1" dependencies = [ "serde", ] @@ -1652,8 +1780,8 @@ dependencies = [ [[package]] name = "serenity" -version = "0.12.2" -source = "git+https://github.com/serenity-rs/serenity?branch=next#391b234fca970b312727278212a79978197124d2" +version = "0.12.4" +source = "git+https://github.com/serenity-rs/serenity?branch=next#fbeda94a0dfd029d2281e636537b067764a01ac9" dependencies = [ "aformat", "arrayvec", @@ -1673,7 +1801,6 @@ dependencies = [ "parking_lot", "percent-encoding", "reqwest", - "secrecy", "serde", "serde_cow", "serde_json", @@ -1700,6 +1827,21 @@ dependencies = [ "digest", ] +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "signal-hook-registry" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" +dependencies = [ + "libc", +] + [[package]] name = "slab" version = "0.4.9" @@ -1711,9 +1853,9 @@ dependencies = [ [[package]] name = "small-fixed-array" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de1265a0b6b240b940caeea26abcffd4382248e479b6d475e7ce8fb88884e504" +checksum = "afb04f3f639a22ac384621eb6a77dcaded413673c44e1a6b5222a755c5c02f57" dependencies = [ "serde", ] @@ -1740,6 +1882,12 @@ version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + [[package]] name = "strsim" version = "0.11.1" @@ -1761,11 +1909,11 @@ version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" dependencies = [ - "heck 0.5.0", + "heck", "proc-macro2", "quote", "rustversion", - "syn 2.0.82", + "syn 2.0.89", ] [[package]] @@ -1787,9 +1935,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.82" +version = "2.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83540f837a8afc019423a8edb95b52a8effe46957ee402287f4292fae35be021" +checksum = "44d46482f1c1c87acd84dea20c1bf5ebff4c757009ed6bf19cfd36fb10e92c4e" dependencies = [ "proc-macro2", "quote", @@ -1798,13 +1946,24 @@ dependencies = [ [[package]] name = "sync_wrapper" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" +checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" dependencies = [ "futures-core", ] +[[package]] +name = "synstructure" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.89", +] + [[package]] name = "sysinfo" version = "0.32.1" @@ -1821,9 +1980,9 @@ dependencies = [ [[package]] name = "system-configuration" -version = "0.6.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "658bc6ee10a9b4fcf576e9b0819d95ec16f4d2c02d39fd83ac1c8789785c4a42" +checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" dependencies = [ "bitflags", "core-foundation", @@ -1842,9 +2001,9 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.12.0" +version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" +checksum = "28cce251fcbc87fac86a866eeb0d6c2d536fc16d06f184bb61aeae11aa4cee0c" dependencies = [ "cfg-if", "fastrand", @@ -1855,22 +2014,42 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.63" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" dependencies = [ - "thiserror-impl", + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c006c85c7651b3cf2ada4584faa36773bd07bac24acfb39f3c431b36d7e667aa" +dependencies = [ + "thiserror-impl 2.0.3", ] [[package]] name = "thiserror-impl" -version = "1.0.63" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.82", + "syn 2.0.89", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f077553d607adc1caf65430528a576c757a71ed73944b66ebb58ef2bbd243568" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.89", ] [[package]] @@ -1904,6 +2083,16 @@ dependencies = [ "time-core", ] +[[package]] +name = "tinystr" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +dependencies = [ + "displaydoc", + "zerovec", +] + [[package]] name = "tinyvec" version = "1.8.0" @@ -1954,6 +2143,7 @@ dependencies = [ "libc", "mio", "pin-project-lite", + "signal-hook-registry", "socket2", "tokio-macros", "windows-sys 0.52.0", @@ -1967,7 +2157,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.82", + "syn 2.0.89", ] [[package]] @@ -1980,49 +2170,38 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-rustls" -version = "0.25.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "775e0c0f0adb3a2f22a00c4745d728b479985fc15ee7ca6a2608388c5569860f" -dependencies = [ - "rustls 0.22.4", - "rustls-pki-types", - "tokio", -] - [[package]] name = "tokio-rustls" version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" dependencies = [ - "rustls 0.23.12", + "rustls", "rustls-pki-types", "tokio", ] [[package]] name = "tokio-tungstenite" -version = "0.21.0" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c83b561d025642014097b66e6c1bb422783339e0909e4429cde4749d1990bc38" +checksum = "edc5f74e248dc973e0dbb7b74c7e0d6fcc301c694ff50049504004ef4d0cdcd9" dependencies = [ "futures-util", "log", - "rustls 0.22.4", + "rustls", "rustls-pki-types", "tokio", - "tokio-rustls 0.25.0", + "tokio-rustls", "tungstenite", "webpki-roots", ] [[package]] name = "tokio-util" -version = "0.7.11" +version = "0.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" +checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" dependencies = [ "bytes", "futures-core", @@ -2054,9 +2233,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.22.20" +version = "0.22.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "583c44c02ad26b0c3f3066fe629275e50627026c51ac2e595cca4c230ce1ce1d" +checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" dependencies = [ "indexmap", "serde", @@ -2065,32 +2244,11 @@ dependencies = [ "winnow", ] -[[package]] -name = "tower" -version = "0.4.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" -dependencies = [ - "futures-core", - "futures-util", - "pin-project", - "pin-project-lite", - "tokio", - "tower-layer", - "tower-service", -] - -[[package]] -name = "tower-layer" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" - [[package]] name = "tower-service" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" @@ -2106,20 +2264,20 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.27" +version = "0.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.82", + "syn 2.0.89", ] [[package]] name = "tracing-core" -version = "0.1.32" +version = "0.1.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" dependencies = [ "once_cell", ] @@ -2148,7 +2306,7 @@ dependencies = [ "once_cell", "rand", "smallvec", - "thiserror", + "thiserror 1.0.69", "tinyvec", "tokio", "tracing", @@ -2170,7 +2328,7 @@ dependencies = [ "rand", "resolv-conf", "smallvec", - "thiserror", + "thiserror 1.0.69", "tokio", "tracing", "trust-dns-proto", @@ -2184,9 +2342,9 @@ checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "tungstenite" -version = "0.21.0" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ef1a641ea34f399a848dea702823bbecfb4c486f911735368f1f137cb8257e1" +checksum = "18e5b8366ee7a95b16d32197d0b2604b43a0be89dc5fac9f8e96ccafbaedda8a" dependencies = [ "byteorder", "bytes", @@ -2195,10 +2353,10 @@ dependencies = [ "httparse", "log", "rand", - "rustls 0.22.4", + "rustls", "rustls-pki-types", "sha1", - "thiserror", + "thiserror 1.0.69", "url", "utf-8", ] @@ -2217,15 +2375,15 @@ checksum = "0cbc2d8952dd1e08b0164a5b51549e80631ac9da4107669d26c8ea89cb0b5545" dependencies = [ "proc-macro2", "quote", - "syn 2.0.82", + "syn 2.0.89", "to-arraystring", ] [[package]] name = "typesize" -version = "0.1.7" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb704842c709bc76f63e99e704cb208beeccca2abbabd0d9aec02e48ca1cee0f" +checksum = "549e54551d85ba6718a95333d9bc4367f69793d7aba638de30f8d25a1f554a1d" dependencies = [ "chrono", "extract_map", @@ -2240,41 +2398,38 @@ dependencies = [ [[package]] name = "typesize-derive" -version = "0.1.7" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "905e88c2a4cc27686bd57e495121d451f027e441388a67f773be729ad4be1ea8" +checksum = "fd9fc0ad9e03a2b0c2e2a0eafaecccef2121829e1ab6ce9c9d790e6c6766bd1c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.82", + "syn 2.0.89", ] [[package]] name = "unicase" -version = "2.7.0" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" -dependencies = [ - "version_check", -] +checksum = "7e51b68083f157f853b6379db119d1c1be0e6e4dec98101079dec41f6f5cf6df" [[package]] name = "unicode-bidi" -version = "0.3.15" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" +checksum = "5ab17db44d7388991a428b2ee655ce0c212e862eff1768a455c58f9aad6e7893" [[package]] name = "unicode-ident" -version = "1.0.12" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" [[package]] name = "unicode-normalization" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" +checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956" dependencies = [ "tinyvec", ] @@ -2292,18 +2447,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e64b558561f12a171bbea5325c3f24f129db371adee1d7ae93b6e310bd69192" dependencies = [ "libc", - "thiserror", + "thiserror 1.0.69", "windows", ] [[package]] name = "url" -version = "2.5.2" +version = "2.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" +checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" dependencies = [ "form_urlencoded", - "idna 0.5.0", + "idna 1.0.3", "percent-encoding", "serde", ] @@ -2314,6 +2469,18 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" +[[package]] +name = "utf16_iter" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + [[package]] name = "vcpkg" version = "0.2.15" @@ -2343,34 +2510,35 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.92" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" +checksum = "128d1e363af62632b8eb57219c8fd7877144af57558fb2ef0368d0087bddeb2e" dependencies = [ "cfg-if", + "once_cell", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.92" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" +checksum = "cb6dd4d3ca0ddffd1dd1c9c04f94b868c37ff5fac97c30b97cff2d74fce3a358" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.82", + "syn 2.0.89", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.42" +version = "0.4.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" +checksum = "cc7ec4f8827a71586374db3e87abdb5a2bb3a15afed140221307c3ec06b1f63b" dependencies = [ "cfg-if", "js-sys", @@ -2380,9 +2548,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.92" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" +checksum = "e79384be7f8f5a9dd5d7167216f022090cf1f9ec128e6e6a482a2cb5c5422c56" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2390,28 +2558,28 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.92" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" +checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" dependencies = [ "proc-macro2", "quote", - "syn 2.0.82", + "syn 2.0.89", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.92" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" +checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d" [[package]] name = "wasm-streams" -version = "0.4.0" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b65dc4c90b63b118468cf747d8bf3566c1913ef60be765b5730ead9e0a3ba129" +checksum = "15053d8d85c7eccdbefef60f06769760a563c7f0a9d6902a13d35c7800b0ad65" dependencies = [ "futures-util", "js-sys", @@ -2422,9 +2590,19 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.69" +version = "0.3.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" +checksum = "f6488b90108c040df0fe62fa815cbdee25124641df01814dd7282749234c6112" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "web-time" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" dependencies = [ "js-sys", "wasm-bindgen", @@ -2432,9 +2610,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.26.3" +version = "0.26.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd7c23921eeb1713a4e851530e9b9756e4fb0e89978582942612524cf09f01cd" +checksum = "5d642ff16b7e79272ae451b7322067cdc17cadf68c23264be9d94a32319efe7e" dependencies = [ "rustls-pki-types", ] @@ -2506,7 +2684,7 @@ checksum = "9107ddc059d5b6fbfbffdfa7a7fe3e22a226def0b2608f72e9d552763d3e1ad7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.82", + "syn 2.0.89", ] [[package]] @@ -2517,7 +2695,7 @@ checksum = "29bee4b38ea3cde66011baa44dba677c432a78593e202392d1e9070cf2a7fca7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.82", + "syn 2.0.89", ] [[package]] @@ -2709,9 +2887,9 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.6.18" +version = "0.6.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68a9bda4691f099d435ad181000724da8e5899daa10713c2d432552b9ccd3a6f" +checksum = "36c1fec1a2bb5866f07c25f68c26e565c4c200aebb96d7e55710c19d3e8ac49b" dependencies = [ "memchr", ] @@ -2726,6 +2904,42 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "write16" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" + +[[package]] +name = "yoke" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.89", + "synstructure", +] + [[package]] name = "zerocopy" version = "0.7.35" @@ -2744,7 +2958,28 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.82", + "syn 2.0.89", +] + +[[package]] +name = "zerofrom" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.89", + "synstructure", ] [[package]] @@ -2752,3 +2987,25 @@ name = "zeroize" version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" + +[[package]] +name = "zerovec" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.89", +] diff --git a/Cargo.toml b/Cargo.toml index efc5d08..692fe9b 100755 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,7 +16,7 @@ cargo_toml = "0.20.5" poise = "0.6.1" regex = "1.11.0" serde = "1.0.210" -tokio = { version = "1.40.0", features = ["macros", "rt-multi-thread"] } +tokio = { version = "1.40.0", features = ["macros", "signal", "rt-multi-thread"] } reqwest = { version = "0.12.8", features = ["native-tls-vendored"] } [dependencies] diff --git a/events/src/events.rs b/events/src/events.rs index 3a8e35a..da7234d 100755 --- a/events/src/events.rs +++ b/events/src/events.rs @@ -1,25 +1,22 @@ mod ready; mod shards; +use poise::serenity_prelude::FullEvent; use rustbot_lib::{ - RustbotError, - RustbotData -}; -use poise::{ - FrameworkContext, - serenity_prelude::FullEvent + RustbotFwCtx, + RustbotResult }; pub const RUSTBOT_EVENT: &str = "RustbotEvent"; struct EventProcessor<'a> { - framework: FrameworkContext<'a, RustbotData, RustbotError> + framework: RustbotFwCtx<'a> } pub async fn processor( - framework: FrameworkContext<'_, RustbotData, RustbotError>, + framework: RustbotFwCtx<'_>, event: &FullEvent -) -> Result<(), RustbotError> { +) -> RustbotResult<()> { let processor = EventProcessor { framework }; match event { diff --git a/events/src/events/ready.rs b/events/src/events/ready.rs index 2b76801..0acddaf 100755 --- a/events/src/events/ready.rs +++ b/events/src/events/ready.rs @@ -1,11 +1,11 @@ -use crate::PoiseFwCtx; use super::{ EventProcessor, RUSTBOT_EVENT }; use rustbot_lib::{ - RustbotError, + RustbotFwCtx, + RustbotResult, utils::{ BOT_VERSION, GIT_COMMIT_HASH, @@ -15,7 +15,7 @@ use rustbot_lib::{ }; use std::sync::atomic::{ AtomicBool, - Ordering + Ordering::Relaxed }; use poise::serenity_prelude::{ Ready, @@ -29,8 +29,8 @@ static READY_ONCE: AtomicBool = AtomicBool::new(false); async fn ready_once( ready: &Ready, - framework: PoiseFwCtx<'_> -) -> Result<(), RustbotError> { + framework: RustbotFwCtx<'_> +) -> RustbotResult<()> { #[cfg(not(feature = "production"))] { println!("{RUSTBOT_EVENT}[Ready:Notice:S{}]: Detected a non-production environment!", framework.serenity_context.shard_id); @@ -57,8 +57,8 @@ impl EventProcessor<'_> { pub async fn on_ready( &self, data_about_bot: &Ready - ) -> Result<(), RustbotError> { - if !READY_ONCE.swap(true, Ordering::Relaxed) { + ) -> RustbotResult<()> { + if !READY_ONCE.swap(true, Relaxed) { ready_once(data_about_bot, self.framework).await.expect("Failed to call ready_once method"); } diff --git a/events/src/events/shards.rs b/events/src/events/shards.rs index e810b63..9f96a1e 100755 --- a/events/src/events/shards.rs +++ b/events/src/events/shards.rs @@ -4,14 +4,14 @@ use super::{ }; use std::num::NonZero; -use rustbot_lib::RustbotError; +use rustbot_lib::RustbotResult; use poise::serenity_prelude::ShardStageUpdateEvent; impl EventProcessor<'_> { pub async fn on_shards_ready( &self, total_shards: &NonZero - ) -> Result<(), RustbotError> { + ) -> RustbotResult<()> { let shards = if *total_shards == NonZero::new(1).unwrap() { "shard is" } else { "shards are" }; println!("{RUSTBOT_EVENT}[ShardsReady]: {total_shards} {shards} ready!"); @@ -21,7 +21,7 @@ impl EventProcessor<'_> { pub async fn on_shards_stageupdate( &self, event: &ShardStageUpdateEvent - ) -> Result<(), RustbotError> { + ) -> RustbotResult<()> { println!("{RUSTBOT_EVENT}[ShardStageUpdate:S{}]: {event:#?}", event.shard_id); Ok(()) diff --git a/events/src/lib.rs b/events/src/lib.rs index 6635563..6e9aa73 100755 --- a/events/src/lib.rs +++ b/events/src/lib.rs @@ -1,19 +1,10 @@ pub mod events; // use serde_json::json; -use rustbot_lib::{ - RustbotData, - RustbotError -}; -use poise::{ - FrameworkContext, - /* serenity_prelude::{ - Context, - WebhookId - } */ -}; - -type PoiseFwCtx<'a> = FrameworkContext<'a, RustbotData, RustbotError>; +/* use poise::serenity_prelude::{ + Context, + WebhookId +}; */ /* async fn hook_logger( ctx: &Context, diff --git a/library/src/config.rs b/library/src/config.rs index 1508885..e032a17 100755 --- a/library/src/config.rs +++ b/library/src/config.rs @@ -1,7 +1,7 @@ use std::sync::LazyLock; pub struct ConfigMeta { - pub env: String, + pub env: &'static str, pub embed_color: u32, pub rustbot_logs: u64, pub developers: Vec @@ -13,16 +13,16 @@ pub static BINARY_PROPERTIES: LazyLock = LazyLock::new(ConfigMeta::n #[cfg(not(feature = "production"))] pub static BINARY_PROPERTIES: LazyLock = LazyLock::new(|| ConfigMeta::new() - .env(String::from("dev")) + .env("dev") .embed_color(0xf1d63c) ); impl ConfigMeta { fn new() -> Self { Self { - env: String::from("prod"), + env: "prod", embed_color: 0xf1d63c, - rustbot_logs: 1276874302314254448, + rustbot_logs: 1311282815601741844, developers: vec![ 190407856527376384 // toast.ts ] @@ -31,7 +31,7 @@ impl ConfigMeta { // Scalable functions below; #[cfg(not(feature = "production"))] - fn env(mut self, env: String) -> Self { + fn env(mut self, env: &'static str) -> Self { self.env = env; self } diff --git a/library/src/lib.rs b/library/src/lib.rs index ffb3804..46526d5 100755 --- a/library/src/lib.rs +++ b/library/src/lib.rs @@ -3,5 +3,7 @@ mod data; pub use data::RustbotData; pub mod utils; -pub type RustbotError = Box; -pub type RustbotCtx<'a> = poise::Context<'a, RustbotData, RustbotError>; +type RustbotError = Box; +pub type RustbotContext<'a> = poise::Context<'a, RustbotData, RustbotError>; +pub type RustbotFwCtx<'a> = poise::FrameworkContext<'a, RustbotData, RustbotError>; +pub type RustbotResult = Result; diff --git a/library/src/utils.rs b/library/src/utils.rs index e12051a..ec296e1 100755 --- a/library/src/utils.rs +++ b/library/src/utils.rs @@ -21,7 +21,7 @@ pub fn format_timestamp(timestamp: i64) -> String { format!("\n") } -pub fn mention_dev(ctx: super::RustbotCtx<'_>) -> Option { +pub fn mention_dev(ctx: super::RustbotContext<'_>) -> Option { let devs = super::config::BINARY_PROPERTIES.developers.clone(); let app_owners = ctx.framework().options().owners.clone(); @@ -40,7 +40,7 @@ pub fn mention_dev(ctx: super::RustbotCtx<'_>) -> Option { } } -pub fn get_guild_name(ctx: super::RustbotCtx<'_>) -> String { +pub fn get_guild_name(ctx: super::RustbotContext<'_>) -> String { match ctx.guild() { Some(guild) => guild.name.clone().to_string(), None => String::from("DM") @@ -63,7 +63,7 @@ pub fn format_duration(secs: u64) -> String { let formatted_string: Vec = components .iter() .filter(|&&(value, _)| value > 0) - .map(|&(value, suffix)| format!("{}{}", value, suffix)) + .map(|&(value, suffix)| format!("{value}{suffix}")) .collect(); formatted_string.join(", ") diff --git a/src/commands.rs b/src/commands.rs index be2a5fc..dce5848 100755 --- a/src/commands.rs +++ b/src/commands.rs @@ -8,8 +8,6 @@ pub use eightball::eightball; pub use ping::ping; pub use uptime::uptime; -type PoiseContext<'a> = rustbot_lib::RustbotCtx<'a>; - macro_rules! collect { () => { vec![ diff --git a/src/commands/dev.rs b/src/commands/dev.rs index 1682348..99d35f6 100755 --- a/src/commands/dev.rs +++ b/src/commands/dev.rs @@ -1,53 +1,82 @@ -use crate::RustbotError; -use super::PoiseContext; - +use rustbot_lib::{ + RustbotContext, + RustbotResult +}; use poise::{ CreateReply, - serenity_prelude::ChannelId + serenity_prelude::{ + ChannelId, + ShardId, + ShardRunnerInfo + } }; +async fn format_shard_info( + id: &ShardId, + runner: &ShardRunnerInfo, + ctx: &RustbotContext<'_> +) -> String { + let mut string = String::new(); + + let heartbeat = match runner.latency { + Some(lat) => format!("`{}ms`", lat.as_millis()), + None => "Waiting for heartbeat...".to_string() + }; + + let status = runner.stage.to_string(); + let shard_count = ctx.cache().shard_count(); + let guild_count = ctx.cache().guilds().into_iter().filter(|g| g.shard_id(shard_count) == id.0).count() as u64; + + string.push_str(&format!("**Shard {id}**\n")); + string.push_str(&format!("> Heartbeat: {heartbeat}\n")); + string.push_str(&format!("> Status: `{status}`\n")); + string.push_str(&format!("> Guilds: **{guild_count}**")); + + string +} + /// Developer commands #[poise::command( - slash_command, prefix_command, + slash_command, owners_only, + install_context = "Guild|User", + interaction_context = "Guild|BotDm|PrivateChannel", subcommands("deploy", "servers", "shards", "echo") )] -pub async fn dev(_: PoiseContext<'_>) -> Result<(), RustbotError> { +pub async fn dev(_: RustbotContext<'_>) -> RustbotResult<()> { Ok(()) } /// Deploy commands to this guild or globally #[poise::command(prefix_command)] -async fn deploy(ctx: PoiseContext<'_>) -> Result<(), RustbotError> { +async fn deploy(ctx: RustbotContext<'_>) -> RustbotResult<()> { poise::builtins::register_application_commands_buttons(ctx).await?; Ok(()) } /// View how many servers the bot is in -#[poise::command(prefix_command)] -async fn servers(ctx: PoiseContext<'_>) -> Result<(), RustbotError> { +#[poise::command(slash_command)] +async fn servers(ctx: RustbotContext<'_>) -> RustbotResult<()> { poise::builtins::servers(ctx).await?; Ok(()) } /// View the status of available shards -#[poise::command(prefix_command)] -async fn shards(ctx: PoiseContext<'_>) -> Result<(), RustbotError> { +#[poise::command(slash_command)] +async fn shards(ctx: RustbotContext<'_>) -> RustbotResult<()> { let shard_runners = ctx.framework().shard_manager().runners.clone(); let runners = shard_runners.lock().await; + if runners.is_empty() { + ctx.reply("`ShardsReady` event hasn't fired yet!").await?; + return Ok(()) + } + let mut shard_info = Vec::new(); for (id, runner) in runners.iter() { - shard_info.push(format!( - "**Shard {}**\n> Heartbeat: {}\n> Status: `{}`", - id, - match runner.latency { - Some(lat) => format!("`{}ms`", lat.as_millis()), - None => "Waiting for heartbeat...".to_string() - }, - runner.stage - )) + let info = format_shard_info(id, runner, &ctx).await; + shard_info.push(info); } ctx.reply(shard_info.join("\n\n")).await?; @@ -58,11 +87,11 @@ async fn shards(ctx: PoiseContext<'_>) -> Result<(), RustbotError> { /// Turn your message into a bot message #[poise::command(slash_command)] async fn echo( - ctx: super::PoiseContext<'_>, + ctx: RustbotContext<'_>, #[description = "Message to be echoed as a bot"] message: String, #[description = "Channel to send this to"] #[channel_types("Text", "PublicThread", "PrivateThread")] channel: Option -) -> Result<(), RustbotError> { +) -> RustbotResult<()> { ctx.defer_ephemeral().await?; let channel = match channel { diff --git a/src/commands/eightball.rs b/src/commands/eightball.rs index 6847043..e6ead03 100755 --- a/src/commands/eightball.rs +++ b/src/commands/eightball.rs @@ -1,22 +1,32 @@ -use crate::RustbotError; -use super::PoiseContext; - -use rustbot_lib::config::BINARY_PROPERTIES; +use rustbot_lib::{ + RustbotContext, + RustbotResult, + config::BINARY_PROPERTIES +}; use poise::{ serenity_prelude::UserId, builtins::paginate }; +#[derive(poise::ChoiceParameter)] +enum ResponseMode { + Normal, + Chicken +} + /// Ask the Magic 8-Ball a yes/no question and get an unpredictable answer #[poise::command( slash_command, + install_context = "Guild|User", + interaction_context = "Guild|BotDm|PrivateChannel", rename = "8ball" )] pub async fn eightball( - ctx: PoiseContext<'_>, - #[description = "Your yes/no question"] question: String -) -> Result<(), RustbotError> { - if question.to_ascii_lowercase().contains("rustbot, show list") { + ctx: RustbotContext<'_>, + #[description = "Your yes/no question"] question: String, + #[description = "Response modes"] mode: Option +) -> RustbotResult<()> { + if question.to_ascii_lowercase().contains("niko, show list") { if ctx.author().id == UserId::new(BINARY_PROPERTIES.developers[0]) { let chunks: Vec = RESPONSES.chunks(10).map(|chunk| chunk.join("\n\n")).collect(); let pages: Vec<&str> = chunks.iter().map(|s| s.as_str()).collect(); @@ -29,7 +39,7 @@ pub async fn eightball( } } - if question.to_ascii_lowercase().contains("rustbot, show chicken list") { + if question.to_ascii_lowercase().contains("niko, show chicken list") { if ctx.author().id == UserId::new(BINARY_PROPERTIES.developers[0]) { let chunks: Vec = CHICKEN_RESPONSES.chunks(10).map(|chunk| chunk.join("\n\n")).collect(); let pages: Vec<&str> = chunks.iter().map(|s| s.as_str()).collect(); @@ -42,10 +52,9 @@ pub async fn eightball( } } - let rand_resp = if question.to_ascii_lowercase().contains("chicken") { - get_random_chicken_response() - } else { - get_random_response() + let rand_resp = match mode { + Some(ResponseMode::Chicken) => get_random_chicken_response(), + _ => get_random_response() }; ctx.reply(format!("> {question}\n{rand_resp}")).await?; @@ -53,7 +62,7 @@ pub async fn eightball( Ok(()) } -const RESPONSES: [&str; 30] = [ +const RESPONSES: [&str; 45] = [ "Reply hazy. Look it up on Google.", // no "Meh — Figure it out yourself.", // no "I don't know, what do you think?", // no @@ -88,9 +97,24 @@ const RESPONSES: [&str; 30] = [ "Sure, but with extreme cautions.", // yes "What kind of stupid question is that?? No! I'm not answering that!", // no "Try asking this to a chicken. Probably knows it better than I do!", // no + "Not in a million years!", // no + "As a matter of fact, yes.", // yes + "It's a no, better go ask someone else.", // no + "In the end, it's not a bad choice.", // yes + "Nope, not today.", // no + "Cross your fingers, the answer is yes!", // yes + "Nope. *shakes head*", // no + "The fortune cookie said yes.", // yes + "Sorry, the fortune cookie over there said no.", // no + "Sorry, not happening.", // no + "I'll have to consult my sources... *flips coin*... no.", // no + "I'll have to consult the magic 8-ball... *shakes*... no.", // no + "I'm not sure to be honest, let's ask your friend. Oh wait...", // no + "This question flew over my head, I'll pass.", // no + "Oops, the Magic 8-Ball shattered itself when you asked that! I'll take that as a no.", // no ]; -const CHICKEN_RESPONSES: [&str; 35] = [ +const CHICKEN_RESPONSES: [&str; 54] = [ "Cluck cluck... Reply hazy, try pecking Google.", // no "Meh... Figure it out yourself, or scratch around a bit.", // no "I don't know... what do you think? *pecks at ground*", // no @@ -126,6 +150,25 @@ const CHICKEN_RESPONSES: [&str; 35] = [ "Yes! *lays egg of approval*", // yes "It's a no, better go scratch somewhere else.", // no "Cluck-tastic! That's a definite yes.", // yes + "Cluck yeah! *struts proudly*", // yes + "Nope, not today. *shakes head*", // no + "Feathers crossed, the answer is yes!", // yes + "Chicken says nope. *tilts head*", // no + "Absolutely! *clucks happily*", // yes + "Not a chance. *fluffs feathers*", // no + "Eggcellent choice! Yes!", // yes + "Not in a million clucks!", // no + "As a matter of cluck, yes! *clucks approvingly*", // yes + "It's a nopity nope, better go ask another chicken.", // no + "In the end, it's not a bad cluck", // yes + "Nope, not today. *clucks sadly*", // no + "Cross your feathers, the answer is yes!", // yes + "The fortune cookie said yes. *clucks in agreement*", // yes + "Sorry, the fortune cookie over there said no. *clucks in disagreement*", // no + "I'll have to consult my sources... *flips corn*... no.", // no + "I'll have to consult the magic 8-cluck... *shakes*... no.", // no + "I'm not sure to be honest, let's ask your chicken friend. Oh wait...", // no + "This question floated over my head, I'll pass. *clucks dismissively*", // no ]; fn get_random_response() -> &'static str { diff --git a/src/commands/ping.rs b/src/commands/ping.rs index 79acc99..2cef423 100755 --- a/src/commands/ping.rs +++ b/src/commands/ping.rs @@ -1,7 +1,8 @@ -use crate::RustbotError; -use super::PoiseContext; - use serde::Deserialize; +use rustbot_lib::{ + RustbotContext, + RustbotResult +}; #[derive(Deserialize)] struct StatusPage { @@ -18,17 +19,22 @@ struct Summary { mean: f64 } -/// Check latency of the bot's WS connection and Discord's API -#[poise::command(slash_command)] -pub async fn ping(ctx: PoiseContext<'_>) -> Result<(), RustbotError> { +/// Check latency between bot and WebSocket as well as Discord's API latency +#[poise::command( + slash_command, + install_context = "Guild|User", + interaction_context = "Guild|BotDm|PrivateChannel" +)] +pub async fn ping(ctx: RustbotContext<'_>) -> RustbotResult<()> { let statuspage: StatusPage = reqwest::get("https://discordstatus.com/metrics-display/5k2rt9f7pmny/day.json") - .await.unwrap() - .json() - .await.unwrap(); + .await.unwrap() + .json() + .await.unwrap(); let mut latencies = Vec::new(); latencies.push(format!("Discord: `{:.0?}ms`", statuspage.metrics[0].summary.mean)); latencies.push(format!("WebSocket: `{:.0?}`", ctx.ping().await)); + latencies.push(format!("Shard ID: `{}`", ctx.serenity_context().shard_id)); ctx.reply(latencies.join("\n")).await?; diff --git a/src/commands/uptime.rs b/src/commands/uptime.rs index bdee9d4..ec351a3 100755 --- a/src/commands/uptime.rs +++ b/src/commands/uptime.rs @@ -1,6 +1,3 @@ -use crate::RustbotError; -use super::PoiseContext; - use sysinfo::System; use uptime_lib::get; use std::{ @@ -17,11 +14,15 @@ use std::{ BufReader } }; -use rustbot_lib::utils::{ - BOT_VERSION, - GIT_COMMIT_HASH, - GIT_COMMIT_BRANCH, - format_duration +use rustbot_lib::{ + RustbotContext, + RustbotResult, + utils::{ + BOT_VERSION, + GIT_COMMIT_HASH, + GIT_COMMIT_BRANCH, + format_duration + } }; fn get_os_info() -> String { @@ -63,7 +64,7 @@ fn fmt_mem(bytes: u64) -> String { /// Retrieve host and bot uptimes #[poise::command(slash_command)] -pub async fn uptime(ctx: PoiseContext<'_>) -> Result<(), RustbotError> { +pub async fn uptime(ctx: RustbotContext<'_>) -> RustbotResult<()> { let bot = ctx.http().get_current_user().await.unwrap(); let mut sys = System::new_all(); sys.refresh_all(); diff --git a/src/main.rs b/src/main.rs index 5e89589..52e5a9d 100755 --- a/src/main.rs +++ b/src/main.rs @@ -1,8 +1,9 @@ mod commands; +mod shutdown; // https://cdn.toast-server.net/RustFSHiearchy.png // Using the new filesystem hierarchy -use rustbot_tokens::token_path; +use rustbot_tokens::discord_token; use poise::serenity_prelude::{ builder::CreateAllowedMentions, ClientBuilder, @@ -14,7 +15,6 @@ use rustbot_lib::{ mention_dev, get_guild_name }, - RustbotError, RustbotData, config::BINARY_PROPERTIES }; @@ -47,20 +47,19 @@ async fn main() { }; println!( - "Discord[{}:S{}]: {} ran {}{} {}", + "Discord[{}:S{}]: {} ran {prefix}{} {get_guild_channel_name}", get_guild_name(ctx), ctx.serenity_context().shard_id, ctx.author().name, - prefix, ctx.command().qualified_name, - get_guild_channel_name); + ); }), prefix_options: poise::PrefixFrameworkOptions { prefix, - case_insensitive_commands: true, ignore_bots: true, - execute_self_messages: false, mention_as_prefix: false, + case_insensitive_commands: true, + execute_self_messages: false, ..Default::default() }, on_error: |error| Box::pin(async move { @@ -118,7 +117,7 @@ async fn main() { .build(); let mut client = ClientBuilder::new( - &token_path().await.main, + discord_token().await, GatewayIntents::GUILDS | GatewayIntents::GUILD_MESSAGES | GatewayIntents::MESSAGE_CONTENT @@ -128,7 +127,14 @@ async fn main() { .activity(ActivityData::custom("nep nep!")) .await.expect("Error creating client"); + let shard_manager = client.shard_manager.clone(); + + tokio::spawn(async move { + shutdown::gracefully_shutdown().await; + shard_manager.shutdown_all().await; + }); + if let Err(why) = client.start_autosharded().await { - println!("Error starting client: {:#?}", why); + println!("Error starting client: {why:#?}"); } } diff --git a/src/shutdown.rs b/src/shutdown.rs new file mode 100644 index 0000000..261a97d --- /dev/null +++ b/src/shutdown.rs @@ -0,0 +1,23 @@ +use tokio::{ + select, + signal::unix::{ + signal, + SignalKind + } +}; + +pub async fn gracefully_shutdown() { + let [mut s1, mut s2, mut s3] = [ + signal(SignalKind::interrupt()).unwrap(), + signal(SignalKind::terminate()).unwrap(), + signal(SignalKind::hangup()).unwrap() + ]; + + select!( + v = s1.recv() => v.unwrap(), + v = s2.recv() => v.unwrap(), + v = s3.recv() => v.unwrap() + ); + + println!("\nRustbot says goodbye! 👋"); +} diff --git a/stuff-to-change.log b/stuff-to-change.log index f648eda..29e60ea 100644 --- a/stuff-to-change.log +++ b/stuff-to-change.log @@ -6,6 +6,6 @@ Only things that are needing to be changed before deploying this template to rea - library (rustbot_lib), and its references - tsclient (rustbot_tokens), and its references -Search by Rustbot in its usual form (all-caps, pascalcase, and such) to find all the references that need to be changed too. +Search by Rustbot in its usual form (ALL-CAPS, PascalCase, and such) to find all the references that need to be changed too. (and delete this file too!) diff --git a/tsclient/Cargo.toml b/tsclient/Cargo.toml index e64270b..e9d052d 100755 --- a/tsclient/Cargo.toml +++ b/tsclient/Cargo.toml @@ -4,5 +4,6 @@ version = "0.1.0" edition = "2021" [dependencies] +poise = { workspace = true } tokenservice-client = { version = "0.4.1", registry = "gitea" } tokio = { workspace = true } diff --git a/tsclient/src/lib.rs b/tsclient/src/lib.rs index 04bd9c2..efc62a5 100755 --- a/tsclient/src/lib.rs +++ b/tsclient/src/lib.rs @@ -1,5 +1,9 @@ -use std::sync::LazyLock; +use poise::serenity_prelude::Token; use tokio::sync::Mutex; +use std::{ + str::FromStr, + sync::LazyLock +}; use tokenservice_client::{ TokenService, TokenServiceApi @@ -33,3 +37,8 @@ static TSCLIENT: LazyLock> = LazyLock::new(|| Mutex::new(TSClien pub async fn token_path() -> TokenServiceApi { TSCLIENT.lock().await.get().await.unwrap() } + +pub async fn discord_token() -> Token { + Token::from_str(&token_path().await.main) + .expect("Serenity couldn't parse the bot token!") +}