[Raid] Add test message commands
This commit is contained in:
@@ -10,7 +10,7 @@ namespace Cocotte.Modules.Raids;
|
|||||||
|
|
||||||
[Group("raid", "Raid related commands")]
|
[Group("raid", "Raid related commands")]
|
||||||
[SuppressMessage("Performance", "CA1822:Mark members as static")]
|
[SuppressMessage("Performance", "CA1822:Mark members as static")]
|
||||||
public class RaidModule : InteractionModuleBase<SocketInteractionContext>
|
public partial class RaidModule : InteractionModuleBase<SocketInteractionContext>
|
||||||
{
|
{
|
||||||
private readonly ILogger<RaidModule> _logger;
|
private readonly ILogger<RaidModule> _logger;
|
||||||
private readonly IRaidsRepository _raids;
|
private readonly IRaidsRepository _raids;
|
||||||
|
|||||||
53
Cocotte/Modules/Raids/RaidModuleDebug.cs
Normal file
53
Cocotte/Modules/Raids/RaidModuleDebug.cs
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
using Cocotte.Utils;
|
||||||
|
using Discord;
|
||||||
|
using Discord.Interactions;
|
||||||
|
|
||||||
|
namespace Cocotte.Modules.Raids;
|
||||||
|
|
||||||
|
#if DEBUG
|
||||||
|
public partial class RaidModule
|
||||||
|
{
|
||||||
|
|
||||||
|
[MessageCommand("Add dps")]
|
||||||
|
public async Task AddDps(IMessage message)
|
||||||
|
{
|
||||||
|
await AddTestPlayer(message, PlayerRole.Dps);
|
||||||
|
}
|
||||||
|
|
||||||
|
[MessageCommand("Add tank")]
|
||||||
|
public async Task AddTank(IMessage message)
|
||||||
|
{
|
||||||
|
await AddTestPlayer(message, PlayerRole.Tank);
|
||||||
|
}
|
||||||
|
|
||||||
|
[MessageCommand("Add healer")]
|
||||||
|
public async Task AddHealer(IMessage message)
|
||||||
|
{
|
||||||
|
await AddTestPlayer(message, PlayerRole.Healer);
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task AddTestPlayer(IMessage message, PlayerRole playerRole)
|
||||||
|
{
|
||||||
|
if (message is IUserMessage userMessage && userMessage.Author.IsBot)
|
||||||
|
{
|
||||||
|
if (_raids.TryGetRaid(userMessage.Id, out var raid))
|
||||||
|
{
|
||||||
|
raid.AddPlayer(new RosterPlayer(
|
||||||
|
(ulong) Random.Shared.NextInt64(),
|
||||||
|
$"Player{Random.Shared.Next(1, 100)}",
|
||||||
|
playerRole,
|
||||||
|
(uint) (1000 * Random.Shared.Next(30, 60)),
|
||||||
|
Random.Shared.Next(0, 2) == 0)
|
||||||
|
);
|
||||||
|
|
||||||
|
await UpdateRaidRosterEmbed(raid);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
await RespondAsync(
|
||||||
|
embed: EmbedUtils.SuccessEmbed($"Successfully added a {playerRole} player").Build(),
|
||||||
|
ephemeral: true
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
Reference in New Issue
Block a user