aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/commands/meme.rs12
-rw-r--r--src/commands/mod.rs20
-rw-r--r--src/commands/playback/mod.rs7
-rw-r--r--src/commands/playback/types.rs7
-rw-r--r--src/commands/roll.rs8
-rw-r--r--src/db/mod.rs14
-rw-r--r--src/main.rs22
-rw-r--r--src/util.rs6
8 files changed, 62 insertions, 34 deletions
diff --git a/src/commands/meme.rs b/src/commands/meme.rs
index 3fd9db3..de64ad5 100644
--- a/src/commands/meme.rs
+++ b/src/commands/meme.rs
@@ -1,10 +1,14 @@
+use std::sync::RwLock;
+
+use serenity::{
+ http::AttachmentType,
+ builder::CreateMessage,
+ framework::standard::Args,
+};
+
use rand::{thread_rng, Rng};
-use serenity::http::AttachmentType;
-use serenity::builder::CreateMessage;
-use serenity::framework::standard::Args;
use diesel::PgConnection;
use failure::Error;
-use std::sync::RwLock;
use lazy_static::lazy_static;
use super::*;
diff --git a/src/commands/mod.rs b/src/commands/mod.rs
index bf55b90..db304e3 100644
--- a/src/commands/mod.rs
+++ b/src/commands/mod.rs
@@ -1,10 +1,18 @@
+use std::{
+ thread,
+ time::Duration,
+};
+
+use serenity::{
+ prelude::*,
+ framework::StandardFramework,
+ model::{
+ channel::Message,
+ id::MessageId,
+ },
+};
+
use crate::{must_env_lookup, Result, TARGET_GUILD_ID};
-use serenity::framework::StandardFramework;
-use serenity::model::channel::Message;
-use serenity::model::id::ChannelId;
-use serenity::prelude::*;
-use std::thread;
-use std::time::Duration;
mod playback;
mod sound;
diff --git a/src/commands/playback/mod.rs b/src/commands/playback/mod.rs
index bbcbd74..efb2553 100644
--- a/src/commands/playback/mod.rs
+++ b/src/commands/playback/mod.rs
@@ -1,9 +1,12 @@
use either::{Left, Right};
-use serenity::voice::{LockedAudio, ytdl};
+use serenity::{
+ voice::{LockedAudio, ytdl},
+ model::id::ChannelId,
+ framework::standard::Args,
+};
use super::*;
pub use self::types::*;
-use serenity::framework::standard::Args;
mod types;
diff --git a/src/commands/playback/types.rs b/src/commands/playback/types.rs
index 2035bd9..9c1a878 100644
--- a/src/commands/playback/types.rs
+++ b/src/commands/playback/types.rs
@@ -1,7 +1,10 @@
+use std::{
+ sync::{Arc, RwLock},
+ collections::VecDeque,
+};
+
use serenity::client::bridge::voice::ClientVoiceManager;
use typemap::Key;
-use std::sync::{Arc, RwLock};
-use std::collections::VecDeque;
use either::{Either, Left, Right};
diff --git a/src/commands/roll.rs b/src/commands/roll.rs
index 55b5429..217b3a4 100644
--- a/src/commands/roll.rs
+++ b/src/commands/roll.rs
@@ -1,6 +1,8 @@
-use serenity::prelude::*;
-use serenity::framework::standard::Args;
-use serenity::model::channel::Message;
+use serenity::{
+ prelude::*,
+ framework::standard::Args,
+ model::channel::Message,
+};
use regex::Regex;
use rand::prelude::*;
diff --git a/src/db/mod.rs b/src/db/mod.rs
index d1d7c9b..722c72d 100644
--- a/src/db/mod.rs
+++ b/src/db/mod.rs
@@ -1,9 +1,13 @@
-use std::env;
-use std::convert::AsRef;
+use std::{
+ env,
+ convert::AsRef,
+};
-use diesel::prelude::*;
-use diesel::r2d2::{ConnectionManager, ManageConnection};
-use diesel::NotFound;
+use diesel::{
+ prelude::*,
+ r2d2::{ConnectionManager, ManageConnection},
+ NotFound,
+};
use super::{Result, Error};
pub use self::models::*;
diff --git a/src/main.rs b/src/main.rs
index 2974eea..de2d3c5 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -18,10 +18,18 @@ extern crate sha1;
extern crate typemap;
extern crate url;
+use std::{
+ env,
+ thread,
+ time::{
+ Duration,
+ Instant
+ },
+};
+
+
use dotenv::dotenv;
use failure::Error;
-use self::commands::register_commands;
-pub use self::util::*;
use serenity::{
framework::{
standard::help_commands,
@@ -33,15 +41,9 @@ use serenity::{
},
prelude::*,
};
-use std::{
- env,
- thread,
- time::{
- Duration,
- Instant
- },
-};
+use self::commands::register_commands;
+pub use self::util::*;
#[cfg(feature = "diesel")]
mod db;
diff --git a/src/util.rs b/src/util.rs
index 1eb4b23..85ec6d7 100644
--- a/src/util.rs
+++ b/src/util.rs
@@ -1,5 +1,7 @@
-use std::env;
-use std::str::FromStr;
+use std::{
+ env,
+ str::FromStr,
+};
use serenity::model::permissions::Permissions;
use url::Url;