mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-01 06:00:46 +00:00
Misc
This commit is contained in:
@@ -33,7 +33,11 @@ namespace ArchiSteamFarm.CustomPlugins.ExamplePlugin {
|
|||||||
private const string URL = "https://aws.random.cat";
|
private const string URL = "https://aws.random.cat";
|
||||||
|
|
||||||
[ItemCanBeNull]
|
[ItemCanBeNull]
|
||||||
internal static async Task<string> GetRandomCatURL([JetBrains.Annotations.NotNull] WebBrowser webBrowser) {
|
internal static async Task<string> GetRandomCatURL([NotNull] WebBrowser webBrowser) {
|
||||||
|
if (webBrowser == null) {
|
||||||
|
throw new ArgumentNullException(nameof(webBrowser));
|
||||||
|
}
|
||||||
|
|
||||||
const string request = URL + "/meow";
|
const string request = URL + "/meow";
|
||||||
|
|
||||||
WebBrowser.ObjectResponse<MeowResponse> response = await webBrowser.UrlGetToJsonObject<MeowResponse>(request).ConfigureAwait(false);
|
WebBrowser.ObjectResponse<MeowResponse> response = await webBrowser.UrlGetToJsonObject<MeowResponse>(request).ConfigureAwait(false);
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ namespace ArchiSteamFarm.CustomPlugins.ExamplePlugin {
|
|||||||
// Your plugin class should inherit the plugin interfaces it wants to handle
|
// Your plugin class should inherit the plugin interfaces it wants to handle
|
||||||
// If you do not want to handle a particular action (e.g. OnBotMessage that is offered in IBotMessage), it's the best idea to not inherit it at all
|
// If you do not want to handle a particular action (e.g. OnBotMessage that is offered in IBotMessage), it's the best idea to not inherit it at all
|
||||||
// This will keep your code compact, efficient and less dependent. You can always add additional interfaces when you'll need them, this example project will inherit quite a bit of them to show you potential usage
|
// This will keep your code compact, efficient and less dependent. You can always add additional interfaces when you'll need them, this example project will inherit quite a bit of them to show you potential usage
|
||||||
// ReSharper disable once UnusedMember.Global - this is example plugin class that isn't used in our main code
|
// ReSharper disable once UnusedType.Global - this is example plugin class that isn't used in our main code
|
||||||
internal sealed class ExamplePlugin : IASF, IBot, IBotCommand, IBotConnection, IBotFriendRequest, IBotMessage, IBotModules, IBotTradeOffer {
|
internal sealed class ExamplePlugin : IASF, IBot, IBotCommand, IBotConnection, IBotFriendRequest, IBotMessage, IBotModules, IBotTradeOffer {
|
||||||
// This is used for identification purposes, typically you want to use a friendly name of your plugin here, such as the name of your main class
|
// This is used for identification purposes, typically you want to use a friendly name of your plugin here, such as the name of your main class
|
||||||
// Please note that this property can have direct dependencies only on structures that were initialized by the constructor, as it's possible to be called before OnLoaded() takes place
|
// Please note that this property can have direct dependencies only on structures that were initialized by the constructor, as it's possible to be called before OnLoaded() takes place
|
||||||
|
|||||||
Reference in New Issue
Block a user