Updated documentation

This commit is contained in:
2022-05-03 21:58:44 +03:00
parent f3d0ea426e
commit f5f1827540
26 changed files with 520 additions and 180 deletions

View File

@@ -13,10 +13,30 @@ namespace PluginManager.Items
{
internal class Command
{
/// <summary>
/// The author of the command
/// </summary>
public SocketUser Author;
/// <summary>
/// The list of arguments
/// </summary>
public List<string> Arguments { get; private set; }
/// <summary>
/// The command that is executed
/// </summary>
public string CommandName { get; private set; }
/// <summary>
/// The prefix that is used for the command
/// </summary>
public char PrefixUsed { get; private set; }
/// <summary>
/// The Command class contructor
/// </summary>
/// <param name="message">The message that was sent</param>
public Command(SocketMessage message)
{
this.Author = message.Author;
@@ -28,6 +48,11 @@ namespace PluginManager.Items
this.PrefixUsed = data[0][0];
}
/// <summary>
/// The Command class contructor
/// </summary>
/// <param name="message">The message string itself</param>
/// <param name="hasPrefix">True if the message has a prefix, false if not</param>
public Command(string message, bool hasPrefix)
{
string[] data = message.Split(' ');

View File

@@ -1,27 +0,0 @@
using System;
namespace PluginManager.Items
{
public class CustomProgressBar
{
private const char _block = '#';
private const char _emptyBlock = ' ';
private const char _leftMargin = '[';
private const char _rightMargin = ']';
const string _back = "\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b";
public static void WriteProgressBar(int percent)
{
Console.Write(_back);
Console.Write(_leftMargin);
var p = (int)((percent / 10f) + .5f);
for (var i = 0; i < 10; ++i)
{
if (i >= p)
Console.Write(_emptyBlock);
else
Console.Write(_block);
}
Console.Write($"{_rightMargin} " + percent + " %");
}
}
}

View File

@@ -5,13 +5,22 @@ namespace PluginManager.Items
{
public class Spinner
{
/// <summary>
/// True if active, false otherwise
/// </summary>
public bool isSpinning;
/// <summary>
/// The Spinner constructor
/// </summary>
public Spinner()
{
isSpinning = false;
}
/// <summary>
/// The method that is called to start spinning the spinner
/// </summary>
public async void Start()
{
isSpinning = true;
@@ -32,8 +41,13 @@ namespace PluginManager.Items
}
}
/// <summary>
/// The method that is called to stop the spinner from spinning
/// </summary>
public void Stop()
{
if (!isSpinning)
throw new Others.Exceptions.APIException("The spinner was not running", "Stop()");
isSpinning = false;
}
}