mirror of
https://github.com/barelyprofessional/KfChatDotNet.git
synced 2026-05-02 04:22:04 -04:00
Auto cleanup not working :( trying a different method
This commit is contained in:
@@ -427,9 +427,9 @@ public class ChatBot
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="message">The message you want to delete</param>
|
/// <param name="message">The message you want to delete</param>
|
||||||
/// <param name="deleteAfter">When you want it deleted</param>
|
/// <param name="deleteAfter">When you want it deleted</param>
|
||||||
public async Task ScheduleMessageAutoDelete(SentMessageTrackerModel message, TimeSpan deleteAfter)
|
public void ScheduleMessageAutoDelete(SentMessageTrackerModel message, TimeSpan deleteAfter)
|
||||||
{
|
{
|
||||||
_ = SendChatMessageAsyncAutoDeleteTask(message, deleteAfter);
|
_ = Task.Run(() => SendChatMessageAsyncAutoDeleteTask(message, deleteAfter), _cancellationToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task SendChatMessageAsyncAutoDeleteTask(SentMessageTrackerModel message, TimeSpan deleteAfter)
|
private async Task SendChatMessageAsyncAutoDeleteTask(SentMessageTrackerModel message, TimeSpan deleteAfter)
|
||||||
|
|||||||
@@ -176,7 +176,7 @@ public class KenoCommand : ICommand
|
|||||||
await botInstance.SendChatMessageAsync(
|
await botInstance.SendChatMessageAsync(
|
||||||
$"{user.FormatUsername()}, you [color={colors[BuiltIn.Keys.KiwiFarmsGreenColor].Value}]won {await win.FormatKasinoCurrencyAsync()} with a {payoutMulti}x multi![/color]. Your balance is now: {await newBalance.FormatKasinoCurrencyAsync()}.",
|
$"{user.FormatUsername()}, you [color={colors[BuiltIn.Keys.KiwiFarmsGreenColor].Value}]won {await win.FormatKasinoCurrencyAsync()} with a {payoutMulti}x multi![/color]. Your balance is now: {await newBalance.FormatKasinoCurrencyAsync()}.",
|
||||||
true, autoDeleteAfter: cleanupDelay);
|
true, autoDeleteAfter: cleanupDelay);
|
||||||
await botInstance.ScheduleMessageAutoDelete(_kenoTable, cleanupDelay);
|
botInstance.ScheduleMessageAutoDelete(_kenoTable, cleanupDelay);
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task AnimatedDisplayTable(List<int> playerNumbers, List<int> casinoNumbers, List<int> matches, ChatBot botInstance)
|
private async Task AnimatedDisplayTable(List<int> playerNumbers, List<int> casinoNumbers, List<int> matches, ChatBot botInstance)
|
||||||
@@ -494,7 +494,7 @@ public class Planes : ICommand
|
|||||||
await botInstance.SendChatMessageAsync(
|
await botInstance.SendChatMessageAsync(
|
||||||
$"{user.FormatUsername()}, you [color={colors[BuiltIn.Keys.KiwiFarmsRedColor].Value}]crashed![/color] Your balance is now: {await newBalance.FormatKasinoCurrencyAsync()}",
|
$"{user.FormatUsername()}, you [color={colors[BuiltIn.Keys.KiwiFarmsRedColor].Value}]crashed![/color] Your balance is now: {await newBalance.FormatKasinoCurrencyAsync()}",
|
||||||
true, autoDeleteAfter: cleanupDelay);
|
true, autoDeleteAfter: cleanupDelay);
|
||||||
await botInstance.ScheduleMessageAutoDelete(msgId, cleanupDelay);
|
botInstance.ScheduleMessageAutoDelete(msgId, cleanupDelay);
|
||||||
}
|
}
|
||||||
|
|
||||||
private string GetPreGameBoard(int fullCounter, int[,] planesBoard, Plane plane, int carrierCount, bool noseUp)
|
private string GetPreGameBoard(int fullCounter, int[,] planesBoard, Plane plane, int carrierCount, bool noseUp)
|
||||||
|
|||||||
Reference in New Issue
Block a user