1
0
Fork 1
mirror of https://github.com/TeamOctolings/Octobot.git synced 2025-05-02 20:19:55 +03:00

Async command handling

This commit is contained in:
Octol1ttle 2022-08-29 21:24:38 +05:00
parent 51c24c1e23
commit 53f13d88a5
Signed by: Octol1ttle
GPG key ID: B77C34313AEE1FFF
7 changed files with 54 additions and 40 deletions

View file

@ -65,12 +65,10 @@ public class BanCommand : Command {
await Utils.SendFeedback(feedback, guild.Id, author.Mention, true);
if (duration.TotalSeconds > 0) {
async void DelayUnban() {
var _ = async () => {
await Task.Delay(duration);
await UnbanCommand.UnbanUser(guild, guild.CurrentUser, toBan, Messages.PunishmentExpired);
}
new Task(DelayUnban).Start();
};
}
}
}
}