Signal on the end of pagination handler cycle

This commit is contained in:
Natsu Kagami 2020-02-09 15:08:18 -05:00
parent b0f70fb2a1
commit 5ae8ca5f0e
Signed by: nki
GPG key ID: 73376E117CD20735

View file

@ -117,6 +117,12 @@ impl<T: Pagination> PaginationHandler<T> {
} }
} }
impl<T: Pagination> Drop for PaginationHandler<T> {
fn drop(&mut self) {
self.message.react(&self.ctx, "🛑").ok();
}
}
impl<T: Pagination> ReactionHandler for PaginationHandler<T> { impl<T: Pagination> ReactionHandler for PaginationHandler<T> {
fn handle_reaction(&mut self, reaction: &Reaction, _is_add: bool) -> CommandResult { fn handle_reaction(&mut self, reaction: &Reaction, _is_add: bool) -> CommandResult {
if reaction.message_id != self.message.id { if reaction.message_id != self.message.id {