feat: embed building
This commit is contained in:
12
src/main.rs
12
src/main.rs
@@ -1,10 +1,13 @@
|
||||
use log::LevelFilter;
|
||||
use poise::serenity_prelude as serenity;
|
||||
use simple_logger::SimpleLogger;
|
||||
|
||||
pub struct Data {} // User data, which is stored and accessible in all command invocations
|
||||
type Error = Box<dyn std::error::Error + Send + Sync>;
|
||||
type Context<'a> = poise::Context<'a, Data, Error>;
|
||||
|
||||
pub mod event_handlers;
|
||||
pub mod apis;
|
||||
|
||||
/// Ping command with latency measurement
|
||||
#[poise::command(slash_command, prefix_command)]
|
||||
@@ -18,6 +21,11 @@ async fn ping(ctx: Context<'_>) -> Result<(), Error> {
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() {
|
||||
SimpleLogger::new()
|
||||
.with_level(LevelFilter::Off)
|
||||
.with_module_level("sauce_connoisseur", LevelFilter::Info)
|
||||
.init()
|
||||
.unwrap();
|
||||
let token = std::env::var("DISCORD_TOKEN").expect("missing DISCORD_TOKEN");
|
||||
let intents =
|
||||
serenity::GatewayIntents::non_privileged().union(serenity::GatewayIntents::MESSAGE_CONTENT);
|
||||
@@ -30,7 +38,9 @@ async fn main() {
|
||||
},
|
||||
commands: vec![ping()],
|
||||
event_handler: |ctx, event, framework, data| {
|
||||
Box::pin(event_handlers::sc_event_handler(ctx, event, framework, data))
|
||||
Box::pin(event_handlers::sc_event_handler(
|
||||
ctx, event, framework, data,
|
||||
))
|
||||
},
|
||||
..Default::default()
|
||||
})
|
||||
|
Reference in New Issue
Block a user