浏览代码

make the size of GetGuildVanityUrl optional

pull/1319/head
Chris Johnston 7 年前
父节点
当前提交
ffe5103a5b
共有 1 个文件被更改,包括 7 次插入2 次删除
  1. +7
    -2
      src/Discord.Net.Core/CDN.cs

+ 7
- 2
src/Discord.Net.Core/CDN.cs 查看文件

@@ -86,8 +86,13 @@ namespace Discord
/// <returns>
/// A URL pointing to the guild's vanity image.
/// </returns>
public static string GetGuildVanityUrl(ulong guildId, string vanityId, ushort size)
=> vanityId != null ? $"{DiscordConfig.CDNUrl}banners/{guildId}/{vanityId}.jpg?size={size}" : null;
public static string GetGuildVanityUrl(ulong guildId, string vanityId, ushort? size = null)
{
if (!string.IsNullOrEmpty(vanityId))
return $"{DiscordConfig.CDNUrl}banners/{guildId}/{vanityId}.jpg" + (size.HasValue ? $"?size={size}" : string.Empty);
return null;
}
// => vanityId != null ? $"{DiscordConfig.CDNUrl}banners/{guildId}/{vanityId}.jpg?size={size}" : null;
/// <summary>
/// Returns an emoji URL.
/// </summary>


正在加载...
取消
保存