@takaro/modules 0.0.0-next.0da151e

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (352) hide show
  1. package/README.md +3 -0
  2. package/dist/BuiltinModule.d.ts +62 -0
  3. package/dist/BuiltinModule.d.ts.map +1 -0
  4. package/dist/BuiltinModule.js +245 -0
  5. package/dist/BuiltinModule.js.map +1 -0
  6. package/dist/community-modules.json +21 -0
  7. package/dist/dto/base.d.ts +7 -0
  8. package/dist/dto/base.d.ts.map +1 -0
  9. package/dist/dto/base.js +28 -0
  10. package/dist/dto/base.js.map +1 -0
  11. package/dist/dto/discordEvents.d.ts +32 -0
  12. package/dist/dto/discordEvents.d.ts.map +1 -0
  13. package/dist/dto/discordEvents.js +92 -0
  14. package/dist/dto/discordEvents.js.map +1 -0
  15. package/dist/dto/gameEvents.d.ts +83 -0
  16. package/dist/dto/gameEvents.d.ts.map +1 -0
  17. package/dist/dto/gameEvents.js +205 -0
  18. package/dist/dto/gameEvents.js.map +1 -0
  19. package/dist/dto/index.d.ts +54 -0
  20. package/dist/dto/index.d.ts.map +1 -0
  21. package/dist/dto/index.js +18 -0
  22. package/dist/dto/index.js.map +1 -0
  23. package/dist/dto/takaroEvents.d.ts +276 -0
  24. package/dist/dto/takaroEvents.d.ts.map +1 -0
  25. package/dist/dto/takaroEvents.js +794 -0
  26. package/dist/dto/takaroEvents.js.map +1 -0
  27. package/dist/main.d.ts +5 -0
  28. package/dist/main.d.ts.map +1 -0
  29. package/dist/main.js +35 -0
  30. package/dist/main.js.map +1 -0
  31. package/dist/modules/chatBridge/hooks/DiscordToGame.d.ts +2 -0
  32. package/dist/modules/chatBridge/hooks/DiscordToGame.d.ts.map +1 -0
  33. package/dist/modules/chatBridge/hooks/DiscordToGame.js +18 -0
  34. package/dist/modules/chatBridge/hooks/DiscordToGame.js.map +1 -0
  35. package/dist/modules/chatBridge/hooks/GameToDiscord.d.ts +2 -0
  36. package/dist/modules/chatBridge/hooks/GameToDiscord.d.ts.map +1 -0
  37. package/dist/modules/chatBridge/hooks/GameToDiscord.js +14 -0
  38. package/dist/modules/chatBridge/hooks/GameToDiscord.js.map +1 -0
  39. package/dist/modules/chatBridge/hooks/PlayerConnected.d.ts +2 -0
  40. package/dist/modules/chatBridge/hooks/PlayerConnected.d.ts.map +1 -0
  41. package/dist/modules/chatBridge/hooks/PlayerConnected.js +9 -0
  42. package/dist/modules/chatBridge/hooks/PlayerConnected.js.map +1 -0
  43. package/dist/modules/chatBridge/hooks/PlayerDisconnected.d.ts +2 -0
  44. package/dist/modules/chatBridge/hooks/PlayerDisconnected.d.ts.map +1 -0
  45. package/dist/modules/chatBridge/hooks/PlayerDisconnected.js +9 -0
  46. package/dist/modules/chatBridge/hooks/PlayerDisconnected.js.map +1 -0
  47. package/dist/modules/chatBridge/index.d.ts +5 -0
  48. package/dist/modules/chatBridge/index.d.ts.map +1 -0
  49. package/dist/modules/chatBridge/index.js +64 -0
  50. package/dist/modules/chatBridge/index.js.map +1 -0
  51. package/dist/modules/dailyRewards/commands/daily.d.ts +2 -0
  52. package/dist/modules/dailyRewards/commands/daily.d.ts.map +1 -0
  53. package/dist/modules/dailyRewards/commands/daily.js +103 -0
  54. package/dist/modules/dailyRewards/commands/daily.js.map +1 -0
  55. package/dist/modules/dailyRewards/commands/streak.d.ts +2 -0
  56. package/dist/modules/dailyRewards/commands/streak.d.ts.map +1 -0
  57. package/dist/modules/dailyRewards/commands/streak.js +34 -0
  58. package/dist/modules/dailyRewards/commands/streak.js.map +1 -0
  59. package/dist/modules/dailyRewards/commands/topstreak.d.ts +2 -0
  60. package/dist/modules/dailyRewards/commands/topstreak.d.ts.map +1 -0
  61. package/dist/modules/dailyRewards/commands/topstreak.js +44 -0
  62. package/dist/modules/dailyRewards/commands/topstreak.js.map +1 -0
  63. package/dist/modules/dailyRewards/functions/utils.d.ts +6 -0
  64. package/dist/modules/dailyRewards/functions/utils.d.ts.map +1 -0
  65. package/dist/modules/dailyRewards/functions/utils.js +32 -0
  66. package/dist/modules/dailyRewards/functions/utils.js.map +1 -0
  67. package/dist/modules/dailyRewards/hooks/dailyLoginCheck.d.ts +2 -0
  68. package/dist/modules/dailyRewards/hooks/dailyLoginCheck.d.ts.map +1 -0
  69. package/dist/modules/dailyRewards/hooks/dailyLoginCheck.js +19 -0
  70. package/dist/modules/dailyRewards/hooks/dailyLoginCheck.js.map +1 -0
  71. package/dist/modules/dailyRewards/index.d.ts +5 -0
  72. package/dist/modules/dailyRewards/index.d.ts.map +1 -0
  73. package/dist/modules/dailyRewards/index.js +127 -0
  74. package/dist/modules/dailyRewards/index.js.map +1 -0
  75. package/dist/modules/economyUtils/commands/balance.d.ts +2 -0
  76. package/dist/modules/economyUtils/commands/balance.d.ts.map +1 -0
  77. package/dist/modules/economyUtils/commands/balance.js +7 -0
  78. package/dist/modules/economyUtils/commands/balance.js.map +1 -0
  79. package/dist/modules/economyUtils/commands/claim.d.ts +2 -0
  80. package/dist/modules/economyUtils/commands/claim.d.ts.map +1 -0
  81. package/dist/modules/economyUtils/commands/claim.js +35 -0
  82. package/dist/modules/economyUtils/commands/claim.js.map +1 -0
  83. package/dist/modules/economyUtils/commands/confirmTransfer.d.ts +2 -0
  84. package/dist/modules/economyUtils/commands/confirmTransfer.d.ts.map +1 -0
  85. package/dist/modules/economyUtils/commands/confirmTransfer.js +38 -0
  86. package/dist/modules/economyUtils/commands/confirmTransfer.js.map +1 -0
  87. package/dist/modules/economyUtils/commands/grantCurrency.d.ts +2 -0
  88. package/dist/modules/economyUtils/commands/grantCurrency.d.ts.map +1 -0
  89. package/dist/modules/economyUtils/commands/grantCurrency.js +28 -0
  90. package/dist/modules/economyUtils/commands/grantCurrency.js.map +1 -0
  91. package/dist/modules/economyUtils/commands/revokeCurrency.d.ts +2 -0
  92. package/dist/modules/economyUtils/commands/revokeCurrency.d.ts.map +1 -0
  93. package/dist/modules/economyUtils/commands/revokeCurrency.js +28 -0
  94. package/dist/modules/economyUtils/commands/revokeCurrency.js.map +1 -0
  95. package/dist/modules/economyUtils/commands/shop.d.ts +2 -0
  96. package/dist/modules/economyUtils/commands/shop.d.ts.map +1 -0
  97. package/dist/modules/economyUtils/commands/shop.js +69 -0
  98. package/dist/modules/economyUtils/commands/shop.js.map +1 -0
  99. package/dist/modules/economyUtils/commands/topCurrency.d.ts +2 -0
  100. package/dist/modules/economyUtils/commands/topCurrency.d.ts.map +1 -0
  101. package/dist/modules/economyUtils/commands/topCurrency.js +22 -0
  102. package/dist/modules/economyUtils/commands/topCurrency.js.map +1 -0
  103. package/dist/modules/economyUtils/commands/transfer.d.ts +2 -0
  104. package/dist/modules/economyUtils/commands/transfer.d.ts.map +1 -0
  105. package/dist/modules/economyUtils/commands/transfer.js +55 -0
  106. package/dist/modules/economyUtils/commands/transfer.js.map +1 -0
  107. package/dist/modules/economyUtils/cronJobs/zombieKillReward.d.ts +2 -0
  108. package/dist/modules/economyUtils/cronJobs/zombieKillReward.d.ts.map +1 -0
  109. package/dist/modules/economyUtils/cronJobs/zombieKillReward.js +66 -0
  110. package/dist/modules/economyUtils/cronJobs/zombieKillReward.js.map +1 -0
  111. package/dist/modules/economyUtils/index.d.ts +5 -0
  112. package/dist/modules/economyUtils/index.d.ts.map +1 -0
  113. package/dist/modules/economyUtils/index.js +192 -0
  114. package/dist/modules/economyUtils/index.js.map +1 -0
  115. package/dist/modules/geoBlock/hooks/IPDetected.d.ts +2 -0
  116. package/dist/modules/geoBlock/hooks/IPDetected.d.ts.map +1 -0
  117. package/dist/modules/geoBlock/hooks/IPDetected.js +50 -0
  118. package/dist/modules/geoBlock/hooks/IPDetected.js.map +1 -0
  119. package/dist/modules/geoBlock/index.d.ts +9 -0
  120. package/dist/modules/geoBlock/index.d.ts.map +1 -0
  121. package/dist/modules/geoBlock/index.js +329 -0
  122. package/dist/modules/geoBlock/index.js.map +1 -0
  123. package/dist/modules/gimme/commands/gimme.d.ts +2 -0
  124. package/dist/modules/gimme/commands/gimme.d.ts.map +1 -0
  125. package/dist/modules/gimme/commands/gimme.js +25 -0
  126. package/dist/modules/gimme/commands/gimme.js.map +1 -0
  127. package/dist/modules/gimme/index.d.ts +5 -0
  128. package/dist/modules/gimme/index.d.ts.map +1 -0
  129. package/dist/modules/gimme/index.js +75 -0
  130. package/dist/modules/gimme/index.js.map +1 -0
  131. package/dist/modules/highPingKicker/cronJobs/Ping check.d.ts +2 -0
  132. package/dist/modules/highPingKicker/cronJobs/Ping check.d.ts.map +1 -0
  133. package/dist/modules/highPingKicker/cronJobs/Ping check.js +59 -0
  134. package/dist/modules/highPingKicker/cronJobs/Ping check.js.map +1 -0
  135. package/dist/modules/highPingKicker/index.d.ts +5 -0
  136. package/dist/modules/highPingKicker/index.d.ts.map +1 -0
  137. package/dist/modules/highPingKicker/index.js +44 -0
  138. package/dist/modules/highPingKicker/index.js.map +1 -0
  139. package/dist/modules/lottery/commands/buyTicket.d.ts +2 -0
  140. package/dist/modules/lottery/commands/buyTicket.d.ts.map +1 -0
  141. package/dist/modules/lottery/commands/buyTicket.js +51 -0
  142. package/dist/modules/lottery/commands/buyTicket.js.map +1 -0
  143. package/dist/modules/lottery/commands/nextDraw.d.ts +2 -0
  144. package/dist/modules/lottery/commands/nextDraw.d.ts.map +1 -0
  145. package/dist/modules/lottery/commands/nextDraw.js +34 -0
  146. package/dist/modules/lottery/commands/nextDraw.js.map +1 -0
  147. package/dist/modules/lottery/commands/viewTickets.d.ts +2 -0
  148. package/dist/modules/lottery/commands/viewTickets.d.ts.map +1 -0
  149. package/dist/modules/lottery/commands/viewTickets.js +20 -0
  150. package/dist/modules/lottery/commands/viewTickets.js.map +1 -0
  151. package/dist/modules/lottery/cronJobs/drawLottery.d.ts +2 -0
  152. package/dist/modules/lottery/cronJobs/drawLottery.d.ts.map +1 -0
  153. package/dist/modules/lottery/cronJobs/drawLottery.js +96 -0
  154. package/dist/modules/lottery/cronJobs/drawLottery.js.map +1 -0
  155. package/dist/modules/lottery/index.d.ts +5 -0
  156. package/dist/modules/lottery/index.d.ts.map +1 -0
  157. package/dist/modules/lottery/index.js +85 -0
  158. package/dist/modules/lottery/index.js.map +1 -0
  159. package/dist/modules/playerOnboarding/commands/starterkit.d.ts +2 -0
  160. package/dist/modules/playerOnboarding/commands/starterkit.d.ts.map +1 -0
  161. package/dist/modules/playerOnboarding/commands/starterkit.js +47 -0
  162. package/dist/modules/playerOnboarding/commands/starterkit.js.map +1 -0
  163. package/dist/modules/playerOnboarding/hooks/playerConnected.d.ts +2 -0
  164. package/dist/modules/playerOnboarding/hooks/playerConnected.d.ts.map +1 -0
  165. package/dist/modules/playerOnboarding/hooks/playerConnected.js +11 -0
  166. package/dist/modules/playerOnboarding/hooks/playerConnected.js.map +1 -0
  167. package/dist/modules/playerOnboarding/index.d.ts +5 -0
  168. package/dist/modules/playerOnboarding/index.d.ts.map +1 -0
  169. package/dist/modules/playerOnboarding/index.js +83 -0
  170. package/dist/modules/playerOnboarding/index.js.map +1 -0
  171. package/dist/modules/serverMessages/cronJobs/Automated message.d.ts +2 -0
  172. package/dist/modules/serverMessages/cronJobs/Automated message.d.ts.map +1 -0
  173. package/dist/modules/serverMessages/cronJobs/Automated message.js +41 -0
  174. package/dist/modules/serverMessages/cronJobs/Automated message.js.map +1 -0
  175. package/dist/modules/serverMessages/index.d.ts +5 -0
  176. package/dist/modules/serverMessages/index.d.ts.map +1 -0
  177. package/dist/modules/serverMessages/index.js +45 -0
  178. package/dist/modules/serverMessages/index.js.map +1 -0
  179. package/dist/modules/teleports/commands/deletetp.d.ts +2 -0
  180. package/dist/modules/teleports/commands/deletetp.d.ts.map +1 -0
  181. package/dist/modules/teleports/commands/deletetp.js +20 -0
  182. package/dist/modules/teleports/commands/deletetp.js.map +1 -0
  183. package/dist/modules/teleports/commands/deletewaypoint.d.ts +2 -0
  184. package/dist/modules/teleports/commands/deletewaypoint.d.ts.map +1 -0
  185. package/dist/modules/teleports/commands/deletewaypoint.js +20 -0
  186. package/dist/modules/teleports/commands/deletewaypoint.js.map +1 -0
  187. package/dist/modules/teleports/commands/listwaypoints.d.ts +2 -0
  188. package/dist/modules/teleports/commands/listwaypoints.d.ts.map +1 -0
  189. package/dist/modules/teleports/commands/listwaypoints.js +17 -0
  190. package/dist/modules/teleports/commands/listwaypoints.js.map +1 -0
  191. package/dist/modules/teleports/commands/setprivate.d.ts +2 -0
  192. package/dist/modules/teleports/commands/setprivate.d.ts.map +1 -0
  193. package/dist/modules/teleports/commands/setprivate.js +29 -0
  194. package/dist/modules/teleports/commands/setprivate.js.map +1 -0
  195. package/dist/modules/teleports/commands/setpublic.d.ts +2 -0
  196. package/dist/modules/teleports/commands/setpublic.d.ts.map +1 -0
  197. package/dist/modules/teleports/commands/setpublic.js +45 -0
  198. package/dist/modules/teleports/commands/setpublic.js.map +1 -0
  199. package/dist/modules/teleports/commands/settp.d.ts +2 -0
  200. package/dist/modules/teleports/commands/settp.d.ts.map +1 -0
  201. package/dist/modules/teleports/commands/settp.js +40 -0
  202. package/dist/modules/teleports/commands/settp.js.map +1 -0
  203. package/dist/modules/teleports/commands/setwaypoint.d.ts +2 -0
  204. package/dist/modules/teleports/commands/setwaypoint.d.ts.map +1 -0
  205. package/dist/modules/teleports/commands/setwaypoint.js +28 -0
  206. package/dist/modules/teleports/commands/setwaypoint.js.map +1 -0
  207. package/dist/modules/teleports/commands/teleport.d.ts +2 -0
  208. package/dist/modules/teleports/commands/teleport.d.ts.map +1 -0
  209. package/dist/modules/teleports/commands/teleport.js +68 -0
  210. package/dist/modules/teleports/commands/teleport.js.map +1 -0
  211. package/dist/modules/teleports/commands/teleportwaypoint.d.ts +2 -0
  212. package/dist/modules/teleports/commands/teleportwaypoint.d.ts.map +1 -0
  213. package/dist/modules/teleports/commands/teleportwaypoint.js +43 -0
  214. package/dist/modules/teleports/commands/teleportwaypoint.js.map +1 -0
  215. package/dist/modules/teleports/commands/tplist.d.ts +2 -0
  216. package/dist/modules/teleports/commands/tplist.d.ts.map +1 -0
  217. package/dist/modules/teleports/commands/tplist.js +46 -0
  218. package/dist/modules/teleports/commands/tplist.js.map +1 -0
  219. package/dist/modules/teleports/cronJobs/Waypoint reconciler.d.ts +2 -0
  220. package/dist/modules/teleports/cronJobs/Waypoint reconciler.d.ts.map +1 -0
  221. package/dist/modules/teleports/cronJobs/Waypoint reconciler.js +6 -0
  222. package/dist/modules/teleports/cronJobs/Waypoint reconciler.js.map +1 -0
  223. package/dist/modules/teleports/functions/utils.d.ts +14 -0
  224. package/dist/modules/teleports/functions/utils.d.ts.map +1 -0
  225. package/dist/modules/teleports/functions/utils.js +156 -0
  226. package/dist/modules/teleports/functions/utils.js.map +1 -0
  227. package/dist/modules/teleports/index.d.ts +5 -0
  228. package/dist/modules/teleports/index.d.ts.map +1 -0
  229. package/dist/modules/teleports/index.js +208 -0
  230. package/dist/modules/teleports/index.js.map +1 -0
  231. package/dist/modules/timedShutdown/cronJobs/Shutdown.d.ts +2 -0
  232. package/dist/modules/timedShutdown/cronJobs/Shutdown.d.ts.map +1 -0
  233. package/dist/modules/timedShutdown/cronJobs/Shutdown.js +7 -0
  234. package/dist/modules/timedShutdown/cronJobs/Shutdown.js.map +1 -0
  235. package/dist/modules/timedShutdown/cronJobs/warning.d.ts +2 -0
  236. package/dist/modules/timedShutdown/cronJobs/warning.d.ts.map +1 -0
  237. package/dist/modules/timedShutdown/cronJobs/warning.js +10 -0
  238. package/dist/modules/timedShutdown/cronJobs/warning.js.map +1 -0
  239. package/dist/modules/timedShutdown/index.d.ts +5 -0
  240. package/dist/modules/timedShutdown/index.d.ts.map +1 -0
  241. package/dist/modules/timedShutdown/index.js +43 -0
  242. package/dist/modules/timedShutdown/index.js.map +1 -0
  243. package/dist/modules/utils/commands/help.d.ts +2 -0
  244. package/dist/modules/utils/commands/help.d.ts.map +1 -0
  245. package/dist/modules/utils/commands/help.js +84 -0
  246. package/dist/modules/utils/commands/help.js.map +1 -0
  247. package/dist/modules/utils/commands/ping.d.ts +2 -0
  248. package/dist/modules/utils/commands/ping.d.ts.map +1 -0
  249. package/dist/modules/utils/commands/ping.js +6 -0
  250. package/dist/modules/utils/commands/ping.js.map +1 -0
  251. package/dist/modules/utils/index.d.ts +5 -0
  252. package/dist/modules/utils/index.d.ts.map +1 -0
  253. package/dist/modules/utils/index.js +52 -0
  254. package/dist/modules/utils/index.js.map +1 -0
  255. package/dist/modules.json +757 -0
  256. package/package.json +17 -0
  257. package/scripts/buildBuiltinJson.ts +81 -0
  258. package/src/BuiltinModule.ts +159 -0
  259. package/src/__tests__/aliases.integration.test.ts +90 -0
  260. package/src/__tests__/bugRepros.integration.test.ts +485 -0
  261. package/src/__tests__/builtinmodule.unit.test.ts +15 -0
  262. package/src/__tests__/commandArgs.integration.test.ts +291 -0
  263. package/src/__tests__/crossServerPlayer.integration.test.ts +176 -0
  264. package/src/__tests__/economy/claim.integration.test.ts +250 -0
  265. package/src/__tests__/economy/economyUtils.integration.test.ts +495 -0
  266. package/src/__tests__/economy/shop.integration.test.ts +177 -0
  267. package/src/__tests__/economy/zombieKillReward.integration.test.ts +293 -0
  268. package/src/__tests__/geoblock.integration.test.ts +322 -0
  269. package/src/__tests__/gimme.integration.test.ts +106 -0
  270. package/src/__tests__/help.integration.test.ts +314 -0
  271. package/src/__tests__/highPingKicker.integration.test.ts +618 -0
  272. package/src/__tests__/lottery.integration.test.ts +344 -0
  273. package/src/__tests__/modulePermission.integration.test.ts +387 -0
  274. package/src/__tests__/onboarding.integration.test.ts +122 -0
  275. package/src/__tests__/ping.integration.test.ts +36 -0
  276. package/src/__tests__/roleExpiry.integration.test.ts +78 -0
  277. package/src/__tests__/serverMessages.integration.test.ts +116 -0
  278. package/src/__tests__/systemConfigCooldown.integration.test.ts +84 -0
  279. package/src/__tests__/systemConfigCost.integration.test.ts +194 -0
  280. package/src/__tests__/teleports/listtp.integration.test.ts +189 -0
  281. package/src/__tests__/teleports/publicteleports.integration.test.ts +345 -0
  282. package/src/__tests__/teleports/teleport.integration.test.ts +153 -0
  283. package/src/__tests__/teleports/tpManagement.integration.test.ts +175 -0
  284. package/src/__tests__/teleports/waypoints.integration.test.ts +832 -0
  285. package/src/community-modules/README.md +5 -0
  286. package/src/community-modules/modules/vote.json +19 -0
  287. package/src/dto/base.ts +13 -0
  288. package/src/dto/discordEvents.ts +69 -0
  289. package/src/dto/gameEvents.ts +159 -0
  290. package/src/dto/index.ts +25 -0
  291. package/src/dto/takaroEvents.ts +525 -0
  292. package/src/main.ts +47 -0
  293. package/src/modules/.eslintrc +5 -0
  294. package/src/modules/chatBridge/hooks/DiscordToGame.js +18 -0
  295. package/src/modules/chatBridge/hooks/GameToDiscord.js +18 -0
  296. package/src/modules/chatBridge/hooks/PlayerConnected.js +11 -0
  297. package/src/modules/chatBridge/hooks/PlayerDisconnected.js +11 -0
  298. package/src/modules/chatBridge/index.ts +64 -0
  299. package/src/modules/dailyRewards/commands/daily.js +114 -0
  300. package/src/modules/dailyRewards/commands/streak.js +42 -0
  301. package/src/modules/dailyRewards/commands/topstreak.js +54 -0
  302. package/src/modules/dailyRewards/functions/utils.js +36 -0
  303. package/src/modules/dailyRewards/hooks/dailyLoginCheck.js +24 -0
  304. package/src/modules/dailyRewards/index.ts +138 -0
  305. package/src/modules/economyUtils/commands/balance.js +8 -0
  306. package/src/modules/economyUtils/commands/claim.js +42 -0
  307. package/src/modules/economyUtils/commands/confirmTransfer.js +55 -0
  308. package/src/modules/economyUtils/commands/grantCurrency.js +34 -0
  309. package/src/modules/economyUtils/commands/revokeCurrency.js +34 -0
  310. package/src/modules/economyUtils/commands/shop.js +87 -0
  311. package/src/modules/economyUtils/commands/topCurrency.js +29 -0
  312. package/src/modules/economyUtils/commands/transfer.js +73 -0
  313. package/src/modules/economyUtils/cronJobs/zombieKillReward.js +82 -0
  314. package/src/modules/economyUtils/index.ts +197 -0
  315. package/src/modules/geoBlock/hooks/IPDetected.js +53 -0
  316. package/src/modules/geoBlock/index.ts +333 -0
  317. package/src/modules/gimme/commands/gimme.js +30 -0
  318. package/src/modules/gimme/index.ts +76 -0
  319. package/src/modules/highPingKicker/cronJobs/Ping check.js +68 -0
  320. package/src/modules/highPingKicker/index.ts +44 -0
  321. package/src/modules/lottery/commands/buyTicket.js +64 -0
  322. package/src/modules/lottery/commands/nextDraw.js +47 -0
  323. package/src/modules/lottery/commands/viewTickets.js +28 -0
  324. package/src/modules/lottery/cronJobs/drawLottery.js +124 -0
  325. package/src/modules/lottery/index.ts +86 -0
  326. package/src/modules/playerOnboarding/commands/starterkit.js +61 -0
  327. package/src/modules/playerOnboarding/hooks/playerConnected.js +14 -0
  328. package/src/modules/playerOnboarding/index.ts +86 -0
  329. package/src/modules/serverMessages/cronJobs/Automated message.js +47 -0
  330. package/src/modules/serverMessages/index.ts +46 -0
  331. package/src/modules/teleports/commands/deletetp.js +25 -0
  332. package/src/modules/teleports/commands/deletewaypoint.js +24 -0
  333. package/src/modules/teleports/commands/listwaypoints.js +23 -0
  334. package/src/modules/teleports/commands/setprivate.js +39 -0
  335. package/src/modules/teleports/commands/setpublic.js +60 -0
  336. package/src/modules/teleports/commands/settp.js +50 -0
  337. package/src/modules/teleports/commands/setwaypoint.js +31 -0
  338. package/src/modules/teleports/commands/teleport.js +84 -0
  339. package/src/modules/teleports/commands/teleportwaypoint.js +57 -0
  340. package/src/modules/teleports/commands/tplist.js +62 -0
  341. package/src/modules/teleports/cronJobs/Waypoint reconciler.js +7 -0
  342. package/src/modules/teleports/functions/utils.js +189 -0
  343. package/src/modules/teleports/index.ts +217 -0
  344. package/src/modules/timedShutdown/cronJobs/Shutdown.js +8 -0
  345. package/src/modules/timedShutdown/cronJobs/warning.js +13 -0
  346. package/src/modules/timedShutdown/index.ts +45 -0
  347. package/src/modules/utils/commands/help.js +100 -0
  348. package/src/modules/utils/commands/ping.js +7 -0
  349. package/src/modules/utils/index.ts +53 -0
  350. package/tsconfig.build.json +10 -0
  351. package/tsconfig.json +9 -0
  352. package/typedoc.json +3 -0
@@ -0,0 +1,50 @@
1
+ import { takaro, data, checkPermission, TakaroUserError } from '@takaro/helpers';
2
+ import { getVariableKey, findTp } from './utils.js';
3
+
4
+ async function main() {
5
+ const { pog, gameServerId, module: mod, arguments: args } = data;
6
+
7
+ const prefix = (await takaro.settings.settingsControllerGetOne('commandPrefix', gameServerId)).data.data.value;
8
+
9
+ const existingVariable = await findTp(args.tp, pog.playerId);
10
+
11
+ if (existingVariable.data.data.length > 0) {
12
+ throw new TakaroUserError(`Teleport ${args.tp} already exists, use ${prefix}deletetp ${args.tp} to delete it.`);
13
+ }
14
+
15
+ const hasPermission = checkPermission(pog, 'TELEPORTS_USE');
16
+ const allPlayerTeleports = await takaro.variable.variableControllerSearch({
17
+ search: {
18
+ key: [getVariableKey(undefined), getVariableKey(undefined, true)],
19
+ },
20
+ filters: {
21
+ gameServerId: [gameServerId],
22
+ playerId: [pog.playerId],
23
+ moduleId: [mod.moduleId],
24
+ },
25
+ });
26
+
27
+ if (allPlayerTeleports.data.data.length >= hasPermission.count) {
28
+ throw new TakaroUserError(
29
+ `You have reached the maximum number of teleports for your role, maximum allowed is ${hasPermission.count}`,
30
+ );
31
+ }
32
+
33
+ await takaro.variable.variableControllerCreate({
34
+ key: getVariableKey(args.tp),
35
+ value: JSON.stringify({
36
+ name: args.tp,
37
+ x: data.pog.positionX,
38
+ y: data.pog.positionY,
39
+ z: data.pog.positionZ,
40
+ dimension: data.pog.dimension,
41
+ }),
42
+ gameServerId,
43
+ moduleId: mod.moduleId,
44
+ playerId: pog.playerId,
45
+ });
46
+
47
+ await data.player.pm(`Teleport ${args.tp} set.`);
48
+ }
49
+
50
+ await main();
@@ -0,0 +1,31 @@
1
+ import { takaro, data, TakaroUserError } from '@takaro/helpers';
2
+ import { getWaypointName, waypointReconciler } from './utils.js';
3
+
4
+ async function main() {
5
+ const { pog, gameServerId, arguments: args, module: mod } = data;
6
+
7
+ try {
8
+ await takaro.variable.variableControllerCreate({
9
+ moduleId: mod.moduleId,
10
+ gameServerId,
11
+ key: getWaypointName(args.waypoint),
12
+ value: JSON.stringify({
13
+ x: pog.positionX,
14
+ y: pog.positionY,
15
+ z: pog.positionZ,
16
+ dimension: pog.dimension,
17
+ }),
18
+ });
19
+ } catch (error) {
20
+ if (error.message === 'Request failed with status code 409') {
21
+ throw new TakaroUserError(`Waypoint ${args.waypoint} already exists.`);
22
+ }
23
+ throw error;
24
+ }
25
+
26
+ await waypointReconciler();
27
+
28
+ await pog.pm(`Waypoint ${args.waypoint} set.`);
29
+ }
30
+
31
+ await main();
@@ -0,0 +1,84 @@
1
+ import { takaro, data, TakaroUserError } from '@takaro/helpers';
2
+ import { findTp } from './utils.js';
3
+
4
+ async function main() {
5
+ const { pog, gameServerId, arguments: args, module: mod } = data;
6
+
7
+ const ownedTeleportRes = await findTp(args.tp, pog.playerId);
8
+
9
+ let teleports = ownedTeleportRes.data.data;
10
+
11
+ if (mod.userConfig.allowPublicTeleports) {
12
+ const publicTeleportRes = await findTp(args.tp, null, true);
13
+ teleports = teleports.concat(publicTeleportRes.data.data);
14
+ }
15
+
16
+ if (teleports.length === 0) {
17
+ throw new TakaroUserError(`Teleport ${args.tp} does not exist.`);
18
+ }
19
+
20
+ const timeout = mod.userConfig.timeout;
21
+
22
+ if (timeout > 0) {
23
+ const lastExecuted = await takaro.variable.variableControllerSearch({
24
+ filters: {
25
+ key: ['lastExecuted'],
26
+ gameServerId: [gameServerId],
27
+ playerId: [pog.playerId],
28
+ moduleId: [mod.moduleId],
29
+ },
30
+ });
31
+ let lastExecutedRecord = lastExecuted.data.data[0];
32
+
33
+ if (!lastExecutedRecord) {
34
+ const createRes = await takaro.variable.variableControllerCreate({
35
+ key: 'lastExecuted',
36
+ gameServerId,
37
+ playerId: pog.playerId,
38
+ moduleId: mod.moduleId,
39
+ value: new Date().toISOString(),
40
+ });
41
+ lastExecutedRecord = createRes.data.data;
42
+ } else {
43
+ const lastExecutedTime = new Date(lastExecutedRecord.value);
44
+ const now = new Date();
45
+
46
+ const diff = now.getTime() - lastExecutedTime.getTime();
47
+
48
+ if (diff < timeout) {
49
+ throw new TakaroUserError('You cannot teleport yet. Please wait before trying again.');
50
+ }
51
+ }
52
+
53
+ const teleport = JSON.parse(teleports[0].value);
54
+
55
+ await takaro.gameserver.gameServerControllerTeleportPlayer(gameServerId, pog.playerId, {
56
+ x: teleport.x,
57
+ y: teleport.y,
58
+ z: teleport.z,
59
+ dimension: teleport.dimension,
60
+ });
61
+
62
+ await data.player.pm(`Teleported to ${teleport.name}.`);
63
+
64
+ if (timeout !== 0 && lastExecutedRecord) {
65
+ await takaro.variable.variableControllerUpdate(lastExecutedRecord.id, {
66
+ value: new Date().toISOString(),
67
+ });
68
+ }
69
+ return;
70
+ }
71
+
72
+ const teleport = JSON.parse(teleports[0].value);
73
+
74
+ await takaro.gameserver.gameServerControllerTeleportPlayer(gameServerId, pog.playerId, {
75
+ x: teleport.x,
76
+ y: teleport.y,
77
+ z: teleport.z,
78
+ dimension: teleport.dimension,
79
+ });
80
+
81
+ await data.player.pm(`Teleported to ${teleport.name}.`);
82
+ }
83
+
84
+ await main();
@@ -0,0 +1,57 @@
1
+ import { takaro, data, TakaroUserError, checkPermission } from '@takaro/helpers';
2
+
3
+ function getWaypointName(name) {
4
+ return `waypoint ${name}`;
5
+ }
6
+
7
+ async function main() {
8
+ const { pog, gameServerId, trigger, module, itemId } = data;
9
+
10
+ const triggeredCommand = module.version.commands.find((command) => command.id === itemId);
11
+
12
+ if (!triggeredCommand) {
13
+ throw new Error('Waypoint not found.');
14
+ }
15
+
16
+ if (!triggeredCommand.name.includes(`server ${gameServerId}`)) {
17
+ console.log(`Waypoint ${trigger} is not for this server.`);
18
+ return;
19
+ }
20
+
21
+ if (!checkPermission(pog, `WAYPOINTS_USE_${trigger.toUpperCase()}_${gameServerId}`)) {
22
+ throw new TakaroUserError(`You are not allowed to use the waypoint ${trigger}.`);
23
+ }
24
+
25
+ const teleportsModule = (
26
+ await takaro.module.moduleControllerSearch({
27
+ filters: {
28
+ builtin: ['teleports'],
29
+ },
30
+ })
31
+ ).data.data[0];
32
+
33
+ const variable = await takaro.variable.variableControllerSearch({
34
+ filters: {
35
+ key: [getWaypointName(trigger)],
36
+ gameServerId: [gameServerId],
37
+ moduleId: [teleportsModule.id],
38
+ },
39
+ });
40
+
41
+ if (variable.data.data.length === 0) {
42
+ throw new TakaroUserError(`Waypoint ${trigger} does not exist.`);
43
+ }
44
+
45
+ const waypoint = JSON.parse(variable.data.data[0].value);
46
+
47
+ await takaro.gameserver.gameServerControllerTeleportPlayer(gameServerId, pog.playerId, {
48
+ x: waypoint.x,
49
+ y: waypoint.y,
50
+ z: waypoint.z,
51
+ dimension: waypoint.dimension,
52
+ });
53
+
54
+ await pog.pm(`Teleported to waypoint ${trigger}.`);
55
+ }
56
+
57
+ await main();
@@ -0,0 +1,62 @@
1
+ import { takaro, data } from '@takaro/helpers';
2
+ import { getVariableKey } from './utils.js';
3
+
4
+ async function main() {
5
+ const { pog, gameServerId, module: mod } = data;
6
+
7
+ const prefix = (await takaro.settings.settingsControllerGetOne('commandPrefix', gameServerId)).data.data.value;
8
+
9
+ const ownedTeleports = (
10
+ await takaro.variable.variableControllerSearch({
11
+ filters: {
12
+ gameServerId: [gameServerId],
13
+ playerId: [pog.playerId],
14
+ moduleId: [mod.moduleId],
15
+ },
16
+ search: {
17
+ key: [getVariableKey(undefined, false)],
18
+ },
19
+ sortBy: 'key',
20
+ sortDirection: 'asc',
21
+ })
22
+ ).data.data;
23
+
24
+ const publicTeleports = (
25
+ await takaro.variable.variableControllerSearch({
26
+ filters: {
27
+ gameServerId: [gameServerId],
28
+ moduleId: [mod.moduleId],
29
+ },
30
+ search: {
31
+ key: [getVariableKey(undefined, true)],
32
+ },
33
+ sortBy: 'key',
34
+ sortDirection: 'asc',
35
+ })
36
+ ).data.data
37
+ // Filter out public teleports that are owned by the player
38
+ // Since we'll be showing them in the owned teleports list
39
+ .filter((teleport) => {
40
+ return teleport.playerId !== pog.playerId;
41
+ });
42
+
43
+ const teleports = [...ownedTeleports, ...publicTeleports];
44
+
45
+ if (teleports.length === 0) {
46
+ await data.player.pm(`You have no teleports available, use ${prefix}settp <name> to set one.`);
47
+ return;
48
+ }
49
+
50
+ await data.player.pm(`You have ${teleports.length} teleport${teleports.length === 1 ? '' : 's'} available`);
51
+
52
+ for (const rawTeleport of teleports) {
53
+ const teleport = JSON.parse(rawTeleport.value);
54
+ await data.player.pm(
55
+ `${teleport.name}: (${teleport.x},${teleport.y},${teleport.z}) ${
56
+ rawTeleport.key.startsWith('pub') ? '(public)' : ''
57
+ }`
58
+ );
59
+ }
60
+ }
61
+
62
+ await main();
@@ -0,0 +1,7 @@
1
+ import { waypointReconciler } from './utils.js';
2
+
3
+ async function main() {
4
+ await waypointReconciler();
5
+ }
6
+
7
+ await main();
@@ -0,0 +1,189 @@
1
+ import { takaro, data } from '@takaro/helpers';
2
+
3
+ export function getVariableKey(tpName, pub = false) {
4
+ if (pub && tpName) return `pubtp_${tpName}`;
5
+ if (pub && !tpName) return 'pubtp_';
6
+ if (tpName) return `tp_${tpName}`;
7
+ return 'tp_';
8
+ }
9
+
10
+ export async function findTp(tpName, playerId, pub = false) {
11
+ const { gameServerId, module: mod } = data;
12
+
13
+ if (pub) {
14
+ return takaro.variable.variableControllerSearch({
15
+ filters: {
16
+ key: [getVariableKey(tpName, true)],
17
+ gameServerId: [gameServerId],
18
+ playerId: [playerId].filter(Boolean),
19
+ moduleId: [mod.moduleId],
20
+ },
21
+ sortBy: 'key',
22
+ sortDirection: 'asc',
23
+ });
24
+ }
25
+
26
+ return takaro.variable.variableControllerSearch({
27
+ filters: {
28
+ key: [getVariableKey(tpName)],
29
+ gameServerId: [gameServerId],
30
+ playerId: [playerId].filter(Boolean),
31
+ moduleId: [mod.moduleId],
32
+ },
33
+ sortBy: 'key',
34
+ sortDirection: 'asc',
35
+ });
36
+ }
37
+
38
+ export async function ensureWaypointsModule() {
39
+ const { gameServerId } = data;
40
+ let waypointsDefinition = (
41
+ await takaro.module.moduleControllerSearch({
42
+ filters: {
43
+ name: ['Waypoints'],
44
+ },
45
+ })
46
+ ).data.data[0];
47
+
48
+ if (!waypointsDefinition) {
49
+ console.log('Waypoints module definition not found, creating it.');
50
+ waypointsDefinition = (
51
+ await takaro.module.moduleControllerCreate({
52
+ name: 'Waypoints',
53
+ })
54
+ ).data.data;
55
+ }
56
+
57
+ let waypointsInstallation = (
58
+ await takaro.module.moduleInstallationsControllerGetInstalledModules({
59
+ filters: { gameserverId: [gameServerId] },
60
+ })
61
+ ).data.data.find((module) => module.module.name === 'Waypoints');
62
+
63
+ if (!waypointsInstallation) {
64
+ console.log('Waypoints installation not found, installing it.');
65
+ waypointsInstallation = (
66
+ await takaro.module.moduleInstallationsControllerInstallModule({
67
+ gameServerId,
68
+ versionId: waypointsDefinition.latestVersion.id,
69
+ })
70
+ ).data.data;
71
+ }
72
+
73
+ return { waypointsInstallation, waypointsDefinition };
74
+ }
75
+
76
+ export function getWaypointName(name) {
77
+ return `waypoint ${name}`;
78
+ }
79
+
80
+ export function getWaypointId(varName) {
81
+ const split = varName.split(' ')[1];
82
+ if (split) return split;
83
+ return varName;
84
+ }
85
+
86
+ /**
87
+ * This function is responsible to read all the configured waypoints (vars)
88
+ * and then ensuring that the waypoints module has the correct config
89
+ */
90
+ export async function waypointReconciler() {
91
+ console.log('Reconciling waypoints');
92
+ const { waypointsInstallation, waypointsDefinition } = await ensureWaypointsModule();
93
+ const { gameServerId, module: mod } = data;
94
+
95
+ // Get all the installed waypoints
96
+ const waypointVars = (
97
+ await takaro.variable.variableControllerSearch({
98
+ filters: {
99
+ moduleId: [mod.moduleId],
100
+ gameServerId: [gameServerId],
101
+ },
102
+ search: {
103
+ key: [getWaypointName('')],
104
+ },
105
+ })
106
+ ).data.data;
107
+
108
+ const waypointsInModule = waypointsDefinition.latestVersion.commands;
109
+
110
+ // Check if any waypoints are missing in module
111
+ const missingWaypoints = waypointVars.filter((waypointVar) => {
112
+ const existingWaypointsForServer = waypointsInModule.filter((waypoint) => waypoint.name.includes(gameServerId));
113
+ return !existingWaypointsForServer.some((waypoint) => waypoint.trigger === getWaypointId(waypointVar.key));
114
+ });
115
+
116
+ // Check if there are waypoints too many in module compared to our vars
117
+ const toDeleteWaypoints = waypointsInModule.filter((waypoint) => {
118
+ // We ignore any commands that are not for this game server
119
+ if (!waypoint.name.includes(gameServerId)) return false;
120
+ return !waypointVars.some((waypointVar) => getWaypointId(waypointVar.key) === waypoint.trigger);
121
+ });
122
+
123
+ if (!missingWaypoints.length && !toDeleteWaypoints.length) {
124
+ // No changes in waypoints, exit
125
+ return;
126
+ }
127
+
128
+ console.log(
129
+ 'Missing waypoints:',
130
+ missingWaypoints.map((waypoint) => waypoint.key),
131
+ );
132
+ console.log(
133
+ 'To delete waypoints:',
134
+ toDeleteWaypoints.map((waypoint) => waypoint.trigger),
135
+ );
136
+
137
+ // Fetch the teleporting code template
138
+ const teleportCommand = await takaro.command.commandControllerSearch({
139
+ filters: {
140
+ moduleId: [mod.moduleId],
141
+ name: ['teleportwaypoint'],
142
+ },
143
+ });
144
+
145
+ // Edit the module accordingly
146
+ await Promise.all([
147
+ ...missingWaypoints.map((waypoint) => {
148
+ return takaro.command.commandControllerCreate({
149
+ name: `waypoint ${getWaypointId(waypoint.key)} server ${gameServerId}`,
150
+ trigger: getWaypointId(waypoint.key),
151
+ helpText: `Teleport to waypoint ${getWaypointId(waypoint.key)}.`,
152
+ function: teleportCommand.data.data[0].function.code,
153
+ versionId: waypointsInstallation.versionId,
154
+ });
155
+ }),
156
+ ...toDeleteWaypoints.map((waypointVar) => {
157
+ return takaro.command.commandControllerRemove(waypointVar.id);
158
+ }),
159
+ ]);
160
+
161
+ // Update permissions
162
+ const existingPermissions = waypointsDefinition.latestVersion.permissions || [];
163
+ const permissionInputDTOs = existingPermissions.map((permission) => ({
164
+ permission: permission.permission,
165
+ description: permission.description,
166
+ friendlyName: permission.friendlyName,
167
+ canHaveCount: permission.canHaveCount,
168
+ }));
169
+ // We need to filter out the permissions we deleted in the above lines
170
+ const filteredPermissionsInputs = permissionInputDTOs.filter((permission) => {
171
+ return !toDeleteWaypoints.some(
172
+ (waypoint) => permission.permission === `WAYPOINTS_USE_${waypoint.trigger.toUpperCase()}_${gameServerId}`,
173
+ );
174
+ });
175
+ const gameServer = (await takaro.gameserver.gameServerControllerGetOne(gameServerId)).data.data;
176
+ await takaro.module.moduleControllerUpdate(waypointsInstallation.moduleId, {
177
+ latestVersion: {
178
+ permissions: [
179
+ ...filteredPermissionsInputs,
180
+ ...missingWaypoints.map((waypoint) => ({
181
+ permission: `WAYPOINTS_USE_${getWaypointId(waypoint.key).toUpperCase()}_${gameServerId}`,
182
+ description: `Use the waypoint ${getWaypointId(waypoint.key)} on ${gameServer.name}.`,
183
+ friendlyName: `Use waypoint ${getWaypointId(waypoint.key)} on ${gameServer.name}`,
184
+ canHaveCount: false,
185
+ })),
186
+ ],
187
+ },
188
+ });
189
+ }
@@ -0,0 +1,217 @@
1
+ import {
2
+ ModuleTransferDTO,
3
+ ICommand,
4
+ IFunction,
5
+ IPermission,
6
+ ModuleTransferVersionDTO,
7
+ ICronJob,
8
+ } from '../../BuiltinModule.js';
9
+ import { Duration } from 'luxon';
10
+
11
+ export class Teleports extends ModuleTransferDTO<Teleports> {
12
+ constructor() {
13
+ super();
14
+
15
+ this.name = 'teleports';
16
+ this.author = 'Takaro';
17
+ this.supportedGames = ['7 days to die', 'rust', 'minecraft'];
18
+ this.versions = [
19
+ new ModuleTransferVersionDTO({
20
+ tag: '0.0.4',
21
+ description: 'A set of commands to allow players to set their own teleport points and teleport to them.',
22
+ configSchema: JSON.stringify({
23
+ $schema: 'http://json-schema.org/draft-07/schema#',
24
+ type: 'object',
25
+ properties: {
26
+ timeout: {
27
+ title: 'Timeout',
28
+ description: 'The time one has to wait before teleporting again.',
29
+ 'x-component': 'duration',
30
+ type: 'number',
31
+ minimum: 0,
32
+ default: Duration.fromObject({ second: 1 }).as('milliseconds'),
33
+ },
34
+ allowPublicTeleports: {
35
+ type: 'boolean',
36
+ description: 'Players can create public teleports.',
37
+ default: false,
38
+ },
39
+ },
40
+ required: [],
41
+ additionalProperties: false,
42
+ }),
43
+ uiSchema: JSON.stringify({
44
+ timeout: { 'ui:widget': 'duration' },
45
+ }),
46
+ functions: [
47
+ new IFunction({
48
+ name: 'utils',
49
+ function: this.loadFn('functions', 'utils'),
50
+ }),
51
+ ],
52
+ permissions: [
53
+ new IPermission({
54
+ permission: 'TELEPORTS_CREATE_PUBLIC',
55
+ friendlyName: 'Create Public Teleports',
56
+ description: 'Allows the player to create public teleports.',
57
+ canHaveCount: true,
58
+ }),
59
+ new IPermission({
60
+ permission: 'TELEPORTS_USE',
61
+ friendlyName: 'Use Teleports',
62
+ description: 'Allows the player to use teleports modules.',
63
+ canHaveCount: true,
64
+ }),
65
+ new IPermission({
66
+ permission: 'TELEPORTS_MANAGE_WAYPOINTS',
67
+ friendlyName: 'Manage waypoints',
68
+ description: 'Allows creating, deleting, and managing waypoints.',
69
+ canHaveCount: false,
70
+ }),
71
+ ],
72
+ commands: [
73
+ new ICommand({
74
+ function: this.loadFn('commands', 'teleport'),
75
+ name: 'teleport',
76
+ trigger: 'tp',
77
+ helpText: 'Teleports to one of your set locations.',
78
+ requiredPermissions: ['TELEPORTS_USE'],
79
+ arguments: [
80
+ {
81
+ name: 'tp',
82
+ type: 'string',
83
+ defaultValue: null,
84
+ helpText: 'The location to teleport to.',
85
+ position: 0,
86
+ },
87
+ ],
88
+ }),
89
+ new ICommand({
90
+ function: this.loadFn('commands', 'tplist'),
91
+ name: 'tplist',
92
+ trigger: 'tplist',
93
+ helpText: 'Lists all your set locations.',
94
+ requiredPermissions: ['TELEPORTS_USE'],
95
+ arguments: [],
96
+ }),
97
+ new ICommand({
98
+ function: this.loadFn('commands', 'settp'),
99
+ name: 'settp',
100
+ trigger: 'settp',
101
+ helpText: 'Sets a location to teleport to.',
102
+ requiredPermissions: ['TELEPORTS_USE'],
103
+ arguments: [
104
+ {
105
+ name: 'tp',
106
+ type: 'string',
107
+ defaultValue: null,
108
+ helpText: 'The location name.',
109
+ position: 0,
110
+ },
111
+ ],
112
+ }),
113
+ new ICommand({
114
+ function: this.loadFn('commands', 'deletetp'),
115
+ name: 'deletetp',
116
+ trigger: 'deletetp',
117
+ helpText: 'Deletes a location.',
118
+ arguments: [
119
+ {
120
+ name: 'tp',
121
+ type: 'string',
122
+ defaultValue: null,
123
+ helpText: 'The location name.',
124
+ position: 0,
125
+ },
126
+ ],
127
+ }),
128
+ new ICommand({
129
+ function: this.loadFn('commands', 'setpublic'),
130
+ name: 'setpublic',
131
+ trigger: 'setpublic',
132
+ helpText: 'Sets a teleport to be public, allowing other players to teleport to it.',
133
+ requiredPermissions: ['TELEPORTS_CREATE_PUBLIC'],
134
+ arguments: [
135
+ {
136
+ name: 'tp',
137
+ type: 'string',
138
+ defaultValue: null,
139
+ helpText: 'The location name.',
140
+ position: 0,
141
+ },
142
+ ],
143
+ }),
144
+ new ICommand({
145
+ function: this.loadFn('commands', 'setprivate'),
146
+ name: 'setprivate',
147
+ trigger: 'setprivate',
148
+ helpText: 'Sets a teleport to be private, only the teleport owner can teleport to it.',
149
+ arguments: [
150
+ {
151
+ name: 'tp',
152
+ type: 'string',
153
+ defaultValue: null,
154
+ helpText: 'The location name.',
155
+ position: 0,
156
+ },
157
+ ],
158
+ }),
159
+ new ICommand({
160
+ function: this.loadFn('commands', 'setwaypoint'),
161
+ name: 'setwaypoint',
162
+ trigger: 'setwaypoint',
163
+ helpText: 'Creates a new waypoint.',
164
+ requiredPermissions: ['TELEPORTS_MANAGE_WAYPOINTS'],
165
+ arguments: [
166
+ {
167
+ name: 'waypoint',
168
+ type: 'string',
169
+ defaultValue: null,
170
+ helpText: 'The location name.',
171
+ position: 0,
172
+ },
173
+ ],
174
+ }),
175
+ new ICommand({
176
+ function: this.loadFn('commands', 'deletewaypoint'),
177
+ name: 'deletewaypoint',
178
+ trigger: 'deletewaypoint',
179
+ helpText: 'Deletes a waypoint.',
180
+ requiredPermissions: ['TELEPORTS_MANAGE_WAYPOINTS'],
181
+ arguments: [
182
+ {
183
+ name: 'waypoint',
184
+ type: 'string',
185
+ defaultValue: null,
186
+ helpText: 'The location name.',
187
+ position: 0,
188
+ },
189
+ ],
190
+ }),
191
+ new ICommand({
192
+ function: this.loadFn('commands', 'listwaypoints'),
193
+ name: 'listwaypoints',
194
+ trigger: 'waypoints',
195
+ helpText: 'Lists all waypoints.',
196
+ arguments: [],
197
+ }),
198
+ new ICommand({
199
+ function: this.loadFn('commands', 'teleportwaypoint'),
200
+ name: 'teleportwaypoint',
201
+ trigger: 'teleportwaypoint',
202
+ arguments: [],
203
+ helpText:
204
+ 'Placeholder command, this will not be used directly. The module will install aliases for this command corresponding to the waypoint names.',
205
+ }),
206
+ ],
207
+ cronJobs: [
208
+ new ICronJob({
209
+ name: 'Waypoint reconciler',
210
+ temporalValue: '*/30 * * * *',
211
+ function: this.loadFn('cronJobs', 'Waypoint reconciler'),
212
+ }),
213
+ ],
214
+ }),
215
+ ];
216
+ }
217
+ }