def wrapped(bot, update, *args, **kwargs): if w_man.get_wave_in_state(wave_state): StatusHandler.handle_status(bot, update, Status.WaveStateAlreadyPresent, state=wave_state) return return func(bot, update, *args, **kwargs)
def wrapped(bot, update, *args, **kwargs): splitted_text = update.message.text.split() if len(splitted_text) != count + 1: StatusHandler.handle_status(bot, update, Status.NotCorrectParametersPassed ) return return func(bot, update, *args, **kwargs)
def assuring_step_handler(bot, update): StatusHandler.handle_status(bot, update, WaveService.start_assuring_step()) try: state, summary = WaveService.finish_wave() StatusHandler.handle_status(bot, update, state, summary=summary) except: StatusHandler.handle_status(bot, update, WaveService.rollback_from_assuring_to_bidding())
def wrapped(bot, update, *args, **kwargs): username = update.effective_user.username if username is None: StatusHandler.handle_status(bot, update, Status.UsernameIsNeeded) return return func(bot, update, *args, **kwargs)
def remove_warn_handler(bot, update): username = update.message.text.split()[1] StatusHandler.handle_status(bot, update, UserService.remove_warn_from_user(username), username=username)
def warn_user_handler(bot, update): username = update.message.text.split()[1] StatusHandler.handle_status(bot, update, UserService.warn_user(username), username=username)
def unprivilege_handler(bot, update): username = update.message.text.split()[1] StatusHandler.handle_status(bot, update, UserService.take_privilege_from_user(username), username=username)
def give_privilege_handler(bot, update): username = update.message.text.split()[1] StatusHandler.handle_status(bot, update, UserService.give_user_privilege(username), username=username)
def start_bidding_handler(bot, update): status, links = WaveService.start_bidding() StatusHandler.handle_status(bot, update, status, links=links)
def create_wave_handler(bot, update): StatusHandler.handle_status(bot, update, WaveService.create_wave())
def wrapped(bot, update, *args, **kwargs): user_id = update.effective_user.id if is_user_banned(user_id): StatusHandler.handle_status(bot, update, Status.Banned) return return func(bot, update, *args, **kwargs)
def wrapped(bot, update, *args, **kwargs): user_id = update.effective_user.id if user_id not in LIST_OF_ADMINS: StatusHandler.handle_status(bot, update, Status.Unauthorized) return return func(bot, update, *args, **kwargs)