diff options
| author | Fuwn <[email protected]> | 2020-11-02 16:31:17 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2020-11-02 16:31:17 -0800 |
| commit | 11e768178d08d631b38703d8cc38f2aa9ff83cdb (patch) | |
| tree | 858729a395e8e661bc6e425464d4dd022c95054a /src/core | |
| parent | chore/ fix: commit file that i forgot to commit (diff) | |
| download | dep-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/core')
| -rw-r--r-- | src/core/api.rs | 4 | ||||
| -rw-r--r-- | src/core/consts.rs | 13 | ||||
| -rw-r--r-- | src/core/handler.rs | 10 |
3 files changed, 12 insertions, 15 deletions
diff --git a/src/core/api.rs b/src/core/api.rs index 9712ffd..71800e3 100644 --- a/src/core/api.rs +++ b/src/core/api.rs @@ -157,7 +157,7 @@ impl ApiClient { pub fn stats_update(&self, bot_id: u64, server_count: usize) -> ReqwestResult<ReqwestResponse> { let mut headers = Headers::new(); headers.set(ContentType::json()); - headers.set(Authorization(env::var("DBOTS_TOKEN").expect("Expected DiscordBots.org token in enviroment."))); + headers.set(Authorization(env::var("DBOTS_ORG_TOKEN").expect("Expected DiscordBots.org token in environment."))); let mut data = HashMap::new(); data.insert("server_count", server_count); @@ -309,7 +309,7 @@ impl ApiClient { first.components.get("state").unwrap(), first.components.get("country").unwrap() ); - let ds_key = env::var("DARKSKY_KEY").expect("Expected DarkSky API Key in enviroment."); + let ds_key = env::var("DARKSKY_KEY").expect("Expected DarkSky API Key in environment."); let fc_req = Some(ForecastRequestBuilder::new(ds_key.as_str(), *first.geometry.get("lat").unwrap(), *first.geometry.get("lng").unwrap()) .lang(Lang::English) .units(units) diff --git a/src/core/consts.rs b/src/core/consts.rs index bc68bfc..df214c5 100644 --- a/src/core/consts.rs +++ b/src/core/consts.rs @@ -32,12 +32,15 @@ pub const NOW_LIVE: RoleId = RoleId(370395740406546432); pub const SUPPORT_SERVER: GuildId = GuildId(704032355987488791); // 373561057639268352 pub const TRANSCEND: GuildId = GuildId(348660188951216129); -pub const SUPPORT_SERV_INVITE: &str = "https://discord.gg/ASrM7p9"; -pub const BOT_INVITE: &str = "https://discordapp.com/oauth2/authorize/?permissions=335670488&scope=bot&client_id=699473263998271489"; -pub const FEATURE_REQUEST_LINK: &str = "http://mailto:[email protected]"; +pub const SUPPORT_SERV_INVITE: &str = "https://discord.gg/ASrM7p9"; +pub const BOT_INVITE: &str = "https://discordapp.com/oauth2/authorize/?permissions=335670488&scope=bot&client_id=712088369206919269"; +pub const FEATURE_REQUEST_LINK: &str = "http://mailto:[email protected]"; pub const GITHUB_ORG_LINK: &str = "https://github.com/wispgg"; -// pub const GITLAB_LINK: &str = "https://gitlab.com/fuwn/wisp"; -// pub const PATREON_LINK: &str = "https://www.patreon.com/wisp"; +pub const TOPGG_LINK: &str = "https://top.gg/bot/712088369206919269"; +pub const DBOTS_CO_LINK: &str = "https://discordbots.co/bot/712088369206919269"; +pub const BOTSOND_LINK: &str = "https://bots.ondiscord.xyz/bots/712088369206919269"; +// pub const GITLAB_LINK: &str = "https://gitlab.com/fuwn/wisp"; +// pub const PATREON_LINK: &str = "https://www.patreon.com/wisp"; pub const API_FAIL: &str = "Failed to get API"; pub const CACHE_CHANNEL_FAIL: &str = "Failed to get channel lock from CACHE"; diff --git a/src/core/handler.rs b/src/core/handler.rs index 7d5bbfa..2074567 100644 --- a/src/core/handler.rs +++ b/src/core/handler.rs @@ -106,18 +106,12 @@ impl EventHandler for Handler { // let guild_count = guilds.len(); // ctx.set_game(Game::listening(&format!("{} guilds | m!help", guild_count))); - ctx.set_game(Game::playing("w.help | v0.1.0")); + // ctx.set_game(Game::playing("w.help | v0.1.0")); + ctx.set_game(Game::playing(&*format!("w.help | v{}", env!("CARGO_PKG_VERSION")))); info!("Caching complete."); } fn message(&self, ctx: Context, message: Message) { - // check_error!(message.guild().unwrap().read() - // .edit_member(712088369206919269, |member| member.nickname("Wisp"))); - - if message.content.contains("uwu!") { - check_error!(message.channel_id.say("Uwufier has been re-branded! However, due to the current limitations in place for verified Discord bots, we are still awaiting for our username change to go through, until then, meet Wisp, your all-in-one Discord companion. For future reference, please use the new prefix; `w.`!")); - } - if message.mention_everyone { check_error!(message.react("👀")) } |