Skip to content

Commit

Permalink
Discord: Bold player names in messages
Browse files Browse the repository at this point in the history
  • Loading branch information
UnknownShadow200 committed May 11, 2021
1 parent 6355205 commit 19bbecb
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions MCGalaxy/Modules/Relay/Discord/DiscordBot.cs
Expand Up @@ -218,15 +218,24 @@ public sealed class DiscordBot : RelayBot {
// all users are already verified by Discord
protected override bool CheckController(string userID, ref string error) { return true; }

protected override string UnescapeFull(Player p) {
return "**" + base.UnescapeFull(p) + "**";
}

protected override string UnescapeNick(Player p) {
return "**" + base.UnescapeNick(p) + "**";
}


static string FormatRank(OnlineListEntry e) {
return string.Format("__{0}__ (`{1}`)",
e.group.GetFormattedName(), e.players.Count);
}

static string FormatNick(Player p, Player pl) {
string flags = OnlineListEntry.GetFlags(pl);
string format = flags.Length > 0 ? "**{0}**_{2}_ (`{1}`)" : "**{0}** (`{1}`)";
return string.Format(format, p.FormatNick(pl), pl.level.name, flags);
string flags = OnlineListEntry.GetFlags(pl);
string format = flags.Length > 0 ? "**{0}**_{2}_ (`{1}`)" : "**{0}** (`{1}`)";
return string.Format(format, p.FormatNick(pl), pl.level.name, flags);
}

static string FormatPlayers(Player p, OnlineListEntry e) {
Expand Down

0 comments on commit 19bbecb

Please sign in to comment.