Fixed some crashes in response strings source generator, reorganized more submodules into their folders

This commit is contained in:
Kwoth
2022-01-02 03:49:54 +01:00
parent 9c590668df
commit 4b6af0e4ef
191 changed files with 120 additions and 80 deletions

View File

@@ -0,0 +1,12 @@
#nullable disable
using System.Diagnostics;
namespace NadekoBot.Modules.Utility.Common;
[DebuggerDisplay("Type: {UnitType} Trigger: {Triggers[0]} Mod: {Modifier}")]
public class ConvertUnit
{
public string[] Triggers { get; set; }
public string UnitType { get; set; }
public decimal Modifier { get; set; }
}

View File

@@ -0,0 +1,20 @@
#nullable disable
namespace NadekoBot.Modules.Utility.Common.Exceptions;
public class StreamRoleNotFoundException : Exception
{
public StreamRoleNotFoundException()
: base("Stream role wasn't found.")
{
}
public StreamRoleNotFoundException(string message)
: base(message)
{
}
public StreamRoleNotFoundException(string message, Exception innerException)
: base(message, innerException)
{
}
}

View File

@@ -0,0 +1,20 @@
#nullable disable
namespace NadekoBot.Modules.Utility.Common.Exceptions;
public class StreamRolePermissionException : Exception
{
public StreamRolePermissionException()
: base("Stream role was unable to be applied.")
{
}
public StreamRolePermissionException(string message)
: base(message)
{
}
public StreamRolePermissionException(string message, Exception innerException)
: base(message, innerException)
{
}
}

View File

@@ -0,0 +1,134 @@
#nullable disable
using System.Text.Json.Serialization;
namespace NadekoBot.Modules.Utility.Common.Patreon;
public sealed class Attributes
{
[JsonPropertyName("full_name")]
public string FullName { get; set; }
[JsonPropertyName("is_follower")]
public bool IsFollower { get; set; }
[JsonPropertyName("last_charge_date")]
public DateTime LastChargeDate { get; set; }
[JsonPropertyName("last_charge_status")]
public string LastChargeStatus { get; set; }
[JsonPropertyName("lifetime_support_cents")]
public int LifetimeSupportCents { get; set; }
[JsonPropertyName("currently_entitled_amount_cents")]
public int CurrentlyEntitledAmountCents { get; set; }
[JsonPropertyName("patron_status")]
public string PatronStatus { get; set; }
}
public sealed class Data
{
[JsonPropertyName("id")]
public string Id { get; set; }
[JsonPropertyName("type")]
public string Type { get; set; }
}
public sealed class Address
{
[JsonPropertyName("data")]
public Data Data { get; set; }
}
// public sealed class CurrentlyEntitledTiers
// {
// [JsonPropertyName("data")]
// public List<Datum> Data { get; set; }
// }
// public sealed class Relationships
// {
// [JsonPropertyName("address")]
// public Address Address { get; set; }
//
// // [JsonPropertyName("currently_entitled_tiers")]
// // public CurrentlyEntitledTiers CurrentlyEntitledTiers { get; set; }
// }
public sealed class PatreonResponse
{
[JsonPropertyName("data")]
public List<PatreonMember> Data { get; set; }
[JsonPropertyName("included")]
public List<PatreonUser> Included { get; set; }
[JsonPropertyName("links")]
public PatreonLinks Links { get; set; }
}
public sealed class PatreonLinks
{
[JsonPropertyName("next")]
public string Next { get; set; }
}
public sealed class PatreonUser
{
[JsonPropertyName("attributes")]
public PatreonUserAttributes Attributes { get; set; }
[JsonPropertyName("id")]
public string Id { get; set; }
// public string Type { get; set; }
}
public sealed class PatreonUserAttributes
{
[JsonPropertyName("social_connections")]
public PatreonSocials SocialConnections { get; set; }
}
public sealed class PatreonSocials
{
[JsonPropertyName("discord")]
public DiscordSocial Discord { get; set; }
}
public sealed class DiscordSocial
{
[JsonPropertyName("user_id")]
public string UserId { get; set; }
}
public sealed class PatreonMember
{
[JsonPropertyName("attributes")]
public Attributes Attributes { get; set; }
[JsonPropertyName("relationships")]
public Relationships Relationships { get; set; }
[JsonPropertyName("type")]
public string Type { get; set; }
}
public sealed class Relationships
{
[JsonPropertyName("user")]
public PatreonRelationshipUser User { get; set; }
}
public sealed class PatreonRelationshipUser
{
[JsonPropertyName("data")]
public PatreonUserData Data { get; set; }
}
public sealed class PatreonUserData
{
[JsonPropertyName("id")]
public string Id { get; set; }
}

View File

@@ -0,0 +1,8 @@
#nullable disable
namespace NadekoBot.Modules.Utility.Common;
public enum StreamRoleListType
{
Whitelist,
Blacklist
}