Files
LaDOSE/LaDOSE.Src/LaDOSE.DiscordBot/Command/Hokuto.cs

48 lines
1.2 KiB
C#
Raw Normal View History

2021-11-28 02:09:04 +01:00
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
2025-03-07 14:55:00 +01:00
using DSharpPlus.Commands;
using DSharpPlus.Commands.ArgumentModifiers;
using DSharpPlus.Commands.Processors.TextCommands;
2021-11-28 02:09:04 +01:00
using DSharpPlus.Entities;
namespace LaDOSE.DiscordBot.Command
{
2025-03-07 14:55:00 +01:00
public class Hokuto
2021-11-28 02:09:04 +01:00
{
2022-09-14 23:29:22 +02:00
2021-11-28 02:09:04 +01:00
private static List<string> Games = new List<string> { "2X", "3.3", "Karnov" };
private static Random r = new Random();
2022-09-14 23:29:22 +02:00
public Hokuto()
2021-11-28 02:09:04 +01:00
{
2022-09-14 23:29:22 +02:00
2021-11-28 02:09:04 +01:00
}
[Command("hokuto")]
2025-03-07 14:55:00 +01:00
public async ValueTask HokutoUserAsync(TextCommandContext ctx)
2021-11-28 02:09:04 +01:00
{
var i = r.Next(0, 3);
2025-03-07 14:55:00 +01:00
if (ctx.Message.MentionedUsers is { Count: 1 } )
2021-11-28 02:09:04 +01:00
{
2025-03-07 14:55:00 +01:00
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;
}
}
2021-11-28 02:09:04 +01:00
}
else
{
await ctx.RespondAsync(ctx.User?.Mention + " : " + Games[i].ToString());
}
}
}
}