-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from Amino-NET-Group/dev
Dev
- Loading branch information
Showing
17 changed files
with
620 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ko_fi: fabiothefox |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Reflection; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Amino.Interactions | ||
{ | ||
public class ParameterInfo | ||
{ | ||
public string Name { get; set; } | ||
public bool IsOptional { get; set; } | ||
} | ||
|
||
public class FunctionAnalyzer | ||
{ | ||
public ParameterInfo[] GetParameters(MethodInfo method) | ||
{ | ||
return method.GetParameters() | ||
.Select(p => new ParameterInfo | ||
{ | ||
Name = p.ParameterType.Name, | ||
IsOptional = p.HasDefaultValue | ||
}) | ||
.ToArray(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,44 @@ | ||
using System; | ||
using Amino.Interactions.Objects; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
using Amino; | ||
using System.Security.Cryptography.X509Certificates; | ||
namespace Amino.Interactions | ||
{ | ||
public class InteractionBase | ||
{ | ||
public Objects.Interaction Context; | ||
|
||
|
||
public Task<Amino.Objects.Message> Respond(Interaction context, string message, bool asReply = true) | ||
{ | ||
SubClient subClient = new SubClient(context.AminoClient, context.Message.communityId.ToString()); | ||
var ReturnMessage = subClient.send_message(message, context.InteractionChatId, replyTo: asReply ? context.Message.messageId : null); | ||
return Task.FromResult(ReturnMessage); | ||
} | ||
|
||
public Task RespondWithFile(Interaction context, byte[] file, Amino.Types.upload_File_Types type = Types.upload_File_Types.Image) | ||
{ | ||
SubClient subClient = new SubClient(context.AminoClient, context.Message.communityId.ToString()); | ||
subClient.send_file_message(context.InteractionChatId, file, type); | ||
return Task.CompletedTask; | ||
} | ||
|
||
public Task RespondWithSticker(Interaction context, string stickerId) | ||
{ | ||
SubClient subClient = new SubClient(context.AminoClient, context.Message.communityId.ToString()); | ||
subClient.send_sticker(context.InteractionChatId, stickerId); | ||
return Task.CompletedTask; | ||
} | ||
|
||
public Task RespondWithEmbed(Interaction context, string content, string embedId = null, string embedLink = null, string embedTitle = null, string embedContent = null, byte[] embedImage = null) | ||
{ | ||
SubClient subClient = new SubClient(context.AminoClient, context.Message.communityId.ToString()); | ||
subClient.send_embed(context.InteractionChatId, content, embedId, embedLink, embedTitle, embedContent, embedImage); | ||
return Task.CompletedTask; | ||
} | ||
|
||
} | ||
} |
Oops, something went wrong.