mirror of
https://github.com/TeamPGM/PagerMaid-Pyro.git
synced 2024-11-24 04:58:12 +00:00
🚑 hotfix: listen KeyError bug
This commit is contained in:
parent
a3ee603cd2
commit
f66530ac87
@ -18,7 +18,9 @@ You should have received a copy of the GNU General Public License
|
||||
along with pyromod. If not, see <https://www.gnu.org/licenses/>.
|
||||
"""
|
||||
|
||||
|
||||
import asyncio
|
||||
import contextlib
|
||||
import functools
|
||||
from typing import Optional, List, Union
|
||||
|
||||
@ -70,8 +72,9 @@ class Client:
|
||||
|
||||
@patchable
|
||||
def clear_listener(self, chat_id, future):
|
||||
if future == self.listening[chat_id]["future"]:
|
||||
self.listening.pop(chat_id, None)
|
||||
with contextlib.suppress(KeyError):
|
||||
if future == self.listening[chat_id]["future"]:
|
||||
self.listening.pop(chat_id, None)
|
||||
|
||||
@patchable
|
||||
def cancel_listener(self, chat_id):
|
||||
|
Loading…
Reference in New Issue
Block a user