style(commands): changing all_commands to import

This commit is contained in:
Raphael 2026-02-12 19:51:25 +01:00
parent 3039eb1592
commit 0a6a42159d
No known key found for this signature in database
2 changed files with 2 additions and 3 deletions

View file

@ -19,7 +19,7 @@ pub struct CommandEntry {
inventory::collect!(CommandEntry); inventory::collect!(CommandEntry);
pub fn all_commands() -> Vec<Box<dyn SlashCommand>> { pub fn import() -> Vec<Box<dyn SlashCommand>> {
inventory::iter::<CommandEntry> inventory::iter::<CommandEntry>
.into_iter() .into_iter()
.map(|entry| (entry.create)()) .map(|entry| (entry.create)())

View file

@ -1,7 +1,6 @@
mod commands; mod commands;
mod events; mod events;
use commands::all_commands;
use events::Bot; use events::Bot;
use serenity::all::*; use serenity::all::*;
use std::env; use std::env;
@ -16,7 +15,7 @@ async fn main() {
let intents: GatewayIntents = GatewayIntents::empty(); let intents: GatewayIntents = GatewayIntents::empty();
let bot: Bot = Bot { let bot: Bot = Bot {
commands: all_commands(), commands: commands::import(),
}; };
let mut client: Client = Client::builder(&token, intents) let mut client: Client = Client::builder(&token, intents)