mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-06 05:47:53 +00:00
feat: move PKMessage JSON to PluralKit.Core
This commit is contained in:
parent
ddd966ad58
commit
a4a5f5c17a
8 changed files with 55 additions and 71 deletions
|
|
@ -63,20 +63,6 @@ namespace PluralKit.Core
|
|||
return new StringContent(JsonConvert.SerializeObject(o), Encoding.UTF8, "application/json");
|
||||
}
|
||||
|
||||
public static JObject ToDispatchJson(this PKMessage msg, string memberRef)
|
||||
{
|
||||
var o = new JObject();
|
||||
|
||||
o.Add("timestamp", Instant.FromUnixTimeMilliseconds((long)(msg.Mid >> 22) + 1420070400000).FormatExport());
|
||||
o.Add("id", msg.Mid.ToString());
|
||||
o.Add("original", msg.OriginalMid.ToString());
|
||||
o.Add("sender", msg.Sender.ToString());
|
||||
o.Add("channel", msg.Channel.ToString());
|
||||
o.Add("member", memberRef);
|
||||
|
||||
return o;
|
||||
}
|
||||
|
||||
public static async Task<bool> ValidateUri(string url)
|
||||
{
|
||||
IPHostEntry host = null;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue