Fix invalid types for some discord webhook values (#19515)
This commit is contained in:
@@ -144,7 +144,7 @@ namespace Content.Server.Administration.Systems
|
||||
_config.UnsubValueChanged(CVars.GameHostName, OnServerNameChanged);
|
||||
}
|
||||
|
||||
private void OnWebhookChanged(string url)
|
||||
private async void OnWebhookChanged(string url)
|
||||
{
|
||||
_webhookUrl = url;
|
||||
|
||||
@@ -173,7 +173,7 @@ namespace Content.Server.Administration.Systems
|
||||
var webhookToken = match.Groups[2].Value;
|
||||
|
||||
// Fire and forget
|
||||
_ = SetWebhookData(webhookId, webhookToken);
|
||||
await SetWebhookData(webhookId, webhookToken);
|
||||
}
|
||||
|
||||
private async Task SetWebhookData(string id, string token)
|
||||
|
||||
@@ -6,16 +6,16 @@ namespace Content.Server.Discord;
|
||||
public struct WebhookData
|
||||
{
|
||||
[JsonPropertyName("id")]
|
||||
public ulong Id { get; set; }
|
||||
public string Id { get; set; }
|
||||
|
||||
[JsonPropertyName("type")]
|
||||
public int Type { get; set; }
|
||||
|
||||
[JsonPropertyName("guild_id")]
|
||||
public ulong? GuildId { get; set; }
|
||||
public string? GuildId { get; set; }
|
||||
|
||||
[JsonPropertyName("channel_id")]
|
||||
public ulong? ChannelId { get; set; }
|
||||
public string? ChannelId { get; set; }
|
||||
|
||||
[JsonPropertyName("user")]
|
||||
public WebhookUser? User { get; set; }
|
||||
@@ -30,7 +30,7 @@ public struct WebhookData
|
||||
public string Token { get; set; }
|
||||
|
||||
[JsonPropertyName("application_id")]
|
||||
public ulong? ApplicationId { get; set; }
|
||||
public string? ApplicationId { get; set; }
|
||||
|
||||
[JsonPropertyName("url")]
|
||||
public string? Url { get; set; }
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
namespace Content.Server.Discord;
|
||||
|
||||
public record struct WebhookIdentifier(ulong Id, string Token);
|
||||
public record struct WebhookIdentifier(string Id, string Token);
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace Content.Server.Discord;
|
||||
public struct WebhookUser
|
||||
{
|
||||
[JsonPropertyName("id")]
|
||||
public ulong Id { get; set; }
|
||||
public string Id { get; set; }
|
||||
|
||||
[JsonPropertyName("username")]
|
||||
public string Username { get; set; }
|
||||
|
||||
Reference in New Issue
Block a user