oh yeah woo yeah
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Kehyeedra/Kehyeedra3/Services/ButtonService.cs

116 lines
4.3 KiB

using Discord;
using Discord.Addons.Interactive;
using Discord.Commands;
using Discord.WebSocket;
using Kehyeedra3.Services.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Kehyeedra3.Buttons
{
public static class ButtonService // button testing
{
public static void RegisterCumButtons(DiscordSocketClient client)
{
client.InteractionCreated += HandleCumButtons;
}
private static async Task HandleCumButtons(SocketInteraction arg)
{
if (arg.Type == InteractionType.MessageComponent)
{
var parsedArg = (SocketMessageComponent)arg;
switch (parsedArg.Data.CustomId)
{
case "cum":
{
await parsedArg.Message.ModifyAsync(z => { z.Components = null; });
await parsedArg.FollowupAsync("You have selected cum, prepare to die");
}
break;
case "piss":
{
await parsedArg.Message.ModifyAsync(z => { z.Components = null; });
await parsedArg.FollowupAsync("You have selected piss, prepare to shit");
}
break;
}
}
}
public static void RegisterFarmButtons(DiscordSocketClient client)
{
client.InteractionCreated += HandleFarmButtons;
}
private static async Task HandleFarmButtons(SocketInteraction arg)
{
if (arg.Type == InteractionType.MessageComponent)
{
var parsedArg = (SocketMessageComponent)arg;
Dictionary<FarmCrop, int[]> items = new Dictionary<FarmCrop, int[]>();
List<FCrop> crops = Farming.ListCrops();
List<FLand> plots = Farming.ListFarmLand();
FarmTier tier = FarmTier.T0;
string cropitemtxt = "";
string plotitemtxt = "";
switch (parsedArg.Data.CustomId)
{
//case "crop":
// {
// foreach (FCrop i in crops)
// {
// if (i.Price > 0 && (int)tier >= (int)i.Tier)
// {
// cropitemtxt += $"{(int)i.Id} : {i.Name} Seed for {((long)i.Price).ToYeedraDisplay()}%\n";
// }
// }
// await parsedArg.Message.ModifyAsync(z => { z.Components = null; });
// if (cropitemtxt != "")
// {
// await parsedArg.FollowupAsync($"Select an item\n{cropitemtxt}");
// }
// else
// {
// await parsedArg.FollowupAsync($"There is nothing you can buy right now.");
// }
// }
// break;
//case "plot":
// {
// foreach (FLand i in plots)
// {
// if (i.Price > 0 && (int)tier >= (int)i.Tier)
// {
// plotitemtxt += $"{(int)i.Id} : {i.Name} for {((long)i.Price).ToYeedraDisplay()}%\n";
// }
// }
// await parsedArg.Message.ModifyAsync(z => { z.Components = null; });
// if (plotitemtxt != "")
// {
// await parsedArg.FollowupAsync($"Select an item\n{plotitemtxt}");
// }
// else
// {
// await parsedArg.FollowupAsync($"There is nothing you can buy right now.");
// }
// }
// break;
}
}
}
}
}