-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathDiscordConfigContracts.cs
More file actions
76 lines (55 loc) · 2.23 KB
/
Copy pathDiscordConfigContracts.cs
File metadata and controls
76 lines (55 loc) · 2.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
// -----------------------------------------------------------------------
// <copyright file="DiscordConfigContracts.cs" company="Petabridge, LLC">
// Copyright (C) 2026 - 2026 Petabridge, LLC <https://petabridge.com>
// </copyright>
// -----------------------------------------------------------------------
namespace Netclaw.Configuration;
/// <summary>
/// Response for <c>GET /api/config/discord</c>.
/// </summary>
public sealed record GetDiscordConfigResponse
{
public bool Enabled { get; init; }
/// <summary>
/// The response never includes the bot token's plaintext.
/// </summary>
public bool BotTokenIsSet { get; init; }
public string? DefaultChannelId { get; init; }
public bool AllowDirectMessages { get; init; }
public bool MentionOnly { get; init; } = true;
public bool MentionRequiredInDm { get; init; }
public string[] AllowedChannelIds { get; init; } = [];
public string[] AllowedUserIds { get; init; } = [];
public Dictionary<string, string> ChannelAudiences { get; init; } = new(StringComparer.Ordinal);
}
/// <summary>
/// Request for <c>PUT /api/config/discord</c>.
/// </summary>
public sealed record PutDiscordConfigRequest
{
public bool Enabled { get; init; }
/// <summary>
/// <c>null</c> leaves the stored token untouched. Empty string clears the
/// token. Any other value replaces it.
/// </summary>
public string? BotToken { get; init; }
public string? DefaultChannelId { get; init; }
public bool AllowDirectMessages { get; init; }
public bool MentionOnly { get; init; } = true;
public bool MentionRequiredInDm { get; init; }
public string[] AllowedChannelIds { get; init; } = [];
public string[] AllowedUserIds { get; init; } = [];
public Dictionary<string, string> ChannelAudiences { get; init; } = new(StringComparer.Ordinal);
}
/// <summary>
/// Response for <c>PUT /api/config/discord</c>.
/// </summary>
public sealed record PutDiscordConfigResponse
{
public required string ConfigPath { get; init; }
public required string SecretsPath { get; init; }
/// <summary>
/// Discord settings take effect after the daemon restarts.
/// </summary>
public bool RestartRequired { get; init; } = true;
}