Telegram User Bot that plays uno with mau_mau_bot
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

208 lines
9.4 KiB

  1. #!/usr/bin/env python3
  2. # -*- coding: utf-8 -*-
  3. RED = 'r'
  4. BLUE = 'b'
  5. GREEN = 'g'
  6. YELLOW = 'y'
  7. COLORS = (RED, BLUE, GREEN, YELLOW)
  8. # Special cards
  9. CHOOSE = 'colorchooser'
  10. DRAW_FOUR = 'draw_four'
  11. SPECIALS = (CHOOSE, DRAW_FOUR)
  12. # those stickers below are only used for grey cards.
  13. # NOGREY is not used now
  14. # can't be used for userbot
  15. NOGREY = {
  16. 'BQADBAAD-AIAAl9XmQABxEjEcFM-VHIC': 'option_draw',
  17. 'BQADBAAD-gIAAl9XmQABcEkAAbaZ4SicAg': 'option_pass',
  18. 'BQADBAADygIAAl9XmQABJoLfB9ntI2UC': 'option_bluff',
  19. 'BQADBAADxAIAAl9XmQABC5v3Z77VLfEC': 'option_info'
  20. }
  21. # STICKERS is not used now
  22. # can't be used for userbot
  23. STICKERS = {
  24. 'BQADBAAD2QEAAl9XmQAB--inQsYcLTsC': 'b_0',
  25. 'BQADBAAD2wEAAl9XmQABBzh4U-rFicEC': 'b_1',
  26. 'BQADBAAD3QEAAl9XmQABo3l6TT0MzKwC': 'b_2',
  27. 'BQADBAAD3wEAAl9XmQAB2y-3TSapRtIC': 'b_3',
  28. 'BQADBAAD4QEAAl9XmQABT6nhOuolqKYC': 'b_4',
  29. 'BQADBAAD4wEAAl9XmQABwRfmekGnpn0C': 'b_5',
  30. 'BQADBAAD5QEAAl9XmQABQITgUsEsqxsC': 'b_6',
  31. 'BQADBAAD5wEAAl9XmQABVhPF6EcfWjEC': 'b_7',
  32. 'BQADBAAD6QEAAl9XmQABP6baig0pIvYC': 'b_8',
  33. 'BQADBAAD6wEAAl9XmQAB0CQdsQs_pXIC': 'b_9',
  34. 'BQADBAAD7QEAAl9XmQAB00Wii7R3gDUC': 'b_draw',
  35. 'BQADBAAD8QEAAl9XmQAB_RJHYKqlc-wC': 'b_skip',
  36. 'BQADBAAD7wEAAl9XmQABo7D0B9NUPmYC': 'b_reverse',
  37. 'BQADBAAD9wEAAl9XmQABb8CaxxsQ-Y8C': 'g_0',
  38. 'BQADBAAD-QEAAl9XmQAB9B6ti_j6UB0C': 'g_1',
  39. 'BQADBAAD-wEAAl9XmQABYpLjOzbRz8EC': 'g_2',
  40. 'BQADBAAD_QEAAl9XmQABKvc2ZCiY-D8C': 'g_3',
  41. 'BQADBAAD_wEAAl9XmQABJB52wzPdHssC': 'g_4',
  42. 'BQADBAADAQIAAl9XmQABp_Ep1I4GA2cC': 'g_5',
  43. 'BQADBAADAwIAAl9XmQABaaMxxa4MihwC': 'g_6',
  44. 'BQADBAADBQIAAl9XmQABv5Q264Crz8gC': 'g_7',
  45. 'BQADBAADBwIAAl9XmQABjMH-X9UHh8sC': 'g_8',
  46. 'BQADBAADCQIAAl9XmQAB26fZ2fW7vM0C': 'g_9',
  47. 'BQADBAADCwIAAl9XmQAB64jIZrgXrQUC': 'g_draw',
  48. 'BQADBAADDwIAAl9XmQAB17yhhnh46VQC': 'g_skip',
  49. 'BQADBAADDQIAAl9XmQAB_xcaab0DkegC': 'g_reverse',
  50. 'BQADBAADEQIAAl9XmQABiUfr1hz-zT8C': 'r_0',
  51. 'BQADBAADEwIAAl9XmQAB5bWfwJGs6Q0C': 'r_1',
  52. 'BQADBAADFQIAAl9XmQABHR4mg9Ifjw0C': 'r_2',
  53. 'BQADBAADFwIAAl9XmQABYBx5O_PG2QIC': 'r_3',
  54. 'BQADBAADGQIAAl9XmQABTQpGrlvet3cC': 'r_4',
  55. 'BQADBAADGwIAAl9XmQABbdLt4gdntBQC': 'r_5',
  56. 'BQADBAADHQIAAl9XmQABqEI274p3lSoC': 'r_6',
  57. 'BQADBAADHwIAAl9XmQABCw8u67Q4EK4C': 'r_7',
  58. 'BQADBAADIQIAAl9XmQAB8iDJmLxp8ogC': 'r_8',
  59. 'BQADBAADIwIAAl9XmQAB_HCAww1kNGYC': 'r_9',
  60. 'BQADBAADJQIAAl9XmQABuz0OZ4l3k6MC': 'r_draw',
  61. 'BQADBAADKQIAAl9XmQAC2AL5Ok_ULwI': 'r_skip',
  62. 'BQADBAADJwIAAl9XmQABu2tIeQTpDvUC': 'r_reverse',
  63. 'BQADBAADKwIAAl9XmQAB_nWoNKe8DOQC': 'y_0',
  64. 'BQADBAADLQIAAl9XmQABVprAGUDKgOQC': 'y_1',
  65. 'BQADBAADLwIAAl9XmQABqyT4_YTm54EC': 'y_2',
  66. 'BQADBAADMQIAAl9XmQABGC-Xxg_N6fIC': 'y_3',
  67. 'BQADBAADMwIAAl9XmQABbc-ZGL8kApAC': 'y_4',
  68. 'BQADBAADNQIAAl9XmQAB67QJZIF6XAcC': 'y_5',
  69. 'BQADBAADNwIAAl9XmQABJg_7XXoITsoC': 'y_6',
  70. 'BQADBAADOQIAAl9XmQABVrd7OcS2k34C': 'y_7',
  71. 'BQADBAADOwIAAl9XmQABRpJSahBWk3EC': 'y_8',
  72. 'BQADBAADPQIAAl9XmQAB9MwJWKLJogYC': 'y_9',
  73. 'BQADBAADPwIAAl9XmQABaPYK8oYg84cC': 'y_draw',
  74. 'BQADBAADQwIAAl9XmQABO_AZKtxY6IMC': 'y_skip',
  75. 'BQADBAADQQIAAl9XmQABZdQFahGG6UQC': 'y_reverse',
  76. 'BQADBAAD9QEAAl9XmQABVlkSNfhn76cC': 'draw_four',
  77. 'BQADBAAD8wEAAl9XmQABl9rUOPqx4E4C': 'colorchooser',
  78. 'BQADBAAD-AIAAl9XmQABxEjEcFM-VHIC': 'option_draw',
  79. 'BQADBAAD-gIAAl9XmQABcEkAAbaZ4SicAg': 'option_pass',
  80. 'BQADBAADygIAAl9XmQABJoLfB9ntI2UC': 'option_bluff',
  81. 'BQADBAADxAIAAl9XmQABC5v3Z77VLfEC': 'option_info'
  82. }
  83. # can't be used for userbot
  84. STICKERS_GREY = {
  85. 'BQADBAADRQIAAl9XmQAB1IfkQ5xAiK4C': 'b_0',
  86. 'BQADBAADRwIAAl9XmQABbWvhTeKBii4C': 'b_1',
  87. 'BQADBAADSQIAAl9XmQABS1djHgyQokMC': 'b_2',
  88. 'BQADBAADSwIAAl9XmQABwQ6VTbgY-MIC': 'b_3',
  89. 'BQADBAADTQIAAl9XmQABAlKUYha8YccC': 'b_4',
  90. 'BQADBAADTwIAAl9XmQABMvx8xVDnhUEC': 'b_5',
  91. 'BQADBAADUQIAAl9XmQABDEbhP1Zd31kC': 'b_6',
  92. 'BQADBAADUwIAAl9XmQABXb5XQBBaAnIC': 'b_7',
  93. 'BQADBAADVQIAAl9XmQABgL5HRDLvrjgC': 'b_8',
  94. 'BQADBAADVwIAAl9XmQABtO3XDQWZLtYC': 'b_9',
  95. 'BQADBAADWQIAAl9XmQAB2kk__6_2IhMC': 'b_draw',
  96. 'BQADBAADXQIAAl9XmQABEGJI6CaH3vcC': 'b_skip',
  97. 'BQADBAADWwIAAl9XmQAB_kZA6UdHXU8C': 'b_reverse',
  98. 'BQADBAADYwIAAl9XmQABGD5a9oG7Yg4C': 'g_0',
  99. 'BQADBAADZQIAAl9XmQABqwABZHAXZIg0Ag': 'g_1',
  100. 'BQADBAADZwIAAl9XmQABTI3mrEhojRkC': 'g_2',
  101. 'BQADBAADaQIAAl9XmQABVi3rUyzWS3YC': 'g_3',
  102. 'BQADBAADawIAAl9XmQABZIf5ThaXnpUC': 'g_4',
  103. 'BQADBAADbQIAAl9XmQABNndVJSQCenIC': 'g_5',
  104. 'BQADBAADbwIAAl9XmQABpoy1c4ZkrvwC': 'g_6',
  105. 'BQADBAADcQIAAl9XmQABDeaT5fzxwREC': 'g_7',
  106. 'BQADBAADcwIAAl9XmQABLIQ06ZM5NnAC': 'g_8',
  107. 'BQADBAADdQIAAl9XmQABel-mC7eXGsMC': 'g_9',
  108. 'BQADBAADdwIAAl9XmQABOHEpxSztCf8C': 'g_draw',
  109. 'BQADBAADewIAAl9XmQABDaQdMxjjPsoC': 'g_skip',
  110. 'BQADBAADeQIAAl9XmQABek1lGz7SJNAC': 'g_reverse',
  111. 'BQADBAADfQIAAl9XmQABWrxoiXcsg0EC': 'r_0',
  112. 'BQADBAADfwIAAl9XmQABlav-bkgSgRcC': 'r_1',
  113. 'BQADBAADgQIAAl9XmQABDjZkqfJ4AdAC': 'r_2',
  114. 'BQADBAADgwIAAl9XmQABT7lH7VVcy3MC': 'r_3',
  115. 'BQADBAADhQIAAl9XmQAB1arPC5x0LrwC': 'r_4',
  116. 'BQADBAADhwIAAl9XmQABWvs7xkCDldkC': 'r_5',
  117. 'BQADBAADiQIAAl9XmQABjwABH5ZonWn8Ag': 'r_6',
  118. 'BQADBAADiwIAAl9XmQABjekJfm4fBDIC': 'r_7',
  119. 'BQADBAADjQIAAl9XmQABqFjchpsJeEkC': 'r_8',
  120. 'BQADBAADjwIAAl9XmQAB-sKdcgABdNKDAg': 'r_9',
  121. 'BQADBAADkQIAAl9XmQABtw9RPVDHZOQC': 'r_draw',
  122. 'BQADBAADlQIAAl9XmQABtG2GixCxtX4C': 'r_skip',
  123. 'BQADBAADkwIAAl9XmQABz2qyEbabnVsC': 'r_reverse',
  124. 'BQADBAADlwIAAl9XmQABAb3ZwTGS1lMC': 'y_0',
  125. 'BQADBAADmQIAAl9XmQAB9v5qJk9R0x8C': 'y_1',
  126. 'BQADBAADmwIAAl9XmQABCsgpRHC2g-cC': 'y_2',
  127. 'BQADBAADnQIAAl9XmQAB3kLLXCv-qY0C': 'y_3',
  128. 'BQADBAADnwIAAl9XmQAB7R_y-NexNLIC': 'y_4',
  129. 'BQADBAADoQIAAl9XmQABl-7mwsjD-cMC': 'y_5',
  130. 'BQADBAADowIAAl9XmQABwbVsyv2MfPkC': 'y_6',
  131. 'BQADBAADpQIAAl9XmQABoBqC0JsemVwC': 'y_7',
  132. 'BQADBAADpwIAAl9XmQABpkwAAeh9ldlHAg': 'y_8',
  133. 'BQADBAADqQIAAl9XmQABpSBEUfd4IM8C': 'y_9',
  134. 'BQADBAADqwIAAl9XmQABMt-2zW0VYb4C': 'y_draw',
  135. 'BQADBAADrwIAAl9XmQABIDf-_TuuxtEC': 'y_skip',
  136. 'BQADBAADrQIAAl9XmQABm9M0Zh-_UwkC': 'y_reverse',
  137. 'BQADBAADYQIAAl9XmQAB_HWlvZIscDEC': 'draw_four',
  138. 'BQADBAADXwIAAl9XmQABY_ksDdMex-wC': 'colorchooser'
  139. }
  140. # sticker_id
  141. #sticker_id = [['b_0', '43161736970240581'], ['b_1', '43161736970240583'], ['b_2', '43161736970240585'], ['b_3', '43161736970240587'], ['b_4', '43161736970240589'], ['b_5', '43161736970240591'], ['b_6', '43161736970240593'], ['b_7', '43161736970240595'], ['b_8', '43161736970240597'], ['b_9', '43161736970240599'], ['b_draw', '43161736970240601'], ['b_skip', '43161736970240605'], ['b_reverse', '43161736970240603'], ['g_0', '43161736970240611'], ['g_1', '43161736970240613'], ['g_2', '43161736970240615'], ['g_3', '43161736970240617'], ['g_4', '43161736970240619'], ['g_5', '43161736970240621'], ['g_6', '43161736970240623'], ['g_7', '43161736970240625'], ['g_8', '43161736970240627'], ['g_9', '43161736970240629'], ['g_draw', '43161736970240631'], ['g_skip', '43161736970240635'], ['g_reverse', '43161736970240633'], ['r_0', '43161736970240637'], ['r_1', '43161736970240639'], ['r_2', '43161736970240641'], ['r_3', '43161736970240643'], ['r_4', '43161736970240645'], ['r_5', '43161736970240647'], ['r_6', '43161736970240649'], ['r_7', '43161736970240651'], ['r_8', '43161736970240653'], ['r_9', '43161736970240655'], ['r_draw', '43161736970240657'], ['r_skip', '43161736970240661'], ['r_reverse', '43161736970240659'], ['y_0', '43161736970240663'], ['y_1', '43161736970240665'], ['y_2', '43161736970240667'], ['y_3', '43161736970240669'], ['y_4', '43161736970240671'], ['y_5', '43161736970240673'], ['y_6', '43161736970240675'], ['y_7', '43161736970240677'], ['y_8', '43161736970240679'], ['y_9', '43161736970240681'], ['y_draw', '43161736970240683'], ['y_skip', '43161736970240687'], ['y_reverse', '43161736970240685'], ['draw_four', '43161736970240609'], ['colorchooser', '43161736970240607']]
  142. GREY_SET_ID = '43161736970240002'
  143. # only grey ordinary cards are useful
  144. GREY_ID = {
  145. '43161736970240581': 'b_0',
  146. '43161736970240583': 'b_1',
  147. '43161736970240585': 'b_2',
  148. '43161736970240587': 'b_3',
  149. '43161736970240589': 'b_4',
  150. '43161736970240591': 'b_5',
  151. '43161736970240593': 'b_6',
  152. '43161736970240595': 'b_7',
  153. '43161736970240597': 'b_8',
  154. '43161736970240599': 'b_9',
  155. '43161736970240601': 'b_draw',
  156. '43161736970240605': 'b_skip',
  157. '43161736970240603': 'b_reverse',
  158. '43161736970240611': 'g_0',
  159. '43161736970240613': 'g_1',
  160. '43161736970240615': 'g_2',
  161. '43161736970240617': 'g_3',
  162. '43161736970240619': 'g_4',
  163. '43161736970240621': 'g_5',
  164. '43161736970240623': 'g_6',
  165. '43161736970240625': 'g_7',
  166. '43161736970240627': 'g_8',
  167. '43161736970240629': 'g_9',
  168. '43161736970240631': 'g_draw',
  169. '43161736970240635': 'g_skip',
  170. '43161736970240633': 'g_reverse',
  171. '43161736970240637': 'r_0',
  172. '43161736970240639': 'r_1',
  173. '43161736970240641': 'r_2',
  174. '43161736970240643': 'r_3',
  175. '43161736970240645': 'r_4',
  176. '43161736970240647': 'r_5',
  177. '43161736970240649': 'r_6',
  178. '43161736970240651': 'r_7',
  179. '43161736970240653': 'r_8',
  180. '43161736970240655': 'r_9',
  181. '43161736970240657': 'r_draw',
  182. '43161736970240661': 'r_skip',
  183. '43161736970240659': 'r_reverse',
  184. '43161736970240663': 'y_0',
  185. '43161736970240665': 'y_1',
  186. '43161736970240667': 'y_2',
  187. '43161736970240669': 'y_3',
  188. '43161736970240671': 'y_4',
  189. '43161736970240673': 'y_5',
  190. '43161736970240675': 'y_6',
  191. '43161736970240677': 'y_7',
  192. '43161736970240679': 'y_8',
  193. '43161736970240681': 'y_9',
  194. '43161736970240683': 'y_draw',
  195. '43161736970240687': 'y_skip',
  196. '43161736970240685': 'y_reverse'
  197. }