Fixing a problem with the return type of interaction_create #1

Merged
moonleay merged 2 commits from migueldamota/Rustendo:fix/add-missing-await into master 2024-02-23 18:30:10 +00:00
Showing only changes of commit 1fd1bc893c - Show all commits

View file

@ -1,12 +1,14 @@
mod commands;
mod util;
mod handler;
mod util;
use std::thread::current;
use chrono::Local;
use serenity::all::{CommandInteraction, OnlineStatus};
use serenity::async_trait;
use serenity::builder::{CreateEmbed, CreateEmbedAuthor, CreateEmbedFooter, CreateInteractionResponse, CreateInteractionResponseMessage};
use serenity::builder::{
CreateEmbed, CreateEmbedAuthor, CreateEmbedFooter, CreateInteractionResponse,
CreateInteractionResponseMessage,
};
use serenity::gateway::ActivityData;
use serenity::model::application::{Command, Interaction};
use serenity::model::gateway::Ready;
@ -18,18 +20,9 @@ use util::config;
// The voice client can be retrieved in any command using `songbird::get(ctx).await`.
use songbird::SerenityInit;
// Event related imports to detect track creation failures.
use songbird::events::{Event, EventContext, EventHandler as VoiceEventHandler, TrackEvent};
// To turn user URLs into playable audio, we'll use yt-dlp.
use songbird::input::YoutubeDl;
// YtDl requests need an HTTP client to operate -- we'll create and store our own.
use reqwest::Client as HttpClient;
// Import the `Context` to handle commands.
use serenity::client::Context;
struct HttpKey;
impl TypeMapKey for HttpKey {
type Value = HttpClient;
@ -80,15 +73,20 @@ pub async fn respond_with_error(_ctx: &Context, command: &CommandInteraction) ->
.footer(CreateEmbedFooter::new(format!(
"> {} | {}",
current_time, username
)))
}
#[tokio::main]
async fn main() {
println!(
r"__________ __ .___
\______ \__ __ _______/ |_ ____ ____ __| _/____
| _/ | | ___/\ __\_/ __ \ / \ / __ |/ _ \
| | \ | |___ \ | | \ ___/ | | | /_/ ( <_> )
|____|_ /____/____ > |__| \___ >|___| |____ |\____/
\/ \/ \/ \/ \/
");
|____|_ /____/____ > |__| \___ >|___| |____ |\____/
\/ \/ \/ \/ \/
"
);
// Load config
let config = config::load().unwrap();