Git Product home page Git Product logo

guilded.net's Introduction

Banner

๐ŸŸก Guilded.NET

Guilded.NET is a free and open-source unofficial API framework/library for Guilded written on .NET platform. It allows creating bots, webhooks and interacting any other way with Guilded API.

Version Version

๐Ÿ“ฅ Installing

Guilded.NET is available as a package on NuGet (or FuGet).

You can run this command to add Guilded.NET to an existing .NET project:

dotnet add package Guilded

Otherwise, you can install Guilded.NET templates and create new Guilded.NET projects:

dotnet new -i Guilded.Templates
dotnet new guilded.bot

โš™๏ธ Using Guilded.NET

You can check out Guilded.NET's guide to get started on your bot. If you want to see everything that Guilded.NET offers, check out reference page.

It is recommended to use .NET 6 or above for Guilded.NET. While Guilded.NET supports .NET 5 or similar for now, this will definitely change in the future.

๐Ÿ“™ Example

Here's a quick example of a starter Guilded.NET bot with a !ping command:

// Program.cs
using System.Reactive.Linq;
using Guilded;

string auth   = "your_bots_auth_token",
       prefix = "!";

await using var client = new GuildedBotClient(auth);

client
    .Prepared
    .Subscribe(me =>
        Console.WriteLine("The bot is prepared!\nLogged in as \"{0}\" with the ID \"{1}\"", me.Name, me.Id)
    );

// Wait for !ping messages
client
    .MessageCreated
    .Where(msgCreated => msgCreated.Content == prefix + "ping")
    .Subscribe(async msgCreated =>
        await msgCreated.ReplyAsync("Pong!")
    );

await client.ConnectAsync();

// Don't close the program when the bot connects; not recommended to put code after this
await Task.Delay(-1);

Note: The code above uses enabled implicit usings option.

โ‰๏ธ Support

If you need any help related to Guilded.NET, you can check out the following sources:

โœ… Goals

Our goal is to provide a library that is consistent and fast, while also maintaining ease of use. A library that does not bite a developer's hand allows them to focus more heavily on their code, have fun in what they are doing along, and have an easier time making bots. The consistency of code helps increase readability and collaboration.

guilded.net's People

Contributors

atomisadev avatar brixsterplanet avatar idkgoodname avatar unreal852 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

guilded.net's Issues

Guilded.Templates failing

Bug Description

After installing Guilded.Templates, whenever I try to use it (dotnet new guilded.bot), it prints the following error:

Unable to resolve the template, the following installed templates are conflicting:
[a table that doesn't paste well, see screenshot below]

The package Guilded.Templates is not correct, uninstall it and report the issue to the package author.

To reproduce

  1. Install Guilded.Templates using dotnet new -i Guilded.Templates
  2. Try to create a new project using dotnet new guilded.bot (also works for guilded.command)

Expected behavior

For it to create the project.

Information

  • OS: Linux 6.0.1-arch2-1 x86_64
  • Version: Guilded.Templates::0.9.3 | dotnet 6.0.110

Additional Information

image

Property or indexer 'AbstractGuildedClient.Prepared' cannot be assigned to -- it is read only

Bug Description

Property or indexer 'AbstractGuildedClient.Prepared' cannot be assigned to -- it is read only.
Cannot assign an event to the prepared event.

To reproduce

1: Create an console app with .Net 6
2: Add Guilded nuget to the project and copy & paste the documentation's example to the program.cs
3: Error shows in the Error List

Expected behavior

The prepared isn't readonly, since we are required to assign an event to it.

Information

  • OS: Windows 10
  • Version: 0.7.4

Additional Information

  • Connected, disconnected and reconnected event also have the same issue as prepared. Common issue?

UploadFile Error

Bug Description

cannot upload any file

To reproduce

var FilePath = "tfisthis.png";
var FileData = await File.ReadAllBytesAsync(FilePath);
var FileURL = await Client.UploadFileAsync(FilePath, FileData);

Expected behavior

System.AggregateException: 'One or more errors occurred. (The given form ID string is not in correct format)'
FormatException: The given form ID string is not in correct format

Information

  • OS: Win11
  • Version: 1.7.1

Additional Information

${\textsf{\color{IndianRed}StackTrace}}$ at Guilded.Commands.Items.Command.<>c.b__28_1(Task task) in Guilded.Commands.Items\Command.cs:line 172 at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state) in /_/src/libraries/System.Private.CoreLib/src/System/Threading/ExecutionContext.cs:line 264 --- End of stack trace from previous location --- at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state) in /_/src/libraries/System.Private.CoreLib/src/System/Threading/ExecutionContext.cs:line 289 at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread) in /_/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs:line 2349 --- End of stack trace from previous location --- at Guilded.Commands.CommandParent.d__14.MoveNext() in Guilded.Commands\CommandParent.cs:line 78 at Guilded.Commands.CommandModule.d__2.MoveNext() in Guilded.Commands\CommandModule.cs:line 31 at Guilded.Commands.CommandModule.d__4.MoveNext() in Guilded.Commands\CommandModule.cs:line 51 at Guilded.Commands.CommandModule.<>c__DisplayClass6_0.<b__1>d.MoveNext() in Guilded.Commands\CommandModule.cs:line 72 at System.Threading.Tasks.Task.<>c.b__128_1(Object state) in /_/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs:line 1929 at System.Threading.ThreadPoolWorkQueue.Dispatch() in /_/src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPoolWorkQueue.cs:line 913 at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart() in /_/src/libraries/System.Private.CoreLib/src/System/Threading/PortableThreadPool.WorkerThread.NonBrowser.cs:line 102

This exception was originally thrown at this call stack:
Guilded.Base.FormId.FormId(string)
Guilded.Base.FormId.Random.get()
Guilded.Base.BaseGuildedService.UploadFileAsync(string, byte[], string)
Core.Modules.InfoModule.CaptAsync(Guilded.Commands.CommandEvent) in Module.cs
Guilded.Commands.Items.Command.InvokeAsync.AnonymousMethod__0() in Command.cs

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.