Advertisement
quab

Premium ES: Global

Oct 15th, 2023 (edited)
1,039
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 4.19 KB | None | 0 0
  1. Discord:
  2. Youtube
  3. Discord Tag: xquab
  4.  
  5. Variables necesarias:
  6.  
  7. Nombre: premium
  8. Valor: {"valor": "false", "tiempo": "86400"}
  9.  
  10.  
  11. 1.- Code
  12.  
  13. Prefix: !add-premium(opcional)
  14.  
  15. Ejecuta:
  16. !add-premium <user> <tiempo>(opcional)
  17. !add-premium xquab 3d
  18.  
  19. Posdata, Tiempo:
  20. d = dia
  21. h = hora
  22. m = minuto
  23. s = segundos
  24.  
  25.  
  26. Codigo:
  27. $nomention
  28. $c[dar premium]
  29. $var[us;$findUser[$message[1];no]]
  30.  
  31. $if[$checkUserPerms[$var[us];admin]==false]
  32. $authorIcon[$authorAvatar]
  33. $author[$username]
  34. $description[Debe tener "admin" para hacer esto.]
  35. $color[c13849]
  36. $stop
  37. $endif
  38.  
  39. $if[$message[2]==]
  40. $var[k;$calculate[(86400+$getTimestamp)]]
  41. $else
  42. $try
  43. $onlyIf[$checkContains[$message[2];s;m;h;d]==true;]
  44. $catch
  45. $authorIcon[$authorAvatar]
  46. $author[$username]
  47. $description[Por favor usa **(s) segundos**, **(m) minutos**, **(h) horas**, **(d) dias**.]
  48. $color[c13849]
  49. $stop
  50. $endtry
  51.  
  52.  
  53. $if[$isNumber[$replaceText[$replaceText[$replaceText[$replaceText[$message[2];s;;-1];m;;-1];h;;-1];d;;-1]]==false]
  54. $authorIcon[$authorAvatar]
  55. $author[$username]
  56. $description[Numero ingresado: ($message[2]), no
  57. valido intenta otra vez.]
  58. $color[c13849]
  59. $stop
  60. $endif
  61.  
  62. $if[$checkContains[$message[2];s]==true]
  63. $var[o;$replaceText[$message[2];s;]]
  64. $var[k;$sum[$getTimestamp;$var[o]]]
  65.  
  66. $elseif[$checkContains[$message[2];m]==true]
  67. $var[o;$replaceText[$message[2];m;]]
  68. $var[k;$calculate[($var[o]*60)+$getTimestamp]]
  69.  
  70. $elseif[$checkContains[$message[2];h]==true]
  71. $var[o;$replaceText[$message[2];h;]]
  72. $var[k;$calculate[($var[o]*3600)+$getTimestamp]]
  73.  
  74. $elseif[$checkContains[$message[2];d]==true]
  75. $var[o;$replaceText[$message[2];d;]]
  76. $var[k;$calculate[((($var[o]*24)*60)*60)+$getTimestamp]]
  77. $endif
  78. $endif
  79.  
  80. $if[$userExists[$var[us]]==true]
  81. $jsonParse[$getVar[premium;$mentioned[1]]]
  82. $jsonSetString[valor;true]
  83. $jsonSetString[tiempo;$var[k]]
  84. $author[$username[$var[us]]]
  85. $authorIcon[$userAvatar[$var[us]]]
  86.  
  87. $description[Excelente le has dado Premium a <@$var[us]> ⭐️]
  88.  
  89. $addField[ID:;
  90. $var[us]]
  91. $addField[Expira:;
  92. <t:$var[k]:F>]
  93. $addField[Mod:;
  94. <@$authorID>]
  95.  
  96. $setVar[premium;$jsonStringify;$var[us]]
  97. $color[#2eb969]
  98. $else
  99. $authorIcon[$authorAvatar]
  100. $author[$username]
  101. $description[El usuario no existe]
  102. $color[c13849]
  103. $stop
  104. $endif
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124. 2.- Code
  125.  
  126. Posdata: Puden usar esto en todos sus codes para que se requiera premium etc,
  127.  
  128. Prefix: !premium(opcional)
  129.  
  130. Codigo:
  131.  
  132. $nomention
  133. $c[usar premium]
  134. $var[id;$findUser[$message[1];yes]]
  135. $jsonParse[$getVar[premium;$var[id]]]
  136. $if[$json[valor]==true]
  137. $if[$json[tiempo]>=$getTimestamp]
  138.  
  139. $c[⬇️ rempplazar aqui lo q ira si tiene premium ⬇️]
  140. $description[Tienes premium]
  141. $color[#2eb969]
  142. $c[⬆️ remplazar aqui lo q ira si tiene premium ⬆️]
  143.  
  144. $else
  145. $authorIcon[$authorAvatar]
  146. $author[$username]
  147. $description[Se te acabo el premium <t:$json[tiempo]:R> precisamente]
  148. $color[c13849]
  149. $stop
  150. $endif
  151. $else
  152. $authorIcon[$authorAvatar]
  153. $author[$username]
  154. $description[No tiene premium <@$var[id]>]
  155. $color[c13849]
  156. $stop
  157. $endif
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184. 3.- Code
  185.  
  186. Prefix: !quitar-premium(opcional)
  187.  
  188. Ejecuta asi:
  189. !quitar-premium <user>
  190.  
  191. Codigo:
  192.  
  193. $nomention
  194. $var[es;$findUser[$message[1];no]]
  195. $jsonParse[$getVar[premium;$var[es]]]
  196. $if[$checkUserPerms[$authorID;admin]==false]
  197. $authorIcon[$authorAvatar]
  198. $author[$username]
  199. $description[Debe tener "admin" para hacer esto.]
  200. $color[c13849]
  201. $stop
  202. $elseif[$var[es]==$serverOwner]
  203. $authorIcon[$userAvatar[$var[es]]]
  204. $author[$username[$var[es]]]
  205. $description[No puedes quitarle premium al owner pruebe de nuevo.]
  206. $color[c13849]
  207. $stop
  208. $endif
  209.  
  210.  
  211. $if[$userExists[$var[es]]==false]
  212. $authorIcon[$authorAvatar]
  213. $author[$username]
  214. $description[El usuario mencionadono existe pruebe de nuevo.]
  215. $color[c13849]
  216. $stop
  217. $elseif[$json[valor]==false]
  218. $authorIcon[$authorAvatar]
  219. $author[$username]
  220. $description[Este usuario no tiene premium por lo tanto no lo se puede quitar nada]
  221. $color[c13849]
  222. $stop
  223. $endif
  224.  
  225. $authorIcon[$userAvatar[$var[es]]]
  226. $author[$username[$var[es]]]
  227. $jsonSetString[valor;false]
  228. $jsonSetString[tiempo;]
  229. $description[Se ha quitado el premium a <@$var[es]> correctamente.]
  230. $color[#2eb969]
  231. $setVar[premium;$jsonStringify;$var[es]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement