mirror of
https://github.com/TeamOctolings/Octobot.git
synced 2025-05-09 23:43:14 +03:00
Split responders into separate class files
Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>
This commit is contained in:
parent
fe4793f5f9
commit
6017a46f38
30 changed files with 434 additions and 393 deletions
|
@ -1,5 +1,5 @@
|
|||
using System.Text.Json.Nodes;
|
||||
using Boyfriend.locale;
|
||||
using Remora.Discord.Extensions.Formatting;
|
||||
using Remora.Rest.Core;
|
||||
using Remora.Results;
|
||||
|
||||
|
@ -8,6 +8,10 @@ namespace Boyfriend.Data.Options;
|
|||
public class SnowflakeOption : Option<Snowflake> {
|
||||
public SnowflakeOption(string name) : base(name, 0UL.ToSnowflake()) { }
|
||||
|
||||
public override string Display(JsonNode settings) {
|
||||
return Name.EndsWith("Channel") ? Mention.Channel(Get(settings)) : Mention.Role(Get(settings));
|
||||
}
|
||||
|
||||
public override Snowflake Get(JsonNode settings) {
|
||||
var property = settings[Name];
|
||||
return property != null ? property.GetValue<ulong>().ToSnowflake() : DefaultValue;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue