aboutsummaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorFuwn <[email protected]>2020-11-02 16:31:17 -0800
committerFuwn <[email protected]>2020-11-02 16:31:17 -0800
commit11e768178d08d631b38703d8cc38f2aa9ff83cdb (patch)
tree858729a395e8e661bc6e425464d4dd022c95054a /src/modules
parentchore/ fix: commit file that i forgot to commit (diff)
downloaddep-core-next-11e768178d08d631b38703d8cc38f2aa9ff83cdb.tar.xz
dep-core-next-11e768178d08d631b38703d8cc38f2aa9ff83cdb.zip
refactor, chore, feat (desc)
refactor: - `Cargo.toml` openssl patch - rename `DBOTS_TOKEN` environment variable feat: - new `wisp` command information - support server, bot invite, feature request, bot discovery sites. - use `CARGO_PKG_VERSION` environment variable to show version in presence. - `privacypolicy` command - prime more of the rocket webserver
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/commands/general/mod.rs1
-rw-r--r--src/modules/commands/general/utilities.rs53
2 files changed, 50 insertions, 4 deletions
diff --git a/src/modules/commands/general/mod.rs b/src/modules/commands/general/mod.rs
index ce87755..33c97d0 100644
--- a/src/modules/commands/general/mod.rs
+++ b/src/modules/commands/general/mod.rs
@@ -112,6 +112,7 @@ pub fn init_utilities() -> CreateGroup {
.cmd("pfp", PFP)
.cmd("ping", Ping)
.cmd("prefix", Prefix)
+ .cmd("privacypolicy", PrivacyPolicy)
.cmd("remind", Reminder)
.cmd("role", RoleInfo)
.cmd("server", ServerInfo)
diff --git a/src/modules/commands/general/utilities.rs b/src/modules/commands/general/utilities.rs
index 2d974e3..daebc27 100644
--- a/src/modules/commands/general/utilities.rs
+++ b/src/modules/commands/general/utilities.rs
@@ -679,6 +679,32 @@ impl Command for Weather {
}
} */
+pub struct PrivacyPolicy;
+impl Command for PrivacyPolicy {
+ fn options(&self) -> Arc<CommandOptions> {
+ let default = CommandOptions::default();
+ let options = CommandOptions {
+ desc: Some("View my privacy policy!".to_string()),
+ aliases: vec!["privacy-policy", "privacy"].iter().map(|e| e.to_string()).collect(),
+ ..default
+ };
+ Arc::new(options)
+ }
+
+ fn execute(&self, _ctx: &mut Context, message: &Message, _args: Args) -> Result<(), CommandError> {
+ use serenity::builder::CreateEmbed;
+
+ let embed = CreateEmbed::default()
+ .field("Privacy Policy", "**Does Wisp store user/ guild data?**\nYes! We store various pieces of information which is only kept for the lifetime of the command/ feature/ module.\n\n**How can I request to have my data removed?**\nMost of the data that we keep can be retracted by disabling the command/ feature/ module, however, if you want to make *100%* sure that all your data has been erased, join our support server and we will personally make sure that your requests are satisfied.\n\n*In the future, the process of requesting the deletion of your data might be an automated or semi-automated process.*", false)
+ .colour(*colours::MAIN);
+
+ message.channel_id.send_message(|m| m
+ .embed(|_| embed))?;
+
+ Ok(())
+ }
+}
+
pub struct Wisp; // BotInfo
impl Command for Wisp {
fn options(&self) -> Arc<CommandOptions> {
@@ -686,7 +712,7 @@ impl Command for Wisp {
let options = CommandOptions {
desc: Some("Information about me!".to_string()),
usage: Some("".to_string()),
- aliases: vec!["botinfo", "bi", "binfo", "bot", "invite"].iter().map(|e| e.to_string()).collect(),
+ aliases: vec!["botinfo", "bi", "binfo", "bot", "invite", "vote", "topgg", "top.gg"].iter().map(|e| e.to_string()).collect(),
..default
};
Arc::new(options)
@@ -701,8 +727,18 @@ impl Command for Wisp {
// (cache.guilds.len(), cache.shard_count, cache.user.face())
// };
let thumbnail = CACHE.read().user.face();
- let owner = data.get::<Owner>().expect("Failed to get owner").to_user()?;
+ let owner = data.get::<Owner>().expect("Failed to get owner.").to_user()?;
let sys = System::new();
+
+ // let mut privacy_policy_message: String = "".to_string();
+ // if let Some(guild_id) = message.guild_id {
+ // if let Ok(settings) = db.get_guild(guild_id.0 as i64) {
+ // privacy_policy_message = format!("To Wisp's privacy policy, simple run `{}privacypolicy`.", settings.prefix);
+ // } else {
+ // privacy_policy_message = format!("To Wisp's privacy policy, simple run `privacypolicy`.");
+ // }
+ // }
+
let embed = CreateEmbed::default()
// .description("Hi! I'm Wisp, a general purpose bot created in [Rust](http://www.rust-lang.org/) using [Serenity](https://github.com/serenity-rs/serenity).")
.description("Hey! I'm Wisp, I was written in [Rust](https://www.rust-lang.org/) using [Serenity](https://github.com/serenity-rs/serenity).")
@@ -720,10 +756,13 @@ impl Command for Wisp {
// ,true)
.field("Useful Links", format!(
// "[Support Server]({})\n[Invite]({})\n[GitLab]({})\n[Patreon]({})"
- "[Support Server]({})\n[GitHub Organization]({})\n[Feature Request]({})\n[Invite]({})"
+ "[Support Server]({})\n[GitHub Organization]({})\n[Feature Request]({})\n[Top.gg]({}), [DiscordBots]({}), [Bots On Discord]({})\n[Invite]({})"
,SUPPORT_SERV_INVITE
,GITHUB_ORG_LINK
,FEATURE_REQUEST_LINK
+ ,TOPGG_LINK
+ ,DBOTS_CO_LINK
+ ,BOTSOND_LINK
,BOT_INVITE)
// ,GITLAB_LINK
// ,PATREON_LINK)
@@ -737,6 +776,7 @@ impl Command for Wisp {
.text("Want to request a feature? Submit one over at [email protected]!"))
.thumbnail(thumbnail)
.colour(*colours::MAIN);
+
if let Some(process) = sys.get_process(get_current_pid()) {
message.channel_id.send_message(|m| m
.embed(|_| embed
@@ -752,12 +792,17 @@ impl Command for Wisp {
,(process.cpu_usage()*100.0).round()/100.0 // round to 2 decimals
/* ,seconds_to_hrtime((sys.get_uptime() - process.start_time()) as usize) */)
,true)
+ // .field("Privacy Policy", &privacy_policy_message, false)
+ .field("Privacy Policy", "To Wisp's privacy policy, simple run `privacypolicy`.", false)
))?;
} else {
message.channel_id.send_message(|m| m
.embed(|_| embed
- ))?;
+ // .field("Privacy Policy", &privacy_policy_message, false)
+ .field("Privacy Policy", "To Wisp's privacy policy, simple run the `privacypolicy` command.", false)
+ ))?;
}
+
Ok(())
}
}