The world's most clever kitty cat
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

We don't need cache I think

Ben C 61a9d110 a30d0c4a

+9 -96
+9 -85
Cargo.lock
··· 96 96 97 97 [[package]] 98 98 name = "aws-lc-rs" 99 - version = "1.16.0" 99 + version = "1.16.1" 100 100 source = "registry+https://github.com/rust-lang/crates.io-index" 101 - checksum = "d9a7b350e3bb1767102698302bc37256cbd48422809984b98d292c40e2579aa9" 101 + checksum = "94bffc006df10ac2a68c83692d734a465f8ee6c5b384d8545a636f81d858f4bf" 102 102 dependencies = [ 103 103 "aws-lc-sys", 104 104 "zeroize", ··· 106 106 107 107 [[package]] 108 108 name = "aws-lc-sys" 109 - version = "0.37.1" 109 + version = "0.38.0" 110 110 source = "registry+https://github.com/rust-lang/crates.io-index" 111 - checksum = "b092fe214090261288111db7a2b2c2118e5a7f30dc2569f1732c4069a6840549" 111 + checksum = "4321e568ed89bb5a7d291a7f37997c2c0df89809d7b6d12062c81ddb54aa782e" 112 112 dependencies = [ 113 113 "cc", 114 114 "cmake", ··· 135 135 "rustls", 136 136 "serde", 137 137 "tokio", 138 - "twilight-cache-inmemory", 139 138 "twilight-gateway", 140 139 "twilight-http", 141 140 "twilight-interactions", ··· 262 261 checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" 263 262 264 263 [[package]] 265 - name = "crossbeam-utils" 266 - version = "0.8.21" 267 - source = "registry+https://github.com/rust-lang/crates.io-index" 268 - checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" 269 - 270 - [[package]] 271 - name = "dashmap" 272 - version = "6.1.0" 273 - source = "registry+https://github.com/rust-lang/crates.io-index" 274 - checksum = "5041cc499144891f3790297212f32a74fb938e5136a14943f338ef9e0ae276cf" 275 - dependencies = [ 276 - "cfg-if", 277 - "crossbeam-utils", 278 - "hashbrown 0.14.5", 279 - "lock_api", 280 - "once_cell", 281 - "parking_lot_core", 282 - ] 283 - 284 - [[package]] 285 264 name = "deranged" 286 265 version = "0.5.8" 287 266 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 332 311 checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" 333 312 dependencies = [ 334 313 "libc", 335 - "windows-sys 0.52.0", 314 + "windows-sys 0.61.2", 336 315 ] 337 316 338 317 [[package]] ··· 441 420 442 421 [[package]] 443 422 name = "hashbrown" 444 - version = "0.14.5" 445 - source = "registry+https://github.com/rust-lang/crates.io-index" 446 - checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" 447 - 448 - [[package]] 449 - name = "hashbrown" 450 423 version = "0.16.1" 451 424 source = "registry+https://github.com/rust-lang/crates.io-index" 452 425 checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" ··· 556 529 checksum = "7714e70437a7dc3ac8eb7e6f8df75fd8eb422675fc7678aff7364301092b1017" 557 530 dependencies = [ 558 531 "equivalent", 559 - "hashbrown 0.16.1", 532 + "hashbrown", 560 533 ] 561 534 562 535 [[package]] ··· 634 607 checksum = "b5b646652bf6661599e1da8901b3b9522896f01e736bad5f723fe7a3a27f899d" 635 608 636 609 [[package]] 637 - name = "lock_api" 638 - version = "0.4.14" 639 - source = "registry+https://github.com/rust-lang/crates.io-index" 640 - checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965" 641 - dependencies = [ 642 - "scopeguard", 643 - ] 644 - 645 - [[package]] 646 610 name = "log" 647 611 version = "0.4.29" 648 612 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 682 646 683 647 [[package]] 684 648 name = "once_cell" 685 - version = "1.21.3" 649 + version = "1.21.4" 686 650 source = "registry+https://github.com/rust-lang/crates.io-index" 687 - checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" 651 + checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" 688 652 689 653 [[package]] 690 654 name = "once_cell_polyfill" ··· 708 672 ] 709 673 710 674 [[package]] 711 - name = "parking_lot_core" 712 - version = "0.9.12" 713 - source = "registry+https://github.com/rust-lang/crates.io-index" 714 - checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" 715 - dependencies = [ 716 - "cfg-if", 717 - "libc", 718 - "redox_syscall", 719 - "smallvec", 720 - "windows-link", 721 - ] 722 - 723 - [[package]] 724 675 name = "percent-encoding" 725 676 version = "2.3.2" 726 677 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 790 741 checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" 791 742 792 743 [[package]] 793 - name = "redox_syscall" 794 - version = "0.5.18" 795 - source = "registry+https://github.com/rust-lang/crates.io-index" 796 - checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" 797 - dependencies = [ 798 - "bitflags", 799 - ] 800 - 801 - [[package]] 802 744 name = "regex" 803 745 version = "1.12.3" 804 746 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 952 894 dependencies = [ 953 895 "windows-sys 0.61.2", 954 896 ] 955 - 956 - [[package]] 957 - name = "scopeguard" 958 - version = "1.2.0" 959 - source = "registry+https://github.com/rust-lang/crates.io-index" 960 - checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" 961 897 962 898 [[package]] 963 899 name = "security-framework" ··· 1280 1216 checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" 1281 1217 1282 1218 [[package]] 1283 - name = "twilight-cache-inmemory" 1284 - version = "0.17.1" 1285 - source = "registry+https://github.com/rust-lang/crates.io-index" 1286 - checksum = "3d205ec8d1fc62db874cc7af787cc5919a6d8513974159de950764917c563f30" 1287 - dependencies = [ 1288 - "bitflags", 1289 - "dashmap", 1290 - "serde", 1291 - "twilight-model", 1292 - ] 1293 - 1294 - [[package]] 1295 1219 name = "twilight-gateway" 1296 1220 version = "0.17.1" 1297 1221 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 1352 1276 source = "registry+https://github.com/rust-lang/crates.io-index" 1353 1277 checksum = "0515b0c30814068a7540fcb5f58b634259ca453fa335d42c3b2c8f2b06ac6a59" 1354 1278 dependencies = [ 1355 - "hashbrown 0.16.1", 1279 + "hashbrown", 1356 1280 "tokio", 1357 1281 "tokio-util", 1358 1282 "tracing",
-1
Cargo.toml
··· 18 18 "fs", 19 19 "signal", 20 20 ] } 21 - twilight-cache-inmemory = "0.17.1" 22 21 twilight-gateway = "0.17.1" 23 22 twilight-http = "0.17.1" 24 23 twilight-interactions = "0.17.0"
-10
src/main.rs
··· 27 27 sync::Mutex, 28 28 time::{self, Duration}, 29 29 }; 30 - use twilight_cache_inmemory::{DefaultInMemoryCache, ResourceType}; 31 30 use twilight_gateway::{ 32 31 CloseFrame, Event, EventTypeFlags, Intents, MessageSender, Shard, ShardId, StreamExt, 33 32 }; ··· 131 130 // Init 132 131 let mut shard = Shard::new(ShardId::ONE, token.to_string(), intents); 133 132 let http = HttpClient::new(token.to_string()); 134 - let cache = DefaultInMemoryCache::builder() 135 - .resource_types( 136 - ResourceType::MESSAGE 137 - | ResourceType::USER 138 - | ResourceType::CHANNEL 139 - | ResourceType::USER_CURRENT, 140 - ) 141 - .build(); 142 133 143 134 let self_id = http 144 135 .current_user_application() ··· 198 189 opt = shard.next_event(EventTypeFlags::all()) => { 199 190 match opt { 200 191 Some(Ok(event)) => { 201 - cache.update(&event); 202 192 let ctx = context.clone(); 203 193 tokio::spawn(async move { 204 194 if let Err(why) = handle_discord_event(event, ctx).await {