Browse Source

Added GetJumpUrl() as an IMessage extension method

pull/1102/head
Casino Boyale 7 years ago
parent
commit
e054cf4eec
1 changed files with 8 additions and 2 deletions
  1. +8
    -2
      src/Discord.Net.Commands/Extensions/MessageExtensions.cs

+ 8
- 2
src/Discord.Net.Commands/Extensions/MessageExtensions.cs View File

@@ -1,4 +1,4 @@
using System;
using System;

namespace Discord.Commands
{
@@ -42,5 +42,11 @@ namespace Discord.Commands
}
return false;
}

public static string GetJumpUrl(this IMessage msg)
{
var channel = msg.Channel;
return $"https://discordapp.com/channels/{(channel is IDMChannel ? "@me" : $"{(channel as IGuildChannel).GuildId}")}/{channel.Id}/{msg.Id}";
}
}
}
}

Loading…
Cancel
Save