Fix DiscordBot
All checks were successful
Build App / Build (push) Successful in 1m41s

This commit is contained in:
2025-03-07 14:55:00 +01:00
parent e99479d8fb
commit 9d8a7b3100
5 changed files with 88 additions and 151 deletions

View File

@@ -2,14 +2,15 @@
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using DSharpPlus.CommandsNext;
using DSharpPlus.CommandsNext.Attributes;
using DSharpPlus.Commands;
using DSharpPlus.Commands.ArgumentModifiers;
using DSharpPlus.Commands.Processors.TextCommands;
using DSharpPlus.Entities;
namespace LaDOSE.DiscordBot.Command
{
public class Hokuto : BaseCommandModule
public class Hokuto
{
private static List<string> Games = new List<string> { "2X", "3.3", "Karnov" };
@@ -21,14 +22,21 @@ namespace LaDOSE.DiscordBot.Command
[Command("hokuto")]
public async Task HokutoUserAsync(CommandContext ctx, params DiscordMember[] user)
public async ValueTask HokutoUserAsync(TextCommandContext ctx)
{
var i = r.Next(0, 3);
if (user!=null && user.Length>0)
if (ctx.Message.MentionedUsers is { Count: 1 } )
{
await ctx.RespondAsync(ctx.User?.Mention + " vs " + user[0].Mention + " : " + Games[i].ToString());
foreach (var arg in ctx.Message.MentionedUsers)
{
if (arg is DiscordUser member)
{
await ctx.RespondAsync(ctx.User?.Mention + " vs " + member.Mention + " : " + Games[i].ToString());
return;
}
}
}
else
{