Skip to content

Commit

Permalink
Update almost all instances of discordapp.com to discord.com
Browse files Browse the repository at this point in the history
This is the new URL for the Discord platform, app, and API. One
exception is cdn.discordapp.com, which will stay as is.
  • Loading branch information
s0lst1ce authored and arqunis committed May 28, 2020
1 parent 46db84a commit f98e61e
Show file tree
Hide file tree
Showing 16 changed files with 35 additions and 35 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ Voice + youtube-dl:
[client's module-level documentation]: https://docs.rs/serenity/*/serenity/client/index.html
[crates.io link]: https://crates.io/crates/serenity
[crates.io version]: https://img.shields.io/crates/v/serenity.svg?style=flat-square
[discord docs]: https://discordapp.com/developers/docs/intro
[discord docs]: https://discord.com/developers/docs/intro
[docs]: https://docs.rs/serenity
[docs-badge]: https://img.shields.io/badge/docs-online-5023dd.svg?style=flat-square
[examples]: https://github.com/serenity-rs/serenity/tree/current/examples
Expand Down
4 changes: 2 additions & 2 deletions command_attr/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ macro_rules! match_options {
/// | `#[usage(use)]` </br> `#[usage = use]` | The command's intended usage. | `use` is a string stating the schema for the command's usage. |
/// | `#[example(ex)]` </br> `#[example = ex]` | An example of the command's usage. May be called multiple times to add many examples at once. | `ex` is a string |
/// | `#[min_args(min)]` </br> `#[max_args(max)]` </br> `#[num_args(min_and_max)]` | The expected length of arguments that the command must receive in order to function correctly. | `min`, `max` and `min_and_max` are 16-bit, unsigned integers. |
/// | `#[required_permissions(perms)]` | Set of permissions the user must possess. | `perms` is a comma separated list of permission names.</br> These can be found at [Discord's official documentation](https://discordapp.com/developers/docs/topics/permissions). |
/// | `#[required_permissions(perms)]` | Set of permissions the user must possess. | `perms` is a comma separated list of permission names.</br> These can be found at [Discord's official documentation](https://discord.com/developers/docs/topics/permissions). |
/// | `#[allowed_roles(roles)]` | Set of roles the user must possess. | `roles` is a comma separated list of role names. |
/// | `#[help_available]` </br> `#[help_available(b)]` | If the command should be displayed in the help message. | `b` is a boolean. If no boolean is provided, the value is assumed to be `true`. |
/// | `#[only_in(ctx)]` | Which environment the command can be executed in. | `ctx` is a string with the accepted values `guild`/`guilds` and `dm`/`dms` (Direct Message). |
Expand Down Expand Up @@ -551,7 +551,7 @@ pub fn help(attr: TokenStream, input: TokenStream) -> TokenStream {
/// | `#[owner_privilege]` </br> `#[owner_privilege(b)]` | If owners can bypass certain options. | `b` is a boolean. If no boolean is provided, the value is assumed to be `true`. |
/// | `#[help_available]` </br> `#[help_available(b)]` | If the group should be displayed in the help message. | `b` is a boolean. If no boolean is provided, the value is assumed to be `true`. |
/// | `#[checks(identifiers)]` | Preconditions that must met before the command's execution. | `identifiers` is a comma separated list of identifiers referencing functions marked by the `#[check]` macro |
/// | `#[required_permissions(perms)]` | Set of permissions the user must possess. | `perms` is a comma separated list of permission names.</br> These can be found at [Discord's official documentation](https://discordapp.com/developers/docs/topics/permissions). |
/// | `#[required_permissions(perms)]` | Set of permissions the user must possess. | `perms` is a comma separated list of permission names.</br> These can be found at [Discord's official documentation](https://discord.com/developers/docs/topics/permissions). |
/// | `#[default_command(cmd)]` | A command to execute if none of the group's prefixes are given. | `cmd` is an identifier referencing a function marked by the `#[command]` macro |
/// | `#[description(desc)]` </br> `#[description = desc]` | The group's description or summary. | `desc` is a string describing the group. |
///
Expand Down
2 changes: 1 addition & 1 deletion src/builder/create_embed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
//! [`ChannelId::send_message`]: ../model/id/struct.ChannelId.html#method.send_message
//! [`CreateEmbed`]: struct.CreateEmbed.html
//! [`ExecuteWebhook::embeds`]: struct.ExecuteWebhook.html#method.embeds
//! [here]: https://discordapp.com/developers/docs/resources/channel#embed-object
//! [here]: https://discord.com/developers/docs/resources/channel#embed-object

use crate::internal::prelude::*;
use crate::model::channel::Embed;
Expand Down
2 changes: 1 addition & 1 deletion src/gateway/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
//! [`Client::start_shard`]: ../client/struct.Client.html#method.start_shard
//! [`Client::start_shard_range`]: ../client/struct.Client.html#method.start_shard_range
//! [`Client::start_shards`]: ../client/struct.Client.html#method.start_shards
//! [docs]: https://discordapp.com/developers/docs/topics/gateway#sharding
//! [docs]: https://discord.com/developers/docs/topics/gateway#sharding

mod error;
mod shard;
Expand Down
2 changes: 1 addition & 1 deletion src/gateway/shard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ use tungstenite::handshake::client::Request;
/// [`Client`]: ../client/struct.Client.html
/// [`new`]: #method.new
/// [`receive`]: #method.receive
/// [docs]: https://discordapp.com/developers/docs/topics/gateway#sharding
/// [docs]: https://discord.com/developers/docs/topics/gateway#sharding
/// [module docs]: index.html#sharding
pub struct Shard {
pub client: WsClient,
Expand Down
16 changes: 8 additions & 8 deletions src/http/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ impl Http {
///
/// [`Guild`]: ../../model/guild/struct.Guild.html
/// [`GuildChannel`]: ../../model/channel/struct.GuildChannel.html
/// [docs]: https://discordapp.com/developers/docs/resources/guild#create-guild-channel
/// [docs]: https://discord.com/developers/docs/resources/guild#create-guild-channel
/// [Manage Channels]: ../../model/permissions/struct.Permissions.html#associatedconstant.MANAGE_CHANNELS
pub fn create_channel(&self, guild_id: u64, map: &JsonMap) -> Result<GuildChannel> {
let body = serde_json::to_vec(map)?;
Expand Down Expand Up @@ -193,11 +193,11 @@ impl Http {
/// [`Guild`]: ../../model/guild/struct.Guild.html
/// [`PartialGuild`]: ../../model/guild/struct.PartialGuild.html
/// [`Shard`]: ../../gateway/struct.Shard.html
/// [GameBridge]: https://discordapp.com/developers/docs/topics/gamebridge
/// [GameBridge]: https://discord.com/developers/docs/topics/gamebridge
/// [US West Region]: ../../model/guild/enum.Region.html#variant.UsWest
/// [documentation on this endpoint]:
/// https://discordapp.com/developers/docs/resources/guild#create-guild
/// [whitelist]: https://discordapp.com/developers/docs/resources/guild#create-guild
/// https://discord.com/developers/docs/resources/guild#create-guild
/// [whitelist]: https://discord.com/developers/docs/resources/guild#create-guild
pub fn create_guild(&self, map: &Value) -> Result<PartialGuild> {
self.fire(Request {
body: Some(map.to_string().as_bytes()),
Expand All @@ -215,7 +215,7 @@ impl Http {
/// [`Guild`]: ../../model/guild/struct.Guild.html
/// [`Integration`]: ../../model/guild/struct.Integration.html
/// [Manage Guild]: ../../model/permissions/struct.Permissions.html#associatedconstant.MANAGE_GUILD
/// [docs]: https://discordapp.com/developers/docs/resources/guild#create-guild-integration
/// [docs]: https://discord.com/developers/docs/resources/guild#create-guild-integration
pub fn create_guild_integration(&self, guild_id: u64, integration_id: u64, map: &Value) -> Result<()> {
self.wind(204, Request {
body: Some(map.to_string().as_bytes()),
Expand All @@ -235,7 +235,7 @@ impl Http {
/// [`GuildChannel`]: ../../model/channel/struct.GuildChannel.html
/// [`RichInvite`]: ../../model/invite/struct.RichInvite.html
/// [Create Invite]: ../../model/permissions/struct.Permissions.html#associatedconstant.CREATE_INVITE
/// [docs]: https://discordapp.com/developers/docs/resources/channel#create-channel-invite
/// [docs]: https://discord.com/developers/docs/resources/channel#create-channel-invite
pub fn create_invite(&self, channel_id: u64, map: &JsonMap) -> Result<RichInvite> {
let body = serde_json::to_vec(map)?;

Expand Down Expand Up @@ -796,7 +796,7 @@ impl Http {
///
/// [`Channel`]: ../../model/channel/enum.Channel.html
/// [`Message`]: ../../model/channel/struct.Message.html
/// [Discord docs]: https://discordapp.com/developers/docs/resources/webhook#querystring-params
/// [Discord docs]: https://discord.com/developers/docs/resources/webhook#querystring-params
pub fn execute_webhook(&self,
webhook_id: u64,
token: &str,
Expand Down Expand Up @@ -1138,7 +1138,7 @@ impl Http {
/// let guilds = http.as_ref().get_guilds(&GuildPagination::After(guild_id), 10).unwrap();
/// ```
///
/// [docs]: https://discordapp.com/developers/docs/resources/user#get-current-user-guilds
/// [docs]: https://discord.com/developers/docs/resources/user#get-current-user-guilds
pub fn get_guilds(&self, target: &GuildPagination, limit: u64) -> Result<Vec<GuildInfo>> {
let (after, before) = match *target {
GuildPagination::After(id) => (Some(id.0), None),
Expand Down
4 changes: 2 additions & 2 deletions src/http/ratelimiting.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
//! variants) have an associated u64 as data. This is the Id of the parameter,
//! differentiating between different ratelimits.
//!
//! [Taken from]: https://discordapp.com/developers/docs/topics/rate-limits#rate-limits
//! [Taken from]: https://discord.com/developers/docs/topics/rate-limits#rate-limits

pub use super::routing::Route;

Expand Down Expand Up @@ -218,7 +218,7 @@ impl Ratelimiter {
///
/// [`Http`]: ../client/struct.Http.html#structfield.routes
/// [`Route`]: ../routing/enum.Route.html
/// [Discord docs]: https://discordapp.com/developers/docs/topics/rate-limits
/// [Discord docs]: https://discord.com/developers/docs/topics/rate-limits
#[derive(Debug)]
pub struct Ratelimit {
/// The total number of requests that can be made in a period of time.
Expand Down
2 changes: 1 addition & 1 deletion src/http/routing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ pub enum Route {
// Additionally, this needs to be a `LightMethod` from the parent module
// and _not_ a `reqwest` `Method` due to `reqwest`'s not deriving `Copy`.
//
// [Rate Limits]: https://discordapp.com/developers/docs/topics/rate-limits
// [Rate Limits]: https://discord.com/developers/docs/topics/rate-limits
ChannelsIdMessagesId(LightMethod, u64),
/// Route for the `/channels/:channel_id/messages/:message_id/ack` path.
///
Expand Down
4 changes: 2 additions & 2 deletions src/internal/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ macro_rules! cdn {
#[cfg(feature = "http")]
macro_rules! api {
($e:expr) => {
concat!("https://discordapp.com/api/v6", $e)
concat!("https://discord.com/api/v6", $e)
};
($e:expr, $($rest:tt)*) => {
format!(api!($e), $($rest)*)
Expand All @@ -23,7 +23,7 @@ macro_rules! api {
#[cfg(feature = "http")]
macro_rules! status {
($e:expr) => {
concat!("https://status.discordapp.com/api/v2", $e)
concat!("https://status.discord.com/api/v2", $e)
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
//! [`examples`]: https://github.com/serenity-rs/serenity/blob/current/examples
//! [cache docs]: cache/index.html
//! [client's module-level documentation]: client/index.html
//! [docs]: https://discordapp.com/developers/docs/intro
//! [docs]: https://discord.com/developers/docs/intro
//! [examples]: https://github.com/serenity-rs/serenity/tree/current/examples
//! [gateway docs]: gateway/index.html
#![doc(html_root_url = "https://docs.rs/serenity/*")]
Expand Down
4 changes: 2 additions & 2 deletions src/model/guild/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ pub struct Guild {
/// - `VERIFIED`
/// - `VIP_REGIONS`
///
/// [Discord Partnership]: https://discordapp.com/partners
/// [Discord Partnership]: https://discord.com/partners
pub features: Vec<String>,
/// The hash of the icon used by the guild.
///
Expand Down Expand Up @@ -367,7 +367,7 @@ impl Guild {
/// [`PartialGuild`]: struct.PartialGuild.html
/// [`Shard`]: ../../gateway/struct.Shard.html
/// [US West region]: enum.Region.html#variant.UsWest
/// [whitelist]: https://discordapp.com/developers/docs/resources/guild#create-guild
/// [whitelist]: https://discord.com/developers/docs/resources/guild#create-guild
#[cfg(feature = "http")]
pub fn create(http: impl AsRef<Http>, name: &str, region: Region, icon: Option<&str>) -> Result<PartialGuild> {
let map = json!({
Expand Down
4 changes: 2 additions & 2 deletions src/model/user.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ impl CurrentUser {
/// },
/// };
///
/// assert_eq!(url, "https://discordapp.com/api/oauth2/authorize? \
/// assert_eq!(url, "https://discord.com/api/oauth2/authorize? \
/// client_id=249608697955745802&scope=bot");
/// # }
/// #
Expand Down Expand Up @@ -274,7 +274,7 @@ impl CurrentUser {
let client_id = http.as_ref().get_current_application_info().map(|v| v.id)?;

let mut url = format!(
"https://discordapp.com/api/oauth2/authorize?client_id={}&scope=bot",
"https://discord.com/api/oauth2/authorize?client_id={}&scope=bot",
client_id
);

Expand Down
4 changes: 2 additions & 2 deletions src/utils/message_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1272,7 +1272,7 @@ fn normalize(text: &str) -> String {
.replace("discord.me", "discord\u{2024}me")
.replace("discordlist.net", "discordlist\u{2024}net")
.replace("discordservers.com", "discordservers\u{2024}com")
.replace("discordapp.com/invite", "discordapp\u{2024}com/invite")
.replace("discord.com/invite", "discordapp\u{2024}com/invite")
// Remove right-to-left override and other similar annoying symbols
.replace('\u{202E}', " ") // RTL Override
.replace('\u{200F}', " ") // RTL Mark
Expand Down Expand Up @@ -1584,7 +1584,7 @@ mod test {
assert_eq!(super::normalize("discord.me"), "discord\u{2024}me");
assert_eq!(super::normalize("discordlist.net"), "discordlist\u{2024}net");
assert_eq!(super::normalize("discordservers.com"), "discordservers\u{2024}com");
assert_eq!(super::normalize("discordapp.com/invite"), "discordapp\u{2024}com/invite");
assert_eq!(super::normalize("discord.com/invite"), "discordapp\u{2024}com/invite");
assert_eq!(super::normalize("\u{202E}"), " ");
assert_eq!(super::normalize("\u{200F}"), " ");
assert_eq!(super::normalize("\u{202B}"), " ");
Expand Down
14 changes: 7 additions & 7 deletions src/utils/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,12 @@ pub fn hashmap_to_json_map<H, T>(map: HashMap<T, Value, H>)
/// assert_eq!(utils::parse_invite(url), "0cDvIgU2voY8RSYL");
/// ```
///
/// 2. Retrieving the code from the URL `"http://discordapp.com/invite/0cDvIgU2voY8RSYL"`:
/// 2. Retrieving the code from the URL `"http://discord.com/invite/0cDvIgU2voY8RSYL"`:
///
/// ```rust
/// use serenity::utils;
///
/// let url = "http://discordapp.com/invite/0cDvIgU2voY8RSYL";
/// let url = "http://discord.com/invite/0cDvIgU2voY8RSYL";
///
/// assert_eq!(utils::parse_invite(url), "0cDvIgU2voY8RSYL");
/// ```
Expand All @@ -94,8 +94,8 @@ pub fn parse_invite(code: &str) -> &str {
let lower = code.to_lowercase();
if lower.starts_with("discord.gg/") {
&code[11..]
} else if lower.starts_with("discordapp.com/invite/") {
&code[22..]
} else if lower.starts_with("discord.com/invite/") {
&code[19..]
} else {
code
}
Expand Down Expand Up @@ -829,9 +829,9 @@ mod test {
assert_eq!(parse_invite("http://discord.gg/abc"), "abc");
assert_eq!(parse_invite("discord.gg/abc"), "abc");
assert_eq!(parse_invite("DISCORD.GG/ABC"), "ABC");
assert_eq!(parse_invite("https://discordapp.com/invite/abc"), "abc");
assert_eq!(parse_invite("http://discordapp.com/invite/abc"), "abc");
assert_eq!(parse_invite("discordapp.com/invite/abc"), "abc");
assert_eq!(parse_invite("https://discord.com/invite/abc"), "abc");
assert_eq!(parse_invite("http://discord.com/invite/abc"), "abc");
assert_eq!(parse_invite("discord.com/invite/abc"), "abc");
}

#[test]
Expand Down
2 changes: 1 addition & 1 deletion src/voice/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ impl Connection {
let soft_clip = SoftClip::new(Channels::Stereo);

// Per discord dev team's current recommendations:
// (https://discordapp.com/developers/docs/topics/voice-connections#heartbeating)
// (https://discord.com/developers/docs/topics/voice-connections#heartbeating)
let temp_heartbeat = (hello.heartbeat_interval as f64 * 0.75) as u64;
info!(
"[Voice] WS heartbeat duration given as {}ms, adjusted to {}ms.",
Expand Down
2 changes: 1 addition & 1 deletion tests/resources/guild_create_1.json

Large diffs are not rendered by default.

0 comments on commit f98e61e

Please sign in to comment.