2023-06-19 01:14:04 -04:00
|
|
|
namespace vassago.Behavior;
|
|
|
|
|
|
|
|
using System;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.IO;
|
|
|
|
using System.Linq;
|
|
|
|
using System.Text.RegularExpressions;
|
|
|
|
using System.Threading;
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
using vassago.Models;
|
|
|
|
|
2023-06-20 21:26:44 -04:00
|
|
|
[StaticPlz]
|
2023-06-19 01:14:04 -04:00
|
|
|
public class Gratitude : Behavior
|
|
|
|
{
|
|
|
|
public override string Name => "Gratitude";
|
|
|
|
|
|
|
|
public override string Trigger => "thank me";
|
|
|
|
|
2023-06-19 11:03:06 -04:00
|
|
|
public override bool ShouldAct(Message message)
|
2023-06-19 01:14:04 -04:00
|
|
|
{
|
2024-01-05 21:39:31 -05:00
|
|
|
if(Behaver.Instance.IsSelf(message.Author.Id))
|
2023-06-20 21:26:44 -04:00
|
|
|
return false;
|
2024-01-05 21:39:31 -05:00
|
|
|
|
2023-06-19 01:14:04 -04:00
|
|
|
return Regex.IsMatch(message.Content, "\\bthank (yo)?u\\b", RegexOptions.IgnoreCase) && message.MentionsMe;
|
|
|
|
}
|
2023-06-19 11:03:06 -04:00
|
|
|
public override async Task<bool> ActOn(Message message)
|
2023-06-19 01:14:04 -04:00
|
|
|
{
|
|
|
|
|
|
|
|
switch (Shared.r.Next(4))
|
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
await message.Channel.SendMessage("you're welcome, citizen!");
|
|
|
|
break;
|
|
|
|
case 1:
|
2023-06-20 21:38:25 -04:00
|
|
|
await message.React(":)");
|
2023-06-19 01:14:04 -04:00
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
await message.React("\U0001F607"); //smiling face with halo
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
switch (Shared.r.Next(9))
|
|
|
|
{
|
|
|
|
case 0:
|
2023-06-20 21:38:25 -04:00
|
|
|
await message.React("<3"); //normal heart, usually rendered red
|
2023-06-19 01:14:04 -04:00
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
await message.React("\U0001F9E1"); //orange heart
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
await message.React("\U0001F49B"); //yellow heart
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
await message.React("\U0001F49A"); //green heart
|
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
await message.React("\U0001F499"); //blue heart
|
|
|
|
break;
|
|
|
|
case 5:
|
|
|
|
await message.React("\U0001F49C"); //purple heart
|
|
|
|
break;
|
|
|
|
case 6:
|
|
|
|
await message.React("\U0001F90E"); //brown heart
|
|
|
|
break;
|
|
|
|
case 7:
|
|
|
|
await message.React("\U0001F5A4"); //black heart
|
|
|
|
break;
|
|
|
|
case 8:
|
|
|
|
await message.React("\U0001F90D"); //white heart
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|