style(commands): changing all_commands to import
This commit is contained in:
parent
3039eb1592
commit
0a6a42159d
2 changed files with 2 additions and 3 deletions
|
|
@ -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)())
|
||||||
|
|
|
||||||
|
|
@ -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)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue