feat: implement automatic Discord.NET adapter/autoposter#31
feat: implement automatic Discord.NET adapter/autoposter#31null8626 wants to merge 10 commits intoTop-gg-Community:masterfrom
Conversation
DiscordBotsList.Api.Adapter.Discord.Net/DiscordBotsList.Api.Adapter.Discord.Net.csproj
Show resolved
Hide resolved
| public virtual Task RunAsync() | ||
| { | ||
| throw new NotImplementedException(); | ||
| } |
There was a problem hiding this comment.
Intended to be implemented by this class' child classes. In this case, SubmissionAdapter.
Adapter's role is to implement the actual Task loop that does the autoposting, regardless of Discord bot library-specific implementation. It implements the IAdapter interface which is from DiscordBotsList.Api.Objects.
SubmissionAdapter's role is to implement Discord.NET-specific operations, or in this case await api.UpdateBotServerCountAsync((await client.GetGuildsAsync()).Count);
SubmissionAdapter is lifted from the older version of the SDK, it was an internal class so I made it public.
There was a problem hiding this comment.
Adapter's role is to implement the actual Task loop that does the autoposting, regardless of Discord bot library-specific implementation. It implements the IAdapter interface which is from DiscordBotsList.Api.Objects.
Okay makes sense. I would recommend using a BackgroundWorker then. https://learn.microsoft.com/en-us/dotnet/api/system.componentmodel.backgroundworker?view=net-9.0
There was a problem hiding this comment.
These adapters were a part of the old version of the SDK, but an automatic implementation that does it did not exist.
There was a problem hiding this comment.
Adapter's role is to implement the actual Task loop that does the autoposting, regardless of Discord bot library-specific implementation. It implements the IAdapter interface which is from DiscordBotsList.Api.Objects.
Okay makes sense. I would recommend using a BackgroundWorker then. https://learn.microsoft.com/en-us/dotnet/api/system.componentmodel.backgroundworker?view=net-9.0
Sure.
|
|
||
| namespace DiscordBotsList.Api.Adapter.Discord.Net | ||
| { | ||
| public class Adapter : IAdapter |
There was a problem hiding this comment.
Don't really understand what this does? Why not just use BackgroundWorker?
1777e31 to
128cbed
Compare
b492f68 to
0bcec1c
Compare
|
Closed as it's removed alongside other v0 features in the next major update. |
The following pull request is a toned down version of #29. This pull request focuses solely on adding an actual automatic adapter for Discord.NET (a.k.a. autoposter.)