@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.
- package/README.md +3 -0
- package/dist/BuiltinModule.d.ts +62 -0
- package/dist/BuiltinModule.d.ts.map +1 -0
- package/dist/BuiltinModule.js +245 -0
- package/dist/BuiltinModule.js.map +1 -0
- package/dist/community-modules.json +21 -0
- package/dist/dto/base.d.ts +7 -0
- package/dist/dto/base.d.ts.map +1 -0
- package/dist/dto/base.js +28 -0
- package/dist/dto/base.js.map +1 -0
- package/dist/dto/discordEvents.d.ts +32 -0
- package/dist/dto/discordEvents.d.ts.map +1 -0
- package/dist/dto/discordEvents.js +92 -0
- package/dist/dto/discordEvents.js.map +1 -0
- package/dist/dto/gameEvents.d.ts +83 -0
- package/dist/dto/gameEvents.d.ts.map +1 -0
- package/dist/dto/gameEvents.js +205 -0
- package/dist/dto/gameEvents.js.map +1 -0
- package/dist/dto/index.d.ts +54 -0
- package/dist/dto/index.d.ts.map +1 -0
- package/dist/dto/index.js +18 -0
- package/dist/dto/index.js.map +1 -0
- package/dist/dto/takaroEvents.d.ts +276 -0
- package/dist/dto/takaroEvents.d.ts.map +1 -0
- package/dist/dto/takaroEvents.js +794 -0
- package/dist/dto/takaroEvents.js.map +1 -0
- package/dist/main.d.ts +5 -0
- package/dist/main.d.ts.map +1 -0
- package/dist/main.js +35 -0
- package/dist/main.js.map +1 -0
- package/dist/modules/chatBridge/hooks/DiscordToGame.d.ts +2 -0
- package/dist/modules/chatBridge/hooks/DiscordToGame.d.ts.map +1 -0
- package/dist/modules/chatBridge/hooks/DiscordToGame.js +18 -0
- package/dist/modules/chatBridge/hooks/DiscordToGame.js.map +1 -0
- package/dist/modules/chatBridge/hooks/GameToDiscord.d.ts +2 -0
- package/dist/modules/chatBridge/hooks/GameToDiscord.d.ts.map +1 -0
- package/dist/modules/chatBridge/hooks/GameToDiscord.js +14 -0
- package/dist/modules/chatBridge/hooks/GameToDiscord.js.map +1 -0
- package/dist/modules/chatBridge/hooks/PlayerConnected.d.ts +2 -0
- package/dist/modules/chatBridge/hooks/PlayerConnected.d.ts.map +1 -0
- package/dist/modules/chatBridge/hooks/PlayerConnected.js +9 -0
- package/dist/modules/chatBridge/hooks/PlayerConnected.js.map +1 -0
- package/dist/modules/chatBridge/hooks/PlayerDisconnected.d.ts +2 -0
- package/dist/modules/chatBridge/hooks/PlayerDisconnected.d.ts.map +1 -0
- package/dist/modules/chatBridge/hooks/PlayerDisconnected.js +9 -0
- package/dist/modules/chatBridge/hooks/PlayerDisconnected.js.map +1 -0
- package/dist/modules/chatBridge/index.d.ts +5 -0
- package/dist/modules/chatBridge/index.d.ts.map +1 -0
- package/dist/modules/chatBridge/index.js +64 -0
- package/dist/modules/chatBridge/index.js.map +1 -0
- package/dist/modules/dailyRewards/commands/daily.d.ts +2 -0
- package/dist/modules/dailyRewards/commands/daily.d.ts.map +1 -0
- package/dist/modules/dailyRewards/commands/daily.js +103 -0
- package/dist/modules/dailyRewards/commands/daily.js.map +1 -0
- package/dist/modules/dailyRewards/commands/streak.d.ts +2 -0
- package/dist/modules/dailyRewards/commands/streak.d.ts.map +1 -0
- package/dist/modules/dailyRewards/commands/streak.js +34 -0
- package/dist/modules/dailyRewards/commands/streak.js.map +1 -0
- package/dist/modules/dailyRewards/commands/topstreak.d.ts +2 -0
- package/dist/modules/dailyRewards/commands/topstreak.d.ts.map +1 -0
- package/dist/modules/dailyRewards/commands/topstreak.js +44 -0
- package/dist/modules/dailyRewards/commands/topstreak.js.map +1 -0
- package/dist/modules/dailyRewards/functions/utils.d.ts +6 -0
- package/dist/modules/dailyRewards/functions/utils.d.ts.map +1 -0
- package/dist/modules/dailyRewards/functions/utils.js +32 -0
- package/dist/modules/dailyRewards/functions/utils.js.map +1 -0
- package/dist/modules/dailyRewards/hooks/dailyLoginCheck.d.ts +2 -0
- package/dist/modules/dailyRewards/hooks/dailyLoginCheck.d.ts.map +1 -0
- package/dist/modules/dailyRewards/hooks/dailyLoginCheck.js +19 -0
- package/dist/modules/dailyRewards/hooks/dailyLoginCheck.js.map +1 -0
- package/dist/modules/dailyRewards/index.d.ts +5 -0
- package/dist/modules/dailyRewards/index.d.ts.map +1 -0
- package/dist/modules/dailyRewards/index.js +127 -0
- package/dist/modules/dailyRewards/index.js.map +1 -0
- package/dist/modules/economyUtils/commands/balance.d.ts +2 -0
- package/dist/modules/economyUtils/commands/balance.d.ts.map +1 -0
- package/dist/modules/economyUtils/commands/balance.js +7 -0
- package/dist/modules/economyUtils/commands/balance.js.map +1 -0
- package/dist/modules/economyUtils/commands/claim.d.ts +2 -0
- package/dist/modules/economyUtils/commands/claim.d.ts.map +1 -0
- package/dist/modules/economyUtils/commands/claim.js +35 -0
- package/dist/modules/economyUtils/commands/claim.js.map +1 -0
- package/dist/modules/economyUtils/commands/confirmTransfer.d.ts +2 -0
- package/dist/modules/economyUtils/commands/confirmTransfer.d.ts.map +1 -0
- package/dist/modules/economyUtils/commands/confirmTransfer.js +38 -0
- package/dist/modules/economyUtils/commands/confirmTransfer.js.map +1 -0
- package/dist/modules/economyUtils/commands/grantCurrency.d.ts +2 -0
- package/dist/modules/economyUtils/commands/grantCurrency.d.ts.map +1 -0
- package/dist/modules/economyUtils/commands/grantCurrency.js +28 -0
- package/dist/modules/economyUtils/commands/grantCurrency.js.map +1 -0
- package/dist/modules/economyUtils/commands/revokeCurrency.d.ts +2 -0
- package/dist/modules/economyUtils/commands/revokeCurrency.d.ts.map +1 -0
- package/dist/modules/economyUtils/commands/revokeCurrency.js +28 -0
- package/dist/modules/economyUtils/commands/revokeCurrency.js.map +1 -0
- package/dist/modules/economyUtils/commands/shop.d.ts +2 -0
- package/dist/modules/economyUtils/commands/shop.d.ts.map +1 -0
- package/dist/modules/economyUtils/commands/shop.js +69 -0
- package/dist/modules/economyUtils/commands/shop.js.map +1 -0
- package/dist/modules/economyUtils/commands/topCurrency.d.ts +2 -0
- package/dist/modules/economyUtils/commands/topCurrency.d.ts.map +1 -0
- package/dist/modules/economyUtils/commands/topCurrency.js +22 -0
- package/dist/modules/economyUtils/commands/topCurrency.js.map +1 -0
- package/dist/modules/economyUtils/commands/transfer.d.ts +2 -0
- package/dist/modules/economyUtils/commands/transfer.d.ts.map +1 -0
- package/dist/modules/economyUtils/commands/transfer.js +55 -0
- package/dist/modules/economyUtils/commands/transfer.js.map +1 -0
- package/dist/modules/economyUtils/cronJobs/zombieKillReward.d.ts +2 -0
- package/dist/modules/economyUtils/cronJobs/zombieKillReward.d.ts.map +1 -0
- package/dist/modules/economyUtils/cronJobs/zombieKillReward.js +66 -0
- package/dist/modules/economyUtils/cronJobs/zombieKillReward.js.map +1 -0
- package/dist/modules/economyUtils/index.d.ts +5 -0
- package/dist/modules/economyUtils/index.d.ts.map +1 -0
- package/dist/modules/economyUtils/index.js +192 -0
- package/dist/modules/economyUtils/index.js.map +1 -0
- package/dist/modules/geoBlock/hooks/IPDetected.d.ts +2 -0
- package/dist/modules/geoBlock/hooks/IPDetected.d.ts.map +1 -0
- package/dist/modules/geoBlock/hooks/IPDetected.js +50 -0
- package/dist/modules/geoBlock/hooks/IPDetected.js.map +1 -0
- package/dist/modules/geoBlock/index.d.ts +9 -0
- package/dist/modules/geoBlock/index.d.ts.map +1 -0
- package/dist/modules/geoBlock/index.js +329 -0
- package/dist/modules/geoBlock/index.js.map +1 -0
- package/dist/modules/gimme/commands/gimme.d.ts +2 -0
- package/dist/modules/gimme/commands/gimme.d.ts.map +1 -0
- package/dist/modules/gimme/commands/gimme.js +25 -0
- package/dist/modules/gimme/commands/gimme.js.map +1 -0
- package/dist/modules/gimme/index.d.ts +5 -0
- package/dist/modules/gimme/index.d.ts.map +1 -0
- package/dist/modules/gimme/index.js +75 -0
- package/dist/modules/gimme/index.js.map +1 -0
- package/dist/modules/highPingKicker/cronJobs/Ping check.d.ts +2 -0
- package/dist/modules/highPingKicker/cronJobs/Ping check.d.ts.map +1 -0
- package/dist/modules/highPingKicker/cronJobs/Ping check.js +59 -0
- package/dist/modules/highPingKicker/cronJobs/Ping check.js.map +1 -0
- package/dist/modules/highPingKicker/index.d.ts +5 -0
- package/dist/modules/highPingKicker/index.d.ts.map +1 -0
- package/dist/modules/highPingKicker/index.js +44 -0
- package/dist/modules/highPingKicker/index.js.map +1 -0
- package/dist/modules/lottery/commands/buyTicket.d.ts +2 -0
- package/dist/modules/lottery/commands/buyTicket.d.ts.map +1 -0
- package/dist/modules/lottery/commands/buyTicket.js +51 -0
- package/dist/modules/lottery/commands/buyTicket.js.map +1 -0
- package/dist/modules/lottery/commands/nextDraw.d.ts +2 -0
- package/dist/modules/lottery/commands/nextDraw.d.ts.map +1 -0
- package/dist/modules/lottery/commands/nextDraw.js +34 -0
- package/dist/modules/lottery/commands/nextDraw.js.map +1 -0
- package/dist/modules/lottery/commands/viewTickets.d.ts +2 -0
- package/dist/modules/lottery/commands/viewTickets.d.ts.map +1 -0
- package/dist/modules/lottery/commands/viewTickets.js +20 -0
- package/dist/modules/lottery/commands/viewTickets.js.map +1 -0
- package/dist/modules/lottery/cronJobs/drawLottery.d.ts +2 -0
- package/dist/modules/lottery/cronJobs/drawLottery.d.ts.map +1 -0
- package/dist/modules/lottery/cronJobs/drawLottery.js +96 -0
- package/dist/modules/lottery/cronJobs/drawLottery.js.map +1 -0
- package/dist/modules/lottery/index.d.ts +5 -0
- package/dist/modules/lottery/index.d.ts.map +1 -0
- package/dist/modules/lottery/index.js +85 -0
- package/dist/modules/lottery/index.js.map +1 -0
- package/dist/modules/playerOnboarding/commands/starterkit.d.ts +2 -0
- package/dist/modules/playerOnboarding/commands/starterkit.d.ts.map +1 -0
- package/dist/modules/playerOnboarding/commands/starterkit.js +47 -0
- package/dist/modules/playerOnboarding/commands/starterkit.js.map +1 -0
- package/dist/modules/playerOnboarding/hooks/playerConnected.d.ts +2 -0
- package/dist/modules/playerOnboarding/hooks/playerConnected.d.ts.map +1 -0
- package/dist/modules/playerOnboarding/hooks/playerConnected.js +11 -0
- package/dist/modules/playerOnboarding/hooks/playerConnected.js.map +1 -0
- package/dist/modules/playerOnboarding/index.d.ts +5 -0
- package/dist/modules/playerOnboarding/index.d.ts.map +1 -0
- package/dist/modules/playerOnboarding/index.js +83 -0
- package/dist/modules/playerOnboarding/index.js.map +1 -0
- package/dist/modules/serverMessages/cronJobs/Automated message.d.ts +2 -0
- package/dist/modules/serverMessages/cronJobs/Automated message.d.ts.map +1 -0
- package/dist/modules/serverMessages/cronJobs/Automated message.js +41 -0
- package/dist/modules/serverMessages/cronJobs/Automated message.js.map +1 -0
- package/dist/modules/serverMessages/index.d.ts +5 -0
- package/dist/modules/serverMessages/index.d.ts.map +1 -0
- package/dist/modules/serverMessages/index.js +45 -0
- package/dist/modules/serverMessages/index.js.map +1 -0
- package/dist/modules/teleports/commands/deletetp.d.ts +2 -0
- package/dist/modules/teleports/commands/deletetp.d.ts.map +1 -0
- package/dist/modules/teleports/commands/deletetp.js +20 -0
- package/dist/modules/teleports/commands/deletetp.js.map +1 -0
- package/dist/modules/teleports/commands/deletewaypoint.d.ts +2 -0
- package/dist/modules/teleports/commands/deletewaypoint.d.ts.map +1 -0
- package/dist/modules/teleports/commands/deletewaypoint.js +20 -0
- package/dist/modules/teleports/commands/deletewaypoint.js.map +1 -0
- package/dist/modules/teleports/commands/listwaypoints.d.ts +2 -0
- package/dist/modules/teleports/commands/listwaypoints.d.ts.map +1 -0
- package/dist/modules/teleports/commands/listwaypoints.js +17 -0
- package/dist/modules/teleports/commands/listwaypoints.js.map +1 -0
- package/dist/modules/teleports/commands/setprivate.d.ts +2 -0
- package/dist/modules/teleports/commands/setprivate.d.ts.map +1 -0
- package/dist/modules/teleports/commands/setprivate.js +29 -0
- package/dist/modules/teleports/commands/setprivate.js.map +1 -0
- package/dist/modules/teleports/commands/setpublic.d.ts +2 -0
- package/dist/modules/teleports/commands/setpublic.d.ts.map +1 -0
- package/dist/modules/teleports/commands/setpublic.js +45 -0
- package/dist/modules/teleports/commands/setpublic.js.map +1 -0
- package/dist/modules/teleports/commands/settp.d.ts +2 -0
- package/dist/modules/teleports/commands/settp.d.ts.map +1 -0
- package/dist/modules/teleports/commands/settp.js +40 -0
- package/dist/modules/teleports/commands/settp.js.map +1 -0
- package/dist/modules/teleports/commands/setwaypoint.d.ts +2 -0
- package/dist/modules/teleports/commands/setwaypoint.d.ts.map +1 -0
- package/dist/modules/teleports/commands/setwaypoint.js +28 -0
- package/dist/modules/teleports/commands/setwaypoint.js.map +1 -0
- package/dist/modules/teleports/commands/teleport.d.ts +2 -0
- package/dist/modules/teleports/commands/teleport.d.ts.map +1 -0
- package/dist/modules/teleports/commands/teleport.js +68 -0
- package/dist/modules/teleports/commands/teleport.js.map +1 -0
- package/dist/modules/teleports/commands/teleportwaypoint.d.ts +2 -0
- package/dist/modules/teleports/commands/teleportwaypoint.d.ts.map +1 -0
- package/dist/modules/teleports/commands/teleportwaypoint.js +43 -0
- package/dist/modules/teleports/commands/teleportwaypoint.js.map +1 -0
- package/dist/modules/teleports/commands/tplist.d.ts +2 -0
- package/dist/modules/teleports/commands/tplist.d.ts.map +1 -0
- package/dist/modules/teleports/commands/tplist.js +46 -0
- package/dist/modules/teleports/commands/tplist.js.map +1 -0
- package/dist/modules/teleports/cronJobs/Waypoint reconciler.d.ts +2 -0
- package/dist/modules/teleports/cronJobs/Waypoint reconciler.d.ts.map +1 -0
- package/dist/modules/teleports/cronJobs/Waypoint reconciler.js +6 -0
- package/dist/modules/teleports/cronJobs/Waypoint reconciler.js.map +1 -0
- package/dist/modules/teleports/functions/utils.d.ts +14 -0
- package/dist/modules/teleports/functions/utils.d.ts.map +1 -0
- package/dist/modules/teleports/functions/utils.js +156 -0
- package/dist/modules/teleports/functions/utils.js.map +1 -0
- package/dist/modules/teleports/index.d.ts +5 -0
- package/dist/modules/teleports/index.d.ts.map +1 -0
- package/dist/modules/teleports/index.js +208 -0
- package/dist/modules/teleports/index.js.map +1 -0
- package/dist/modules/timedShutdown/cronJobs/Shutdown.d.ts +2 -0
- package/dist/modules/timedShutdown/cronJobs/Shutdown.d.ts.map +1 -0
- package/dist/modules/timedShutdown/cronJobs/Shutdown.js +7 -0
- package/dist/modules/timedShutdown/cronJobs/Shutdown.js.map +1 -0
- package/dist/modules/timedShutdown/cronJobs/warning.d.ts +2 -0
- package/dist/modules/timedShutdown/cronJobs/warning.d.ts.map +1 -0
- package/dist/modules/timedShutdown/cronJobs/warning.js +10 -0
- package/dist/modules/timedShutdown/cronJobs/warning.js.map +1 -0
- package/dist/modules/timedShutdown/index.d.ts +5 -0
- package/dist/modules/timedShutdown/index.d.ts.map +1 -0
- package/dist/modules/timedShutdown/index.js +43 -0
- package/dist/modules/timedShutdown/index.js.map +1 -0
- package/dist/modules/utils/commands/help.d.ts +2 -0
- package/dist/modules/utils/commands/help.d.ts.map +1 -0
- package/dist/modules/utils/commands/help.js +84 -0
- package/dist/modules/utils/commands/help.js.map +1 -0
- package/dist/modules/utils/commands/ping.d.ts +2 -0
- package/dist/modules/utils/commands/ping.d.ts.map +1 -0
- package/dist/modules/utils/commands/ping.js +6 -0
- package/dist/modules/utils/commands/ping.js.map +1 -0
- package/dist/modules/utils/index.d.ts +5 -0
- package/dist/modules/utils/index.d.ts.map +1 -0
- package/dist/modules/utils/index.js +52 -0
- package/dist/modules/utils/index.js.map +1 -0
- package/dist/modules.json +757 -0
- package/package.json +17 -0
- package/scripts/buildBuiltinJson.ts +81 -0
- package/src/BuiltinModule.ts +159 -0
- package/src/__tests__/aliases.integration.test.ts +90 -0
- package/src/__tests__/bugRepros.integration.test.ts +485 -0
- package/src/__tests__/builtinmodule.unit.test.ts +15 -0
- package/src/__tests__/commandArgs.integration.test.ts +291 -0
- package/src/__tests__/crossServerPlayer.integration.test.ts +176 -0
- package/src/__tests__/economy/claim.integration.test.ts +250 -0
- package/src/__tests__/economy/economyUtils.integration.test.ts +495 -0
- package/src/__tests__/economy/shop.integration.test.ts +177 -0
- package/src/__tests__/economy/zombieKillReward.integration.test.ts +293 -0
- package/src/__tests__/geoblock.integration.test.ts +322 -0
- package/src/__tests__/gimme.integration.test.ts +106 -0
- package/src/__tests__/help.integration.test.ts +314 -0
- package/src/__tests__/highPingKicker.integration.test.ts +618 -0
- package/src/__tests__/lottery.integration.test.ts +344 -0
- package/src/__tests__/modulePermission.integration.test.ts +387 -0
- package/src/__tests__/onboarding.integration.test.ts +122 -0
- package/src/__tests__/ping.integration.test.ts +36 -0
- package/src/__tests__/roleExpiry.integration.test.ts +78 -0
- package/src/__tests__/serverMessages.integration.test.ts +116 -0
- package/src/__tests__/systemConfigCooldown.integration.test.ts +84 -0
- package/src/__tests__/systemConfigCost.integration.test.ts +194 -0
- package/src/__tests__/teleports/listtp.integration.test.ts +189 -0
- package/src/__tests__/teleports/publicteleports.integration.test.ts +345 -0
- package/src/__tests__/teleports/teleport.integration.test.ts +153 -0
- package/src/__tests__/teleports/tpManagement.integration.test.ts +175 -0
- package/src/__tests__/teleports/waypoints.integration.test.ts +832 -0
- package/src/community-modules/README.md +5 -0
- package/src/community-modules/modules/vote.json +19 -0
- package/src/dto/base.ts +13 -0
- package/src/dto/discordEvents.ts +69 -0
- package/src/dto/gameEvents.ts +159 -0
- package/src/dto/index.ts +25 -0
- package/src/dto/takaroEvents.ts +525 -0
- package/src/main.ts +47 -0
- package/src/modules/.eslintrc +5 -0
- package/src/modules/chatBridge/hooks/DiscordToGame.js +18 -0
- package/src/modules/chatBridge/hooks/GameToDiscord.js +18 -0
- package/src/modules/chatBridge/hooks/PlayerConnected.js +11 -0
- package/src/modules/chatBridge/hooks/PlayerDisconnected.js +11 -0
- package/src/modules/chatBridge/index.ts +64 -0
- package/src/modules/dailyRewards/commands/daily.js +114 -0
- package/src/modules/dailyRewards/commands/streak.js +42 -0
- package/src/modules/dailyRewards/commands/topstreak.js +54 -0
- package/src/modules/dailyRewards/functions/utils.js +36 -0
- package/src/modules/dailyRewards/hooks/dailyLoginCheck.js +24 -0
- package/src/modules/dailyRewards/index.ts +138 -0
- package/src/modules/economyUtils/commands/balance.js +8 -0
- package/src/modules/economyUtils/commands/claim.js +42 -0
- package/src/modules/economyUtils/commands/confirmTransfer.js +55 -0
- package/src/modules/economyUtils/commands/grantCurrency.js +34 -0
- package/src/modules/economyUtils/commands/revokeCurrency.js +34 -0
- package/src/modules/economyUtils/commands/shop.js +87 -0
- package/src/modules/economyUtils/commands/topCurrency.js +29 -0
- package/src/modules/economyUtils/commands/transfer.js +73 -0
- package/src/modules/economyUtils/cronJobs/zombieKillReward.js +82 -0
- package/src/modules/economyUtils/index.ts +197 -0
- package/src/modules/geoBlock/hooks/IPDetected.js +53 -0
- package/src/modules/geoBlock/index.ts +333 -0
- package/src/modules/gimme/commands/gimme.js +30 -0
- package/src/modules/gimme/index.ts +76 -0
- package/src/modules/highPingKicker/cronJobs/Ping check.js +68 -0
- package/src/modules/highPingKicker/index.ts +44 -0
- package/src/modules/lottery/commands/buyTicket.js +64 -0
- package/src/modules/lottery/commands/nextDraw.js +47 -0
- package/src/modules/lottery/commands/viewTickets.js +28 -0
- package/src/modules/lottery/cronJobs/drawLottery.js +124 -0
- package/src/modules/lottery/index.ts +86 -0
- package/src/modules/playerOnboarding/commands/starterkit.js +61 -0
- package/src/modules/playerOnboarding/hooks/playerConnected.js +14 -0
- package/src/modules/playerOnboarding/index.ts +86 -0
- package/src/modules/serverMessages/cronJobs/Automated message.js +47 -0
- package/src/modules/serverMessages/index.ts +46 -0
- package/src/modules/teleports/commands/deletetp.js +25 -0
- package/src/modules/teleports/commands/deletewaypoint.js +24 -0
- package/src/modules/teleports/commands/listwaypoints.js +23 -0
- package/src/modules/teleports/commands/setprivate.js +39 -0
- package/src/modules/teleports/commands/setpublic.js +60 -0
- package/src/modules/teleports/commands/settp.js +50 -0
- package/src/modules/teleports/commands/setwaypoint.js +31 -0
- package/src/modules/teleports/commands/teleport.js +84 -0
- package/src/modules/teleports/commands/teleportwaypoint.js +57 -0
- package/src/modules/teleports/commands/tplist.js +62 -0
- package/src/modules/teleports/cronJobs/Waypoint reconciler.js +7 -0
- package/src/modules/teleports/functions/utils.js +189 -0
- package/src/modules/teleports/index.ts +217 -0
- package/src/modules/timedShutdown/cronJobs/Shutdown.js +8 -0
- package/src/modules/timedShutdown/cronJobs/warning.js +13 -0
- package/src/modules/timedShutdown/index.ts +45 -0
- package/src/modules/utils/commands/help.js +100 -0
- package/src/modules/utils/commands/ping.js +7 -0
- package/src/modules/utils/index.ts +53 -0
- package/tsconfig.build.json +10 -0
- package/tsconfig.json +9 -0
- package/typedoc.json +3 -0
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# Community modules
|
|
2
|
+
|
|
3
|
+
This directory contains modules that are not part of the core suite of built in modules, but are contributed by the community. They are not officially supported, but are provided as-is for the community to use and improve.
|
|
4
|
+
|
|
5
|
+
We welcome contributions to this directory. If you have a module that you would like to contribute, please open a pull request.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"commands": [
|
|
3
|
+
{
|
|
4
|
+
"function": "\nimport { takaro, data, axios } from '@takaro/helpers';\nasync function main() {\n const { pog } = data;\n const playerRes = await takaro.player.playerControllerGetOne(data.player.id);\n const steamId = playerRes.data.data.steamId;\n const xboxLiveId = playerRes.data.data.xboxLiveId;\n const name = playerRes.data.data.name;\n const key = data.module.userConfig.votekey;\n\n let voteId = `username=${name}`;\n if (steamId.startsWith(\"7656\")) { voteId = `steamid=${steamId}`; }\n\n\n const res = await axios.get(`https://7daystodie-servers.com/api/?object=votes&element=claim&key=${key}&${voteId}`);\n if (res.data == 0) { data.player.pm(data.module.userConfig.didntvote); }\n if (res.data == 2) { data.player.pm(data.module.userConfig.alreadyvoted); }\n if (res.data == 1) {\n\n const claimresponse = await axios.post(`https://7daystodie-servers.com/api/?action=post&object=votes&element=claim&key=${key}&${voteId}`);\n if (claimresponse.data == 1) {\n if (data.module.userConfig.votednow.toLowerCase() !== 'none' && data.module.userConfig.votednow.toLowerCase() !== '\"none\"') { data.player.pm(data.module.userConfig.votednow); }\n if (data.module.userConfig.publicMessage.toLowerCase() !== 'none' && data.module.userConfig.publicMessage.toLowerCase() !== '\"none\"') {\n const originalMessage = data.module.userConfig.publicMessage;\n const modifiedMessage = originalMessage.replace(/\\{name\\}/g, name);\n await takaro.gameserver.gameServerControllerExecuteCommand(data.gameServerId, { command: `say \"${modifiedMessage}\"` });\n }\n await takaro.playerOnGameserver.playerOnGameServerControllerAddCurrency(data.gameServerId, pog.playerId, { currency: data.module.userConfig.currency });\n for (const stuff of data.module.userConfig.giveStuff) {\n if (voteId.startsWith(`steamid`)) {\n await takaro.gameserver.gameServerControllerExecuteCommand(data.gameServerId, { command: `giveplus Steam_${steamId} ${stuff}` });\n } else {\n await takaro.gameserver.gameServerControllerExecuteCommand(data.gameServerId, { command: `giveplus ${xboxLiveId} ${stuff}` });\n }\n }\n }\n }\n}\n\n\n\nawait main();",
|
|
5
|
+
"name": "vote",
|
|
6
|
+
"trigger": "vote",
|
|
7
|
+
"helpText": "Vote for the server and give players rewards.",
|
|
8
|
+
"arguments": []
|
|
9
|
+
}
|
|
10
|
+
],
|
|
11
|
+
"hooks": [],
|
|
12
|
+
"cronJobs": [],
|
|
13
|
+
"functions": [],
|
|
14
|
+
"permissions": [],
|
|
15
|
+
"name": "Vote",
|
|
16
|
+
"description": "Takaro Vote Module",
|
|
17
|
+
"configSchema": "{\"$schema\":\"http://json-schema.org/draft-07/schema#\",\"type\":\"object\",\"required\":[\"votekey\",\"didntvote\",\"alreadyvoted\"],\"additionalProperties\":false,\"properties\":{\"votekey\":{\"title\":\"votekey\",\"description\":\"Votekey from website\",\"default\":\"\",\"type\":\"string\"},\"didntvote\":{\"title\":\"didntvote\",\"description\":\"Message to send to the player when voting site reports no vote was cast.\",\"default\":\"You haven't voted yet.\",\"type\":\"string\"},\"alreadyvoted\":{\"title\":\"alreadyvoted\",\"description\":\"Message to send to the player when voting site reports the vote was already claimed.\",\"default\":\"You have already claimed your last vote.\",\"type\":\"string\"},\"votednow\":{\"title\":\"votednow\",\"description\":\"Optional message to send to the player when vote is successful. \\nUse \\\"none\\\" as the message if you want nothing to be sent instead.\",\"default\":\"Thanks for voting.\",\"type\":\"string\"},\"publicMessage\":{\"title\":\"publicMessage\",\"description\":\"Optional message to broadcast to all players online when vote is successful. Use {name} in the message to refer to the player name.\\nUse \\\"none\\\" as the message if you want nothing to be sent instead.\",\"default\":\"[FF0000]{name}[-] voted at 7daystodie-servers.com and was rewarded Takaro Coins!\",\"type\":\"string\"},\"giveStuff\":{\"title\":\"giveStuff\",\"description\":\"Items to give to the player thru giveplus command. Must indicate quantities and, if applies, quality:\\n<item name> <amount> [<quality> <usedTimes>]\\n\\nItem name has to be the exact name of an item as listed by \\\"listitems\\\".\\n\\nQuality is the quality of the dropped items for items that have a quality.\\n\\nusedTimes is the % that the item was used.\\n\\nThe default value is giving 2 waters and a tier 6 stone axe with no use. If you are going to copy/paste, include the arguments. \",\"default\":[\"drinkJarBoiledWater 2\",\"meleeToolRepairT0StoneAxe 1 6 0\"],\"type\":\"array\",\"items\":{\"type\":\"string\"}},\"currency\":{\"title\":\"currency\",\"description\":\"How much currency to add to the player in Takaro\",\"default\":0,\"type\":\"number\"}}}",
|
|
18
|
+
"uiSchema": "{}"
|
|
19
|
+
}
|
package/src/dto/base.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { TakaroDTO } from '@takaro/util';
|
|
2
|
+
import { IsISO8601, IsString } from 'class-validator';
|
|
3
|
+
import { EventTypes } from './index.js';
|
|
4
|
+
import { Exclude } from 'class-transformer';
|
|
5
|
+
|
|
6
|
+
export class BaseEvent<T> extends TakaroDTO<T> {
|
|
7
|
+
@IsISO8601()
|
|
8
|
+
timestamp: string = new Date().toISOString();
|
|
9
|
+
|
|
10
|
+
@IsString()
|
|
11
|
+
@Exclude({ toPlainOnly: true })
|
|
12
|
+
type: EventTypes;
|
|
13
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { IsBoolean, IsEnum, IsString, ValidateNested } from 'class-validator';
|
|
2
|
+
import { Type } from 'class-transformer';
|
|
3
|
+
import { TakaroDTO } from '@takaro/util';
|
|
4
|
+
import { ValueOf } from 'type-fest';
|
|
5
|
+
import { BaseEvent } from './base.js';
|
|
6
|
+
|
|
7
|
+
export const DiscordEvents = {
|
|
8
|
+
DISCORD_MESSAGE: 'discord-message',
|
|
9
|
+
} as const;
|
|
10
|
+
|
|
11
|
+
export class BaseDiscordEvent<T> extends BaseEvent<T> {
|
|
12
|
+
@IsEnum(DiscordEvents)
|
|
13
|
+
declare type: ValueOf<typeof DiscordEvents>;
|
|
14
|
+
|
|
15
|
+
@IsString()
|
|
16
|
+
msg: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export class EventDiscordUser extends TakaroDTO<EventDiscordUser> {
|
|
20
|
+
@IsString()
|
|
21
|
+
id: string;
|
|
22
|
+
|
|
23
|
+
@IsString()
|
|
24
|
+
username: string;
|
|
25
|
+
|
|
26
|
+
@IsString()
|
|
27
|
+
displayName: string;
|
|
28
|
+
|
|
29
|
+
@IsBoolean()
|
|
30
|
+
isBot: boolean;
|
|
31
|
+
|
|
32
|
+
@IsBoolean()
|
|
33
|
+
isTakaroBot: boolean;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export class EventDiscordChannel extends TakaroDTO<EventDiscordChannel> {
|
|
37
|
+
@IsString()
|
|
38
|
+
id: string;
|
|
39
|
+
|
|
40
|
+
@IsString()
|
|
41
|
+
name: string;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export class HookEventDiscordMessage extends BaseEvent<HookEventDiscordMessage> {
|
|
45
|
+
@IsString()
|
|
46
|
+
type = DiscordEvents.DISCORD_MESSAGE;
|
|
47
|
+
|
|
48
|
+
@IsString()
|
|
49
|
+
msg: string;
|
|
50
|
+
|
|
51
|
+
@ValidateNested()
|
|
52
|
+
@Type(() => EventDiscordUser)
|
|
53
|
+
author: EventDiscordUser;
|
|
54
|
+
|
|
55
|
+
@ValidateNested()
|
|
56
|
+
@Type(() => EventDiscordChannel)
|
|
57
|
+
channel: EventDiscordChannel;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export function isDiscordMessageEvent(a: unknown): a is HookEventDiscordMessage {
|
|
61
|
+
if (typeof a === 'object' && a !== null) {
|
|
62
|
+
return 'type' in a && a.type === DiscordEvents.DISCORD_MESSAGE;
|
|
63
|
+
}
|
|
64
|
+
return false;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export const DiscordEventsMapping = {
|
|
68
|
+
[DiscordEvents.DISCORD_MESSAGE]: HookEventDiscordMessage,
|
|
69
|
+
} as const;
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { IsEnum, IsString, ValidateNested, IsOptional, IsNumber, Matches } from 'class-validator';
|
|
2
|
+
import { TakaroDTO } from '@takaro/util';
|
|
3
|
+
import { Type } from 'class-transformer';
|
|
4
|
+
import { BaseEvent } from './base.js';
|
|
5
|
+
import { ValueOf } from 'type-fest';
|
|
6
|
+
|
|
7
|
+
export const GameEvents = {
|
|
8
|
+
LOG_LINE: 'log',
|
|
9
|
+
PLAYER_CONNECTED: 'player-connected',
|
|
10
|
+
PLAYER_DISCONNECTED: 'player-disconnected',
|
|
11
|
+
CHAT_MESSAGE: 'chat-message',
|
|
12
|
+
PLAYER_DEATH: 'player-death',
|
|
13
|
+
ENTITY_KILLED: 'entity-killed',
|
|
14
|
+
} as const;
|
|
15
|
+
|
|
16
|
+
export type GameEventTypes = ValueOf<typeof GameEvents>;
|
|
17
|
+
|
|
18
|
+
export class IGamePlayer extends TakaroDTO<IGamePlayer> {
|
|
19
|
+
/**
|
|
20
|
+
* Unique identifier for this player, as used by the game
|
|
21
|
+
*/
|
|
22
|
+
@IsString()
|
|
23
|
+
gameId!: string;
|
|
24
|
+
/**
|
|
25
|
+
* The players username
|
|
26
|
+
*/
|
|
27
|
+
@IsString()
|
|
28
|
+
name!: string;
|
|
29
|
+
|
|
30
|
+
@IsString()
|
|
31
|
+
@IsOptional()
|
|
32
|
+
steamId?: string;
|
|
33
|
+
|
|
34
|
+
@IsString()
|
|
35
|
+
@IsOptional()
|
|
36
|
+
epicOnlineServicesId?: string;
|
|
37
|
+
|
|
38
|
+
@IsString()
|
|
39
|
+
@IsOptional()
|
|
40
|
+
xboxLiveId?: string;
|
|
41
|
+
|
|
42
|
+
@IsString()
|
|
43
|
+
@IsOptional()
|
|
44
|
+
@Matches(/^[a-zA-Z0-9_-]+:[a-zA-Z0-9_-]+$/, {
|
|
45
|
+
message: "Platform ID must be in format 'platform:id' (e.g., 'minecraft:player-uuid')",
|
|
46
|
+
})
|
|
47
|
+
platformId?: string;
|
|
48
|
+
|
|
49
|
+
@IsString()
|
|
50
|
+
@IsOptional()
|
|
51
|
+
ip?: string;
|
|
52
|
+
|
|
53
|
+
@IsNumber()
|
|
54
|
+
@IsOptional()
|
|
55
|
+
ping?: number;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export class BaseGameEvent<T> extends BaseEvent<T> {
|
|
59
|
+
@IsEnum(GameEvents)
|
|
60
|
+
declare type: ValueOf<typeof GameEvents>;
|
|
61
|
+
|
|
62
|
+
@IsString()
|
|
63
|
+
@IsOptional()
|
|
64
|
+
msg: string;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export class EventLogLine extends BaseGameEvent<EventLogLine> {
|
|
68
|
+
@IsString()
|
|
69
|
+
type = GameEvents.LOG_LINE;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export class EventPlayerConnected extends BaseGameEvent<EventPlayerConnected> {
|
|
73
|
+
type = GameEvents.PLAYER_CONNECTED;
|
|
74
|
+
@ValidateNested()
|
|
75
|
+
@Type(() => IGamePlayer)
|
|
76
|
+
player: IGamePlayer;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export class EventPlayerDisconnected extends BaseGameEvent<EventPlayerDisconnected> {
|
|
80
|
+
type = GameEvents.PLAYER_DISCONNECTED;
|
|
81
|
+
@ValidateNested()
|
|
82
|
+
@Type(() => IGamePlayer)
|
|
83
|
+
player: IGamePlayer;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export enum ChatChannel {
|
|
87
|
+
GLOBAL = 'global',
|
|
88
|
+
TEAM = 'team',
|
|
89
|
+
FRIENDS = 'friends',
|
|
90
|
+
WHISPER = 'whisper',
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export class EventChatMessage extends BaseGameEvent<EventChatMessage> {
|
|
94
|
+
type = GameEvents.CHAT_MESSAGE;
|
|
95
|
+
@ValidateNested()
|
|
96
|
+
@Type(() => IGamePlayer)
|
|
97
|
+
player?: IGamePlayer;
|
|
98
|
+
|
|
99
|
+
@IsEnum(Object.values(ChatChannel))
|
|
100
|
+
channel: ChatChannel;
|
|
101
|
+
|
|
102
|
+
@ValidateNested()
|
|
103
|
+
@Type(() => IGamePlayer)
|
|
104
|
+
@IsOptional()
|
|
105
|
+
recipient?: IGamePlayer;
|
|
106
|
+
|
|
107
|
+
declare msg: string;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export class IPosition extends TakaroDTO<IPosition> {
|
|
111
|
+
@IsNumber()
|
|
112
|
+
x: number;
|
|
113
|
+
@IsNumber()
|
|
114
|
+
y: number;
|
|
115
|
+
@IsNumber()
|
|
116
|
+
z: number;
|
|
117
|
+
@IsString()
|
|
118
|
+
@IsOptional()
|
|
119
|
+
dimension?: string;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export class EventPlayerDeath extends BaseGameEvent<EventPlayerDeath> {
|
|
123
|
+
type = GameEvents.PLAYER_DEATH;
|
|
124
|
+
@ValidateNested()
|
|
125
|
+
@Type(() => IGamePlayer)
|
|
126
|
+
player: IGamePlayer;
|
|
127
|
+
|
|
128
|
+
@IsOptional()
|
|
129
|
+
@ValidateNested()
|
|
130
|
+
@Type(() => IGamePlayer)
|
|
131
|
+
attacker?: IGamePlayer;
|
|
132
|
+
|
|
133
|
+
@IsOptional()
|
|
134
|
+
@ValidateNested()
|
|
135
|
+
@Type(() => IPosition)
|
|
136
|
+
position: IPosition;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export class EventEntityKilled extends BaseGameEvent<EventEntityKilled> {
|
|
140
|
+
type = GameEvents.ENTITY_KILLED;
|
|
141
|
+
@ValidateNested()
|
|
142
|
+
@Type(() => IGamePlayer)
|
|
143
|
+
player: IGamePlayer;
|
|
144
|
+
|
|
145
|
+
@IsString()
|
|
146
|
+
entity: string;
|
|
147
|
+
|
|
148
|
+
@IsString()
|
|
149
|
+
weapon: string;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export const GameEventsMapping = {
|
|
153
|
+
[GameEvents.PLAYER_CONNECTED]: EventPlayerConnected,
|
|
154
|
+
[GameEvents.PLAYER_DISCONNECTED]: EventPlayerDisconnected,
|
|
155
|
+
[GameEvents.CHAT_MESSAGE]: EventChatMessage,
|
|
156
|
+
[GameEvents.PLAYER_DEATH]: EventPlayerDeath,
|
|
157
|
+
[GameEvents.ENTITY_KILLED]: EventEntityKilled,
|
|
158
|
+
[GameEvents.LOG_LINE]: EventLogLine,
|
|
159
|
+
} as const;
|
package/src/dto/index.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { DiscordEvents, DiscordEventsMapping } from './discordEvents.js';
|
|
2
|
+
import { GameEvents, GameEventsMapping } from './gameEvents.js';
|
|
3
|
+
import { TakaroEvents, TakaroEventsMapping } from './takaroEvents.js';
|
|
4
|
+
import { ValueOf } from 'type-fest';
|
|
5
|
+
import { BaseEvent } from './base.js';
|
|
6
|
+
|
|
7
|
+
export * from './discordEvents.js';
|
|
8
|
+
export * from './gameEvents.js';
|
|
9
|
+
export * from './takaroEvents.js';
|
|
10
|
+
export * from './base.js';
|
|
11
|
+
|
|
12
|
+
export const HookEvents = {
|
|
13
|
+
...GameEvents,
|
|
14
|
+
...DiscordEvents,
|
|
15
|
+
...TakaroEvents,
|
|
16
|
+
} as const;
|
|
17
|
+
|
|
18
|
+
export const EventMapping: Record<EventTypes, typeof BaseEvent<any>> = {
|
|
19
|
+
...GameEventsMapping,
|
|
20
|
+
...DiscordEventsMapping,
|
|
21
|
+
...TakaroEventsMapping,
|
|
22
|
+
} as const;
|
|
23
|
+
|
|
24
|
+
export type EventPayload = ValueOf<(typeof EventMapping)[ValueOf<typeof HookEvents>]>;
|
|
25
|
+
export type EventTypes = ValueOf<typeof HookEvents>;
|