Skip to content

Commit

Permalink
fix: code style
Browse files Browse the repository at this point in the history
  • Loading branch information
takaro-ci-bot[bot] committed Dec 18, 2024
1 parent 76d0ec0 commit 1f390cd
Show file tree
Hide file tree
Showing 13 changed files with 1,150 additions and 1,144 deletions.
57 changes: 28 additions & 29 deletions packages/web-docs/docs/modules/chatBridge.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,37 +5,36 @@ import { Commands, Config, CronJobs, Hooks } from './helpers';

export function Module() {
const mod = {
"commands": [],
"hooks": [
{
"eventType": "discord-message",
"name": "DiscordToGame",
"function": "import { takaro, data } from '@takaro/helpers';\nasync function main() {\n try {\n if (data.eventData.author.isBot)\n return;\n await takaro.gameserver.gameServerControllerSendMessage(data.gameServerId, {\n message: `[D] ${data.eventData.author.displayName}: ${data.eventData.msg}`,\n });\n }\n catch (error) {\n console.error(error);\n await takaro.discordControllerSendMessage(data.discordChannelId, {\n message: 'Failed to forward your message to the game. Please try again later.',\n });\n }\n}\nawait main();\n//# sourceMappingURL=DiscordToGame.js.map"
},
{
"eventType": "chat-message",
"name": "GameToDiscord",
"function": "import { takaro, data } from '@takaro/helpers';\nasync function main() {\n const onlyGlobal = data.module.userConfig.onlyGlobalChat;\n if (onlyGlobal && data.eventData.channel !== 'global')\n return;\n const discordChannel = data.module.systemConfig.hooks['DiscordToGame'].discordChannelId;\n const sender = data.player ? data.player.name : 'Non-player';\n const message = `**${sender}**: ${data.eventData.msg}`;\n await takaro.discord.discordControllerSendMessage(discordChannel, {\n message: message,\n });\n}\nawait main();\n//# sourceMappingURL=GameToDiscord.js.map"
},
{
"eventType": "player-connected",
"name": "PlayerConnected",
"function": "import { takaro, data } from '@takaro/helpers';\nasync function main() {\n const discordChannel = data.module.systemConfig.hooks['DiscordToGame'].discordChannelId;\n await takaro.discord.discordControllerSendMessage(discordChannel, {\n message: `[⚡ Connected]: ${data.player.name}`,\n });\n}\nawait main();\n//# sourceMappingURL=PlayerConnected.js.map"
},
"name": "chatBridge",
"versions": [
{
"eventType": "player-disconnected",
"name": "PlayerDisconnected",
"function": "import { takaro, data } from '@takaro/helpers';\nasync function main() {\n const discordChannel = data.module.systemConfig.hooks['DiscordToGame'].discordChannelId;\n await takaro.discord.discordControllerSendMessage(discordChannel, {\n message: `[👋 Disconnected]: ${data.player.name}`,\n });\n}\nawait main();\n//# sourceMappingURL=PlayerDisconnected.js.map"
"tag": "0.0.1",
"description": "Connect chat to other services like Discord.",
"configSchema": "{\"$schema\":\"http://json-schema.org/draft-07/schema#\",\"type\":\"object\",\"properties\":{\"sendPlayerConnected\":{\"title\":\"Send player connected\",\"type\":\"boolean\",\"description\":\"Send a message when a player connects.\",\"default\":true},\"sendPlayerDisconnected\":{\"title\":\"Send player disconnected\",\"type\":\"boolean\",\"description\":\"Send a message when a player disconnects.\",\"default\":true},\"onlyGlobalChat\":{\"title\":\"Only global chat\",\"type\":\"boolean\",\"default\":true,\"description\":\"Only relay messages from global chat. (no team chat or private messages)\"}},\"additionalProperties\":false}",
"hooks": [
{
"eventType": "discord-message",
"name": "DiscordToGame",
"function": "import { takaro, data } from '@takaro/helpers';\nasync function main() {\n try {\n if (data.eventData.author.isBot)\n return;\n await takaro.gameserver.gameServerControllerSendMessage(data.gameServerId, {\n message: `[D] ${data.eventData.author.displayName}: ${data.eventData.msg}`,\n });\n }\n catch (error) {\n console.error(error);\n await takaro.discordControllerSendMessage(data.discordChannelId, {\n message: 'Failed to forward your message to the game. Please try again later.',\n });\n }\n}\nawait main();\n//# sourceMappingURL=DiscordToGame.js.map"
},
{
"eventType": "chat-message",
"name": "GameToDiscord",
"function": "import { takaro, data } from '@takaro/helpers';\nasync function main() {\n const onlyGlobal = data.module.userConfig.onlyGlobalChat;\n if (onlyGlobal && data.eventData.channel !== 'global')\n return;\n const discordChannel = data.module.systemConfig.hooks['DiscordToGame'].discordChannelId;\n const sender = data.player ? data.player.name : 'Non-player';\n const message = `**${sender}**: ${data.eventData.msg}`;\n await takaro.discord.discordControllerSendMessage(discordChannel, {\n message: message,\n });\n}\nawait main();\n//# sourceMappingURL=GameToDiscord.js.map"
},
{
"eventType": "player-connected",
"name": "PlayerConnected",
"function": "import { takaro, data } from '@takaro/helpers';\nasync function main() {\n const discordChannel = data.module.systemConfig.hooks['DiscordToGame'].discordChannelId;\n await takaro.discord.discordControllerSendMessage(discordChannel, {\n message: `[⚡ Connected]: ${data.player.name}`,\n });\n}\nawait main();\n//# sourceMappingURL=PlayerConnected.js.map"
},
{
"eventType": "player-disconnected",
"name": "PlayerDisconnected",
"function": "import { takaro, data } from '@takaro/helpers';\nasync function main() {\n const discordChannel = data.module.systemConfig.hooks['DiscordToGame'].discordChannelId;\n await takaro.discord.discordControllerSendMessage(discordChannel, {\n message: `[👋 Disconnected]: ${data.player.name}`,\n });\n}\nawait main();\n//# sourceMappingURL=PlayerDisconnected.js.map"
}
]
}
],
"cronJobs": [],
"functions": [],
"permissions": [],
"name": "chatBridge",
"description": "Connect chat to other services like Discord.",
"version": "0.0.1",
"configSchema": "{\"$schema\":\"http://json-schema.org/draft-07/schema#\",\"type\":\"object\",\"properties\":{\"sendPlayerConnected\":{\"title\":\"Send player connected\",\"type\":\"boolean\",\"description\":\"Send a message when a player connects.\",\"default\":true},\"sendPlayerDisconnected\":{\"title\":\"Send player disconnected\",\"type\":\"boolean\",\"description\":\"Send a message when a player disconnects.\",\"default\":true},\"onlyGlobalChat\":{\"title\":\"Only global chat\",\"type\":\"boolean\",\"default\":true,\"description\":\"Only relay messages from global chat. (no team chat or private messages)\"}},\"additionalProperties\":false}",
"uiSchema": "{}"
]
};

return (
Expand Down
120 changes: 61 additions & 59 deletions packages/web-docs/docs/modules/dailyRewards.mdx

Large diffs are not rendered by default.

283 changes: 142 additions & 141 deletions packages/web-docs/docs/modules/economyUtils.mdx

Large diffs are not rendered by default.

Loading

0 comments on commit 1f390cd

Please sign in to comment.