feat(core): add dispatch for autoproxy events (#621)

This commit is contained in:
ambdroid 2024-03-13 17:26:09 -04:00 committed by GitHub
parent 44bd0d6079
commit caff9c50aa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 45 additions and 4 deletions

View file

@ -44,4 +44,23 @@ public class AutoproxyPatch: PatchObject
return p;
}
public JObject ToJson(ulong? guild_id, ulong? channel_id, string? memberId = null)
{
var o = new JObject();
o.Add("guild_id", guild_id?.ToString());
o.Add("channel_id", channel_id?.ToString());
if (AutoproxyMode.IsPresent)
o.Add("autoproxy_mode", AutoproxyMode.Value.ToString().ToLower());
if (AutoproxyMember.IsPresent)
o.Add("autoproxy_member", memberId);
if (LastLatchTimestamp.IsPresent)
o.Add("last_latch_timestamp", LastLatchTimestamp.Value.FormatExport());
return o;
}
}