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:
parent
51c24c1e23
commit
53f13d88a5
7 changed files with 54 additions and 40 deletions
|
@ -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();
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue