Skip to content

Commit d7d768b

Browse files
fix: InlineKeyboardButton icon parsing
1 parent a1b214c commit d7d768b

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

pyrogram/types/bots_and_keyboards/inline_keyboard_button.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,11 @@
1616
# You should have received a copy of the GNU Lesser General Public License
1717
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
1818

19-
from typing import Union, Optional
19+
from typing import Optional, Union
2020

2121
import pyrogram
22-
from pyrogram import raw
23-
from pyrogram import types
24-
from pyrogram import enums
22+
from pyrogram import enums, raw, types
23+
2524
from ..object import Object
2625

2726

@@ -139,7 +138,8 @@ def read(b: "raw.base.KeyboardButton"):
139138
button_style = enums.ButtonStyle.DANGER
140139
elif raw_style.bg_success:
141140
button_style = enums.ButtonStyle.SUCCESS
142-
elif raw_style.icon:
141+
142+
if raw_style.icon:
143143
icon_custom_emoji_id = str(raw_style.icon)
144144

145145
if isinstance(b, raw.types.KeyboardButtonCallback):

0 commit comments

Comments
 (0)