|
7 | 7 |
|
8 | 8 | from enum import Enum |
9 | 9 |
|
10 | | -import six |
11 | 10 |
|
12 | 11 | from .utils import sjson_dumps |
13 | 12 |
|
@@ -109,7 +108,7 @@ def add_button(self, label, color=VkKeyboardColor.SECONDARY, payload=None): |
109 | 108 | if isinstance(color, VkKeyboardColor): |
110 | 109 | color_value = color_value.value |
111 | 110 |
|
112 | | - if payload is not None and not isinstance(payload, six.string_types): |
| 111 | + if payload is not None and not isinstance(payload, str): |
113 | 112 | payload = sjson_dumps(payload) |
114 | 113 |
|
115 | 114 | button_type = VkKeyboardButton.TEXT.value |
@@ -145,7 +144,7 @@ def add_callback_button(self, label, color=VkKeyboardColor.SECONDARY, payload=No |
145 | 144 | if isinstance(color, VkKeyboardColor): |
146 | 145 | color_value = color_value.value |
147 | 146 |
|
148 | | - if payload is not None and not isinstance(payload, six.string_types): |
| 147 | + if payload is not None and not isinstance(payload, str): |
149 | 148 | payload = sjson_dumps(payload) |
150 | 149 |
|
151 | 150 | button_type = VkKeyboardButton.CALLBACK.value |
@@ -174,7 +173,7 @@ def add_location_button(self, payload=None): |
174 | 173 | 'This type of button takes the entire width of the line' |
175 | 174 | ) |
176 | 175 |
|
177 | | - if payload is not None and not isinstance(payload, six.string_types): |
| 176 | + if payload is not None and not isinstance(payload, str): |
178 | 177 | payload = sjson_dumps(payload) |
179 | 178 |
|
180 | 179 | button_type = VkKeyboardButton.LOCATION.value |
@@ -204,7 +203,7 @@ def add_vkpay_button(self, hash, payload=None): |
204 | 203 | 'This type of button takes the entire width of the line' |
205 | 204 | ) |
206 | 205 |
|
207 | | - if payload is not None and not isinstance(payload, six.string_types): |
| 206 | + if payload is not None and not isinstance(payload, str): |
208 | 207 | payload = sjson_dumps(payload) |
209 | 208 |
|
210 | 209 | button_type = VkKeyboardButton.VKPAY.value |
@@ -242,7 +241,7 @@ def add_vkapps_button(self, app_id, owner_id, label, hash, payload=None): |
242 | 241 | 'This type of button takes the entire width of the line' |
243 | 242 | ) |
244 | 243 |
|
245 | | - if payload is not None and not isinstance(payload, six.string_types): |
| 244 | + if payload is not None and not isinstance(payload, str): |
246 | 245 | payload = sjson_dumps(payload) |
247 | 246 |
|
248 | 247 | button_type = VkKeyboardButton.VKAPPS.value |
@@ -274,7 +273,7 @@ def add_openlink_button(self, label, link, payload=None): |
274 | 273 | if len(current_line) >= MAX_BUTTONS_ON_LINE: |
275 | 274 | raise ValueError(f'Max {MAX_BUTTONS_ON_LINE} buttons on a line') |
276 | 275 |
|
277 | | - if payload is not None and not isinstance(payload, six.string_types): |
| 276 | + if payload is not None and not isinstance(payload, str): |
278 | 277 | payload = sjson_dumps(payload) |
279 | 278 |
|
280 | 279 | button_type = VkKeyboardButton.OPENLINK.value |
|
0 commit comments