mirror of
https://github.com/PaiGramTeam/PaiGram.git
synced 2024-11-25 18:04:10 +00:00
14 lines
358 B
Python
14 lines
358 B
Python
|
from telegram.ext import CallbackContext
|
||
|
|
||
|
|
||
|
class BaseJob:
|
||
|
|
||
|
@staticmethod
|
||
|
def remove_job_if_exists(name: str, context: CallbackContext) -> bool:
|
||
|
current_jobs = context.job_queue.get_jobs_by_name(name)
|
||
|
if not current_jobs:
|
||
|
return False
|
||
|
for job in current_jobs:
|
||
|
job.schedule_removal()
|
||
|
return True
|