vassago/Behavior/WishLuck.cs

33 lines
821 B
C#
Raw Normal View History

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.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 WishLuck : Behavior
{
public override string Name => "wish me luck";
public override string Trigger => "wish me luck";
public override string Description => "wishes you luck";
2023-06-19 11:03:06 -04:00
public override async Task<bool> ActOn(Message message)
2023-06-19 01:14:04 -04:00
{
var toSend = "☘️";
2023-06-19 01:14:04 -04:00
if (Shared.r.Next(20) == 0)
{
toSend = "\U0001f340";//4-leaf clover
2023-06-19 01:14:04 -04:00
}
if(message.Channel.EffectivePermissions.ReactionsPossible == true)
await message.React(toSend);
2023-06-19 01:14:04 -04:00
else
await message.Channel.SendMessage(toSend);
2023-06-19 01:14:04 -04:00
return true;
}
}