Skip to content

Commit

Permalink
Fixed Button_data_invalid error
Browse files Browse the repository at this point in the history
  • Loading branch information
cubicbyte committed Oct 13, 2023
1 parent 72210ec commit a8e644f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bot/pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ def day_schedule(ctx: ContextManager, date: _date, day: dict) -> dict:
InlineKeyboardButton(text=lang.get('button.navigation.week_next'),
callback_data='open.schedule.day#week&date='
+ (date + timedelta(days=7)).isoformat()
+ f'&rnd={random.random()}'), # Needed to prevent "Message is not modified" error
+ f'&rnd={random.random() :.5f}'), # Needed to prevent "Message is not modified" error
InlineKeyboardButton(text=lang.get('button.menu'), callback_data='open.menu')
]

Expand Down Expand Up @@ -564,7 +564,7 @@ def empty_schedule(ctx: ContextManager, date: _date, schedule: list[dict] | None
InlineKeyboardButton(text=lang.get('button.navigation.week_next'),
callback_data='open.schedule.day#week&date='
+ next_week_date.isoformat()
+ f'&rnd={random.random()}'), # Needed to prevent "Message is not modified" error
+ f'&rnd={random.random() :.5f}'), # Needed to prevent "Message is not modified" error
InlineKeyboardButton(text=lang.get('button.menu'), callback_data='open.menu')
]

Expand Down

0 comments on commit a8e644f

Please sign in to comment.