mirror of
https://github.com/yawaflua/Discord.Net.git
synced 2025-12-08 19:39:35 +02:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
7
.github/workflows/nuget.yml
vendored
7
.github/workflows/nuget.yml
vendored
@@ -38,11 +38,6 @@ jobs:
|
||||
|
||||
- name: Pack
|
||||
run: dotnet pack --no-build --configuration Release -p:PackageVersion=${{ env.PACKAGE_VERSION }}
|
||||
- name: Add GitHub source
|
||||
run: dotnet nuget add source --username ${{ github.repository_owner }} --password ${{ secrets.GHCR_TOKEN }} --store-password-in-clear-text --name github ${{ env.GITHUB_SOURCE }}
|
||||
|
||||
- name: Publish to GitHub Packages
|
||||
run: dotnet nuget push "**/*.nupkg" --source "github"
|
||||
|
||||
- name: Publish to NuGet
|
||||
run: dotnet nuget push "**/*.nupkg" --source ${{ env.NUGET_SOURCE }} --api-key ${{ secrets.NUGET_API_KEY }}
|
||||
run: dotnet nuget push "**/*.nupkg" --source ${{ env.NUGET_SOURCE }} --api-key ${{ secrets.NUGET_API_KEY }}
|
||||
|
||||
@@ -8,5 +8,5 @@ internal class AvatarDecoration : IAvatarDecoration
|
||||
[JsonPropertyName("asset")]
|
||||
public string AssetHash { get; set; }
|
||||
[JsonPropertyName("sku_id")]
|
||||
public ulong AssetArticular { get; set; }
|
||||
public string AssetArticular { get; set; }
|
||||
}
|
||||
@@ -6,7 +6,7 @@ namespace yawaflua.Discord.Net.Entities;
|
||||
|
||||
internal class DiscordGuild : IGuild
|
||||
{
|
||||
[JsonPropertyName("id")] public ulong Id { get; set; }
|
||||
[JsonPropertyName("id")] public string Id { get; set; }
|
||||
|
||||
[JsonPropertyName("name")] public string Name { get; set; }
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ namespace yawaflua.Discord.Net.Entities;
|
||||
|
||||
internal class DiscordRole : IRole
|
||||
{
|
||||
public ulong Id { get; set; }
|
||||
public string Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
public int Color { get; set; }
|
||||
private RoleColor Colors { get; set; }
|
||||
|
||||
@@ -31,7 +31,7 @@ internal class DiscordSession (IToken token, HttpClient httpClient, ScopesBuilde
|
||||
return await _req<DiscordGuild[]>("users/@me/guilds");
|
||||
}
|
||||
|
||||
public async Task<IGuildMember?> GetGuildMemberAsync(ulong guildId, CancellationToken cancellationToken = default)
|
||||
public async Task<IGuildMember?> GetGuildMemberAsync(string guildId, CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (token.AccessToken is null)
|
||||
{
|
||||
@@ -41,7 +41,7 @@ internal class DiscordSession (IToken token, HttpClient httpClient, ScopesBuilde
|
||||
return await _req<DiscordGuildMember>($"users/@me/guilds/{guildId}/member");
|
||||
}
|
||||
|
||||
public async Task<IGuildMember?> AddMemberToGuildAsync(ulong guildId, ulong userId, CancellationToken cancellationToken = default)
|
||||
public async Task<IGuildMember?> AddMemberToGuildAsync(string guildId, string userId, CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (token.AccessToken is null)
|
||||
{
|
||||
|
||||
@@ -3,5 +3,5 @@
|
||||
public interface IAvatarDecoration
|
||||
{
|
||||
public string AssetHash { get; set; }
|
||||
public ulong AssetArticular { get; set; }
|
||||
public string AssetArticular { get; set; }
|
||||
}
|
||||
@@ -4,7 +4,7 @@ namespace yawaflua.Discord.Net.Interfaces.Models;
|
||||
|
||||
public interface IGuild
|
||||
{
|
||||
public ulong Id { get; set; }
|
||||
public string Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string? IconHash { get; set; }
|
||||
public string? BannerHash { get; set; }
|
||||
|
||||
@@ -4,7 +4,7 @@ namespace yawaflua.Discord.Net.Interfaces.Models;
|
||||
|
||||
public interface IRole
|
||||
{
|
||||
public ulong Id { get; set; }
|
||||
public string Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
[Obsolete("Deprecated integer representation of hexadecimal color code")]
|
||||
public int Color { get; set; }
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
public interface ISession
|
||||
{
|
||||
Task<IList<IGuild>?> GetGuildsAsync(CancellationToken cancellationToken = default);
|
||||
Task<IGuildMember?> GetGuildMemberAsync(ulong guildId, CancellationToken cancellationToken = default);
|
||||
Task<IGuildMember?> AddMemberToGuildAsync(ulong guildId, ulong userId, CancellationToken cancellationToken = default);
|
||||
Task<IGuildMember?> GetGuildMemberAsync(string guildId, CancellationToken cancellationToken = default);
|
||||
Task<IGuildMember?> AddMemberToGuildAsync(string guildId, string userId, CancellationToken cancellationToken = default);
|
||||
Task<IUser?> GetCurrentUserAsync(CancellationToken cancellationToken = default);
|
||||
|
||||
Task<IConnection?> GetConnectionAsync(CancellationToken cancellationToken = default);
|
||||
|
||||
Reference in New Issue
Block a user