summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/api/guzzle.rs2
-rw-r--r--src/api/shiggy.rs2
-rw-r--r--src/commands/general/ask.rs2
-rw-r--r--src/commands/general/bing.rs2
-rw-r--r--src/commands/general/config.rs4
-rw-r--r--src/commands/general/convert.rs2
-rw-r--r--src/commands/general/mod.rs2
-rw-r--r--src/commands/general/random.rs2
-rw-r--r--src/commands/general/version.rs2
-rw-r--r--src/commands/mod.rs2
-rw-r--r--src/commands/moderation/clear.rs2
-rw-r--r--src/commands/moderation/mod.rs2
-rw-r--r--src/commands/optional/copypasta.rs6
-rw-r--r--src/commands/optional/mod.rs2
-rw-r--r--src/commands/optional/teawiespam.rs2
-rw-r--r--src/commands/optional/uwurandom.rs2
-rw-r--r--src/handlers/error.rs2
-rw-r--r--src/handlers/event/guild.rs2
-rw-r--r--src/handlers/event/message.rs2
-rw-r--r--src/handlers/event/mod.rs2
-rw-r--r--src/handlers/event/pinboard.rs10
-rw-r--r--src/handlers/event/reactboard.rs4
-rw-r--r--src/main.rs10
-rw-r--r--src/storage/mod.rs2
24 files changed, 36 insertions, 36 deletions
diff --git a/src/api/guzzle.rs b/src/api/guzzle.rs
index 9365151..437dbe6 100644
--- a/src/api/guzzle.rs
+++ b/src/api/guzzle.rs
@@ -1,6 +1,6 @@
use crate::api::REQWEST_CLIENT;
-use color_eyre::eyre::{eyre, Result};
+use eyre::{eyre, Result};
use log::debug;
use reqwest::StatusCode;
use serde::{Deserialize, Serialize};
diff --git a/src/api/shiggy.rs b/src/api/shiggy.rs
index d69f32b..b1d4a87 100644
--- a/src/api/shiggy.rs
+++ b/src/api/shiggy.rs
@@ -1,6 +1,6 @@
use crate::api::REQWEST_CLIENT;
-use color_eyre::eyre::{eyre, Result};
+use eyre::{eyre, Result};
use log::debug;
use reqwest::StatusCode;
use serde::Deserialize;
diff --git a/src/commands/general/ask.rs b/src/commands/general/ask.rs
index 7775fb7..75560e0 100644
--- a/src/commands/general/ask.rs
+++ b/src/commands/general/ask.rs
@@ -1,6 +1,6 @@
use crate::{consts, utils, Context};
-use color_eyre::eyre::{Context as _, Result};
+use eyre::{Context as _, Result};
/// Ask teawie a question!
#[poise::command(prefix_command, slash_command)]
diff --git a/src/commands/general/bing.rs b/src/commands/general/bing.rs
index 93c630b..d55d8ee 100644
--- a/src/commands/general/bing.rs
+++ b/src/commands/general/bing.rs
@@ -1,6 +1,6 @@
use crate::Context;
-use color_eyre::eyre::Result;
+use eyre::Result;
/// Make sure the wie is alive
#[poise::command(prefix_command)]
diff --git a/src/commands/general/config.rs b/src/commands/general/config.rs
index b60683b..ddc5cda 100644
--- a/src/commands/general/config.rs
+++ b/src/commands/general/config.rs
@@ -3,7 +3,7 @@ use std::str::FromStr;
use crate::{storage, Context};
use storage::{Properties, Settings};
-use color_eyre::eyre::{eyre, Result};
+use eyre::{OptionExt as _, Result};
use log::debug;
use poise::serenity_prelude::{CreateEmbed, GuildChannel, ReactionType};
use poise::{ChoiceParameter, CreateReply};
@@ -148,7 +148,7 @@ pub async fn get(
) -> Result<()> {
let gid = &ctx
.guild_id()
- .ok_or_else(|| eyre!("Failed to get GuildId from context!"))?;
+ .ok_or_eyre("Failed to get GuildId from context!")?;
let settings = ctx.data().storage.get_guild_settings(gid).await?;
let value = prop_to_val(&setting, &settings);
diff --git a/src/commands/general/convert.rs b/src/commands/general/convert.rs
index 1dd7f60..5e14175 100644
--- a/src/commands/general/convert.rs
+++ b/src/commands/general/convert.rs
@@ -1,7 +1,7 @@
use crate::Context;
use bottomify::bottom;
-use color_eyre::eyre::Result;
+use eyre::Result;
use poise::serenity_prelude::constants::MESSAGE_CODE_LIMIT;
#[allow(clippy::unused_async)]
diff --git a/src/commands/general/mod.rs b/src/commands/general/mod.rs
index 1031d5b..c872272 100644
--- a/src/commands/general/mod.rs
+++ b/src/commands/general/mod.rs
@@ -1,6 +1,6 @@
use crate::Data;
-use color_eyre::eyre::Report;
+use eyre::Report;
use poise::Command;
mod ask;
diff --git a/src/commands/general/random.rs b/src/commands/general/random.rs
index 477001e..7c7ceff 100644
--- a/src/commands/general/random.rs
+++ b/src/commands/general/random.rs
@@ -1,6 +1,6 @@
use crate::{api, consts, utils, Context};
-use color_eyre::eyre::Result;
+use eyre::Result;
#[allow(clippy::unused_async)]
#[poise::command(slash_command, subcommands("lore", "teawie", "shiggy"))]
diff --git a/src/commands/general/version.rs b/src/commands/general/version.rs
index 202607c..e392903 100644
--- a/src/commands/general/version.rs
+++ b/src/commands/general/version.rs
@@ -1,7 +1,7 @@
use crate::colors::Colors;
use crate::Context;
-use color_eyre::eyre::Result;
+use eyre::Result;
use poise::serenity_prelude::CreateEmbed;
use poise::CreateReply;
diff --git a/src/commands/mod.rs b/src/commands/mod.rs
index db661e6..88a47b3 100644
--- a/src/commands/mod.rs
+++ b/src/commands/mod.rs
@@ -1,6 +1,6 @@
use crate::Data;
-use color_eyre::eyre::Report;
+use eyre::Report;
use poise::Command;
mod general;
diff --git a/src/commands/moderation/clear.rs b/src/commands/moderation/clear.rs
index 677dc14..bfc9c38 100644
--- a/src/commands/moderation/clear.rs
+++ b/src/commands/moderation/clear.rs
@@ -1,6 +1,6 @@
use crate::Context;
-use color_eyre::eyre::{Context as _, Result};
+use eyre::{Context as _, Result};
use log::debug;
use poise::serenity_prelude::futures::{StreamExt, TryStreamExt};
diff --git a/src/commands/moderation/mod.rs b/src/commands/moderation/mod.rs
index 218ad16..5a8cd08 100644
--- a/src/commands/moderation/mod.rs
+++ b/src/commands/moderation/mod.rs
@@ -1,6 +1,6 @@
use crate::Data;
-use color_eyre::eyre::Report;
+use eyre::Report;
use poise::Command;
mod clear;
diff --git a/src/commands/optional/copypasta.rs b/src/commands/optional/copypasta.rs
index b7e7365..15171f8 100644
--- a/src/commands/optional/copypasta.rs
+++ b/src/commands/optional/copypasta.rs
@@ -2,7 +2,7 @@ use crate::Context;
use std::collections::HashMap;
-use color_eyre::eyre::{eyre, Result};
+use eyre::{eyre, OptionExt, Result};
use include_dir::{include_dir, Dir};
use log::debug;
@@ -43,11 +43,11 @@ fn get_copypasta(name: &Copypastas) -> Result<String> {
.file_stem()
.ok_or_else(|| eyre!("Couldn't get file stem from {file:#?}"))?
.to_str()
- .ok_or_else(|| eyre!("Couldn't convert file stem to str!"))?;
+ .ok_or_eyre("Couldn't convert file stem to str!")?;
let contents = file
.contents_utf8()
- .ok_or_else(|| eyre!("Couldnt get contents from copypasta!"))?;
+ .ok_or_eyre("Couldnt get contents from copypasta!")?;
// refer to files by their name w/o extension
files.insert(name, contents);
diff --git a/src/commands/optional/mod.rs b/src/commands/optional/mod.rs
index 8ef7757..39abdcb 100644
--- a/src/commands/optional/mod.rs
+++ b/src/commands/optional/mod.rs
@@ -1,6 +1,6 @@
use crate::Data;
-use color_eyre::eyre::Report;
+use eyre::Report;
use poise::Command;
mod copypasta;
diff --git a/src/commands/optional/teawiespam.rs b/src/commands/optional/teawiespam.rs
index 1ec237e..7f7ba79 100644
--- a/src/commands/optional/teawiespam.rs
+++ b/src/commands/optional/teawiespam.rs
@@ -1,6 +1,6 @@
use crate::Context;
-use color_eyre::eyre::Result;
+use eyre::Result;
use log::debug;
/// teawie will spam you.
diff --git a/src/commands/optional/uwurandom.rs b/src/commands/optional/uwurandom.rs
index c8405a0..312e54f 100644
--- a/src/commands/optional/uwurandom.rs
+++ b/src/commands/optional/uwurandom.rs
@@ -1,6 +1,6 @@
use crate::Context;
-use color_eyre::eyre::Result;
+use eyre::Result;
use log::debug;
use rand::Rng;
diff --git a/src/handlers/error.rs b/src/handlers/error.rs
index 4bca032..afd1241 100644
--- a/src/handlers/error.rs
+++ b/src/handlers/error.rs
@@ -1,7 +1,7 @@
use crate::colors::Colors;
use crate::Data;
-use color_eyre::eyre::Report;
+use eyre::Report;
use log::error;
use poise::serenity_prelude::{CreateEmbed, Timestamp};
use poise::{CreateReply, FrameworkError};
diff --git a/src/handlers/event/guild.rs b/src/handlers/event/guild.rs
index f8bd306..51ae3b7 100644
--- a/src/handlers/event/guild.rs
+++ b/src/handlers/event/guild.rs
@@ -1,4 +1,4 @@
-use color_eyre::eyre::Result;
+use eyre::Result;
use log::{debug, warn};
use poise::serenity_prelude::{Guild, UnavailableGuild};
diff --git a/src/handlers/event/message.rs b/src/handlers/event/message.rs
index 946e596..3054e27 100644
--- a/src/handlers/event/message.rs
+++ b/src/handlers/event/message.rs
@@ -1,6 +1,6 @@
use crate::{consts, Data};
-use color_eyre::eyre::{eyre, Report, Result};
+use eyre::{eyre, Report, Result};
use log::debug;
use poise::serenity_prelude::{Context, Message};
use poise::FrameworkContext;
diff --git a/src/handlers/event/mod.rs b/src/handlers/event/mod.rs
index 50a19d5..9c986e1 100644
--- a/src/handlers/event/mod.rs
+++ b/src/handlers/event/mod.rs
@@ -1,6 +1,6 @@
use crate::Data;
-use color_eyre::eyre::{Report, Result};
+use eyre::{Report, Result};
use log::info;
use poise::serenity_prelude as serenity;
use poise::FrameworkContext;
diff --git a/src/handlers/event/pinboard.rs b/src/handlers/event/pinboard.rs
index 1db14b6..be10eac 100644
--- a/src/handlers/event/pinboard.rs
+++ b/src/handlers/event/pinboard.rs
@@ -1,6 +1,6 @@
use crate::{utils, Data};
-use color_eyre::eyre::{eyre, Context as _, Result};
+use eyre::{eyre, Context as _, OptionExt as _, Result};
use log::debug;
use poise::serenity_prelude::{
ChannelId, Context, CreateAllowedMentions, CreateMessage, Message, MessageType, User,
@@ -38,15 +38,15 @@ pub async fn handle(ctx: &Context, message: &Message, data: &Data) -> Result<()>
let reference_id = message
.clone()
.message_reference
- .ok_or_else(|| eyre!("Couldn't get referenced message of pin!"))?
+ .ok_or_eyre("Couldn't get referenced message of pin!")?
.message_id
- .ok_or_else(|| eyre!("Couldn't get id of referenced message of pin!"))?;
+ .ok_or_eyre("Couldn't get id of referenced message of pin!")?;
let pins = message
.channel_id
.pins(ctx)
.await
- .wrap_err_with(|| "Couldn't get a list of pins!?")?;
+ .wrap_err("Couldn't get a list of pins!?")?;
let pin = pins
.iter()
@@ -70,7 +70,7 @@ async fn redirect(ctx: &Context, pin: &Message, pinner: &User, target: ChannelId
target
.send_message(&ctx.http, message)
.await
- .wrap_err_with(|| "Couldn't redirect message")?;
+ .wrap_err("Couldn't redirect message")?;
Ok(())
}
diff --git a/src/handlers/event/reactboard.rs b/src/handlers/event/reactboard.rs
index 17deeb0..4316633 100644
--- a/src/handlers/event/reactboard.rs
+++ b/src/handlers/event/reactboard.rs
@@ -1,7 +1,7 @@
use crate::{storage, utils, Data};
use storage::ReactBoardEntry;
-use color_eyre::eyre::{eyre, Context as _, Result};
+use eyre::{eyre, Context as _, Result};
use log::debug;
use poise::serenity_prelude::{
Context, CreateMessage, EditMessage, GuildId, Message, MessageReaction, Reaction,
@@ -11,7 +11,7 @@ pub async fn handle(ctx: &Context, reaction: &Reaction, data: &Data) -> Result<(
let msg = reaction
.message(&ctx.http)
.await
- .wrap_err_with(|| "Couldn't get reaction from message!")?;
+ .wrap_err("Couldn't get reaction from message!")?;
let matched = msg
.clone()
diff --git a/src/main.rs b/src/main.rs
index d2ba8e2..806c7b3 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -5,9 +5,9 @@
use std::sync::Arc;
use std::time::Duration;
-use color_eyre::eyre::{eyre, Context as _, Report, Result};
-use color_eyre::owo_colors::OwoColorize;
+use eyre::{eyre, Context as _, Report, Result};
use log::{info, warn};
+use owo_colors::OwoColorize;
use poise::serenity_prelude as serenity;
use poise::{EditTracker, Framework, FrameworkOptions, PrefixFrameworkOptions};
use redis::ConnectionLike;
@@ -32,8 +32,8 @@ pub struct Data {
impl Data {
pub fn new() -> Result<Self> {
- let redis_url = std::env::var("REDIS_URL")
- .wrap_err_with(|| "Couldn't find Redis URL in environment!")?;
+ let redis_url =
+ std::env::var("REDIS_URL").wrap_err("Couldn't find Redis URL in environment!")?;
let storage = Storage::new(&redis_url)?;
@@ -78,8 +78,8 @@ async fn handle_shutdown(shard_manager: Arc<serenity::ShardManager>, reason: &st
#[tokio::main]
async fn main() -> Result<()> {
- dotenvy::dotenv().ok();
color_eyre::install()?;
+ dotenvy::dotenv().ok();
env_logger::init();
let token = std::env::var("TOKEN").wrap_err_with(|| "Couldn't find token in environment!")?;
diff --git a/src/storage/mod.rs b/src/storage/mod.rs
index 8661138..0e2f445 100644
--- a/src/storage/mod.rs
+++ b/src/storage/mod.rs
@@ -1,6 +1,6 @@
use std::fmt::Debug;
-use color_eyre::eyre::Result;
+use eyre::Result;
use log::debug;
use poise::serenity_prelude::{GuildId, MessageId};
use redis::{AsyncCommands, Client, FromRedisValue, ToRedisArgs};