-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDelegates.cs
More file actions
75 lines (66 loc) · 3.15 KB
/
Delegates.cs
File metadata and controls
75 lines (66 loc) · 3.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
using System;
using System.Threading.Tasks;
using Ultz.Extensions.Commands.Built;
using Ultz.Extensions.Commands.Context;
using Ultz.Extensions.Commands.Cooldown;
using Ultz.Extensions.Commands.Results;
using Ultz.Extensions.Commands.Results.User;
namespace Ultz.Extensions.Commands
{
/// <summary>
/// Represents a <see cref="void" /> <see cref="Command" /> callback method.
/// </summary>
/// <param name="context"> The <see cref="CommandContext" /> used for execution. </param>
public delegate void VoidCommandCallbackDelegate(CommandContext context);
/// <summary>
/// Represents a <see cref="CommandResult" /> <see cref="Command" /> callback method.
/// </summary>
/// <param name="context"> The <see cref="CommandContext" /> used for execution. </param>
/// <returns>
/// A <see cref="CommandResult" />.
/// </returns>
public delegate CommandResult ResultCommandCallbackDelegate(CommandContext context);
/// <summary>
/// Represents a <see cref="Task" /> <see cref="Command" /> callback method.
/// </summary>
/// <param name="context"> The <see cref="CommandContext" /> used for execution. </param>
/// <returns>
/// A <see cref="Task" />.
/// </returns>
public delegate Task TaskCommandCallbackDelegate(CommandContext context);
/// <summary>
/// Represents a <see cref="Command" /> callback method.
/// </summary>
/// <param name="context"> The <see cref="CommandContext" /> used for execution. </param>
/// <returns>
/// A <see cref="Task{TResult}" /> where TResult is a <see cref="CommandResult" />.
/// </returns>
public delegate Task<CommandResult> TaskResultCommandCallbackDelegate(CommandContext context);
/// <summary>
/// Represents a <see cref="ValueTask" /> <see cref="Command" /> callback method.
/// </summary>
/// <param name="context"> The <see cref="CommandContext" /> used for execution. </param>
/// <returns>
/// A <see cref="ValueTask" />.
/// </returns>
public delegate ValueTask ValueTaskCommandCallbackDelegate(CommandContext context);
/// <summary>
/// Represents a <see cref="Command" /> callback method.
/// </summary>
/// <param name="context"> The <see cref="CommandContext" /> used for execution. </param>
/// <returns>
/// A <see cref="ValueTask{TResult}" /> where TResult is a <see cref="CommandResult" />.
/// </returns>
public delegate ValueTask<CommandResult> ValueTaskResultCommandCallbackDelegate(CommandContext context);
/// <summary>
/// Represents a <see cref="Cooldown" /> bucket key generator callback method.
/// </summary>
/// <param name="bucketType"> The <see langword="enum" /> bucket type. </param>
/// <param name="context"> The <see cref="CommandContext" /> used for execution. </param>
/// <returns>
/// A <see cref="Cooldown" /> bucket key.
/// </returns>
public delegate object CooldownBucketKeyGeneratorDelegate(Enum bucketType, CommandContext context);
internal delegate Task<IResult> ModuleBaseCommandCallbackDelegate(CommandContext context);
internal delegate bool TryParseDelegate<T>(ReadOnlySpan<char> value, out T result);
}