Skip to content

Commit

Permalink
chore: apply formatting fixes to fix lint failures.
Browse files Browse the repository at this point in the history
  • Loading branch information
evieluvsrainbows committed Jul 19, 2024
1 parent f7bc928 commit b1bd797
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 21 deletions.
4 changes: 2 additions & 2 deletions src/commands/fun/xkcd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ struct XkcdComic {
num: u16, // the numeric ID of the xkcd comic.
alt: String, // the caption of the xkcd comic.
img: String, // the image URL of the xkcd comic.
title: String, // the title of the xkcd comic.
title: String // the title of the xkcd comic.
}

/// Retrieves the latest or a specific comic from xkcd.
#[command(slash_command)]
pub async fn xkcd(ctx: Context<'_>, #[description = "The specific comic no. to retrieve."] number: Option<u16>) -> Result<(), Error> {
let comic = match number {
None => "https://xkcd.com/info.0.json".to_string(),
Some(number) => format!("https://xkcd.com/{number}/info.0.json").to_string(),
Some(number) => format!("https://xkcd.com/{number}/info.0.json").to_string()
};

let client = ctx.serenity_context().data.read().await.get::<ReqwestContainer>().cloned().unwrap();
Expand Down
32 changes: 16 additions & 16 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct ConfigurationData {
pub bot: BotConfig,
pub api: ApiConfig,
pub api: ApiConfig
}

#[derive(Debug, Clone, Deserialize, Serialize)]
Expand All @@ -12,87 +12,87 @@ pub struct BotConfig {
pub database: DatabaseConfig,
pub discord: DiscordConfig,
pub denylist: DenylistConfig,
pub logging: LoggingConfig,
pub logging: LoggingConfig
}

#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct GeneralConfig {
pub codename: String,
pub prefix: String,
pub prefix: String
}

#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct LoggingConfig {
pub enabled: bool,
pub level: String,
pub level: String
}

#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct DatabaseConfig {
pub url: String,
pub url: String
}

#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct DiscordConfig {
pub appid: u64,
pub token: String,
pub token: String
}

#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct DenylistConfig {
pub spotify: DenylistSpotifyConfig,
pub spotify: DenylistSpotifyConfig
}

#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct DenylistSpotifyConfig {
pub ids: Vec<u64>,
pub ids: Vec<u64>
}

#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct ApiConfig {
pub entertainment: EntertainmentConfig,
pub minecraft: MinecraftConfig,
pub music: MusicConfig,
pub services: ServicesConfig,
pub services: ServicesConfig
}

#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct EntertainmentConfig {
pub tmdb: String,
pub tmdb: String
}

#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct MinecraftConfig {
pub hypixel: String,
pub hypixel: String
}

#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct MusicConfig {
pub spotify: SpotifyConfig,
pub lastfm: LastFmConfig,
pub lavalink: LavalinkConfig,
pub lavalink: LavalinkConfig
}

#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct ServicesConfig {
pub github: String,
pub google: String,
pub google: String
}

#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct SpotifyConfig {
pub client_id: String,
pub client_secret: String,
pub client_secret: String
}

#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct LastFmConfig {
pub api_key: String,
pub api_key: String
}

#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct LavalinkConfig {
pub host: String,
pub port: u16,
pub password: String,
pub password: String
}
2 changes: 1 addition & 1 deletion src/listeners/handler.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use serenity::{
all::{ActivityData, Context, EventHandler, OnlineStatus, Ready},
async_trait,
async_trait
};
use tracing::info;

Expand Down
4 changes: 2 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ async fn main() -> Result<(), Error> {
"warn" => Level::WARN,
"info" => Level::INFO,
"debug" => Level::DEBUG,
_ => Level::TRACE,
_ => Level::TRACE
};

let subscriber = FmtSubscriber::builder()
Expand All @@ -55,7 +55,7 @@ async fn main() -> Result<(), Error> {
commands::fun::xkcd::xkcd(),
commands::utilities::hello(),
commands::utilities::help(),
commands::utilities::source()
commands::utilities::source(),
],
..Default::default()
})
Expand Down

0 comments on commit b1bd797

Please sign in to comment.