-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
91 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
src/Color-Chan.Discord.Core/Extensions/DiscordChannelExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using Color_Chan.Discord.Core.Common.Models; | ||
|
||
namespace Color_Chan.Discord.Core.Extensions | ||
{ | ||
/// <summary> | ||
/// Contains all the extensions methods for <see cref="IDiscordChannel" />. | ||
/// </summary> | ||
public static class DiscordChannelExtensions | ||
{ | ||
/// <summary> | ||
/// Get a string mentioning a specific <paramref name="channel"/>. | ||
/// </summary> | ||
/// <param name="channel">The <see cref="IDiscordChannel"/> that will be mentioned.</param> | ||
/// <returns> | ||
/// A <see cref="string"/> containing the mentioned <paramref name="channel"/>. | ||
/// </returns> | ||
public static string Mention(this IDiscordChannel channel) | ||
{ | ||
return $"<#{channel.Id.ToString()}>"; | ||
} | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
src/Color-Chan.Discord.Core/Extensions/DiscordGuildRoleExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using Color_Chan.Discord.Core.Common.Models.Guild; | ||
|
||
namespace Color_Chan.Discord.Core.Extensions | ||
{ | ||
/// <summary> | ||
/// Contains all the extensions methods for <see cref="IDiscordGuildRole" />. | ||
/// </summary> | ||
public static class DiscordGuildRoleExtensions | ||
{ | ||
/// <summary> | ||
/// Get a string mentioning a specific <paramref name="role"/>. | ||
/// </summary> | ||
/// <param name="role">The <see cref="IDiscordGuildRole"/> that will be mentioned.</param> | ||
/// <returns> | ||
/// A <see cref="string"/> containing the mentioned <paramref name="role"/>. | ||
/// </returns> | ||
public static string Mention(IDiscordGuildRole role) | ||
{ | ||
return $"<@&{role.Id.ToString()}>"; | ||
} | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
src/Color-Chan.Discord.Core/Extensions/DiscordUserExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using Color_Chan.Discord.Core.Common.Models; | ||
|
||
namespace Color_Chan.Discord.Core.Extensions | ||
{ | ||
/// <summary> | ||
/// Contains all the extensions methods for <see cref="IDiscordUser" />. | ||
/// </summary> | ||
public static class DiscordUserExtensions | ||
{ | ||
/// <summary> | ||
/// Get a string mentioning a specific <paramref name="user"/>. | ||
/// </summary> | ||
/// <param name="user">The <see cref="IDiscordUser"/> that will be mentioned.</param> | ||
/// <param name="useNickname">Whether or not the mention with the nickname of the user.</param> | ||
/// <returns> | ||
/// A <see cref="string"/> containing the mentioned <paramref name="user"/>. | ||
/// </returns> | ||
public static string Mention(this IDiscordUser user, bool useNickname = true) | ||
{ | ||
return !useNickname ? $"<@{user.Id.ToString()}>" : $"<@!{user.Id.ToString()}>"; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters