Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge Amino.NET 1.5.2 #28

Merged
merged 35 commits into from
May 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
f9d4d42
changed version to dev
FabioGaming Mar 16, 2024
878e49c
refactoring Client
FabioGaming Apr 9, 2024
4c91bfa
Refactored SubClient
FabioGaming Apr 9, 2024
6939585
Merge pull request #17 from FabioGaming/structure/refactor-code
FabioGaming Apr 9, 2024
61f28c0
fixed formatting
FabioGaming Apr 14, 2024
d6c3f96
Create tests.yml
FabioGaming Apr 16, 2024
fddc33b
Update FUNDING.yml
FabioGaming Apr 16, 2024
9049efb
Merge pull request #18 from FabioGaming/test-branch
FabioGaming Apr 16, 2024
dff43a3
Create dev-autopublish
FabioGaming Apr 16, 2024
059fc28
Rename dev-autopublish to dev-autopublish.yml
FabioGaming Apr 16, 2024
d76f4d6
Update dev-autopublish.yml
FabioGaming Apr 16, 2024
e786664
Update Amino.NET.csproj
FabioGaming Apr 16, 2024
5d43c10
testing
FabioGaming Apr 17, 2024
745b2ef
testing
FabioGaming Apr 17, 2024
46c89d9
more testing
FabioGaming Apr 17, 2024
d3d534e
even more testing
FabioGaming Apr 17, 2024
2d886b6
ungodly amounts of testing
FabioGaming Apr 17, 2024
1283772
idek anymore atp
FabioGaming Apr 17, 2024
5b187b0
perchance
FabioGaming Apr 17, 2024
0715213
pluh
FabioGaming Apr 17, 2024
d640350
Pluh 2
FabioGaming Apr 17, 2024
61b33df
Update dev-autopublish.yml
FabioGaming Apr 17, 2024
80b88ff
testingggg
FabioGaming Apr 17, 2024
d6c1d59
testing path
FabioGaming Apr 17, 2024
fef89ba
Pluhhh
FabioGaming Apr 17, 2024
6e0f281
refactored some code and added feature
FabioGaming Apr 19, 2024
0bd1bbd
Added more functions
FabioGaming Apr 22, 2024
9a3d58f
Added function template
FabioGaming Apr 22, 2024
0a0bee2
added functions
FabioGaming Apr 25, 2024
bb41fc2
Merge pull request #25 from Amino-NET-Group/feature/add-more-functions
FabioGaming Apr 25, 2024
53e1b4f
started builder class
FabioGaming Apr 25, 2024
ae4ceca
finished demo PostBuilder
FabioGaming May 3, 2024
1f425e7
Merge pull request #26 from Amino-NET-Group/feature/add-builder-class
FabioGaming May 3, 2024
0ee2667
hopefully fixed send_message
FabioGaming May 6, 2024
be91f42
Merge pull request #27 from Amino-NET-Group/patch/fix-messages
FabioGaming May 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# These are supported funding model platforms

github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: fabiogaming
patreon: #
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
ko_fi: fabiothefox
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
custom: ["https://www.paypal.me/FabioTheFox", ]
custom: []
41 changes: 41 additions & 0 deletions .github/workflows/dev-autopublish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Publish NuGet Package

on:
push:
branches:
- dev

jobs:
publish:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: '7.x'

- name: Restore dependencies
run: dotnet restore

- name: Build
run: dotnet build --configuration Release

- name: Determine version
id: version
run: echo "::set-output name=version::0.$((${GITHUB_RUN_NUMBER} / 10)).$((${GITHUB_RUN_NUMBER} % 10))"

- name: Get Project Version
id: base_version
run: |
version=$(grep '<Version>' < Amino.NET/Amino.NET.csproj | sed 's/.*<Version>\(.*\)<\/Version>/\1/')
echo "::set-output name=version::$version"

- name: Pack
run: dotnet pack --configuration Release /p:Version="${{ steps.base_version.outputs.version }}-dev${{ steps.version.outputs.version }}" --output nupkgs

- name: Publish to NuGet
run: dotnet nuget push nupkgs/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json
25 changes: 25 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Dev Test

on:
pull_request:
branches:
- dev

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: '7.x'

- name: Restore dependencies
run: dotnet restore

- name: Build and test
run: dotnet build --configuration Release && dotnet test --no-build --verbosity normal
2 changes: 1 addition & 1 deletion Amino.NET/Amino.NET.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<Version>1.5.1</Version>
<Version>1.5.2</Version>
<Authors>FabioTheFox</Authors>
<Company>FabiDev</Company>
<Description>An unofficial C# wrapper for Aminos REST API for making amino bots and tools</Description>
Expand Down
64 changes: 64 additions & 0 deletions Amino.NET/Builders/PostBuilder.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
using System.Reflection.Metadata.Ecma335;

namespace Amino.NET.Builders
{
public class PostBuilder
{
public byte[] CoverImage { get; private set; }
public byte[] BackgroundImage { get; private set; }
public string BackgroundColor { get; private set; } = "#ffffff";
public string Content { get; set; }
public string Title { get; set; }
public List<(byte[], string?, string?)> MediaList { get; } = new List<(byte[], string?, string?)>();

Check warning on line 15 in Amino.NET/Builders/PostBuilder.cs

View workflow job for this annotation

GitHub Actions / publish

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 15 in Amino.NET/Builders/PostBuilder.cs

View workflow job for this annotation

GitHub Actions / publish

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 15 in Amino.NET/Builders/PostBuilder.cs

View workflow job for this annotation

GitHub Actions / publish

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 15 in Amino.NET/Builders/PostBuilder.cs

View workflow job for this annotation

GitHub Actions / publish

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
public PostTypes PostType { get; set; } = PostTypes.Blog;
public BackgroundTypes BackgroundType { get; set; } = BackgroundTypes.Color;
public bool FansOnly { get; set; }


public void WithCover(byte[] cover)
{
CoverImage = cover;
}
public void WithCover(string coverPath)
{
WithCover(File.ReadAllBytes(coverPath));
}

public void WithBackgroundImage(byte[] media)
{
BackgroundImage = media;
}

public void WithBackgroundImage(string mediaPath)
{
WithBackgroundImage(File.ReadAllBytes(mediaPath));
}

public void AddMedia(byte[] media, string mediaKey = null, string caption = null)
{
MediaList.Add((media, mediaKey, caption));
}

public void AddMedia(string mediaPath, string mediaKey = null, string caption = null)
{
AddMedia(File.ReadAllBytes(mediaPath), mediaKey, caption);
}

public string EmbedImage(string mediaKey) => $"[IMG={mediaKey}]";

public enum PostTypes
{
Blog,
Wiki
}
public enum BackgroundTypes
{
Color,
Image
}

}
}
Loading
Loading