From 81cabdd26cf3d144dfce51a112f4513e270ca9ce Mon Sep 17 00:00:00 2001 From: Guilherme Werner Date: Mon, 1 Jan 2024 14:05:40 -0300 Subject: [PATCH] Update examples --- examples/api.js | 10 ++++++++-- examples/bot.js | 4 ++-- examples/client.js | 4 ++-- examples/server.js | 4 ++-- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/examples/api.js b/examples/api.js index 6ad988d..7c0b906 100644 --- a/examples/api.js +++ b/examples/api.js @@ -1,8 +1,14 @@ // Copyright (c) Tribufu. All Rights Reserved. import dotenv from 'dotenv'; -import { TribufuApi } from '../src'; +import { TribufuApi } from '../build/index.mjs'; dotenv.config(); -const api = TribufuApi.fromEnv(); +async function main() { + const api = TribufuApi.fromEnv("TRIBUFU"); + const games = await api.getGames(); + console.log(games[0]); +} + +main(); diff --git a/examples/bot.js b/examples/bot.js index e56cac3..32f9614 100644 --- a/examples/bot.js +++ b/examples/bot.js @@ -1,9 +1,9 @@ // Copyright (c) Tribufu. All Rights Reserved. import dotenv from 'dotenv'; -import { TribufuBot } from '../build'; +import { TribufuBot } from '../build/index.mjs'; dotenv.config(); -const bot = TribufuBot.fromEnv(); +const bot = TribufuBot.fromEnv("TRIBUFU"); const botId = bot.getBotId(); diff --git a/examples/client.js b/examples/client.js index 4ec4167..5f1d723 100644 --- a/examples/client.js +++ b/examples/client.js @@ -1,9 +1,9 @@ // Copyright (c) Tribufu. All Rights Reserved. import dotenv from 'dotenv'; -import { TribufuClient } from '../build'; +import { TribufuClient } from '../build/index.mjs'; dotenv.config(); -const client = TribufuClient.fromEnv(); +const client = TribufuClient.fromEnv("TRIBUFU"); const clientId = client.getClientId(); diff --git a/examples/server.js b/examples/server.js index 2ca4ec6..9aad6fb 100644 --- a/examples/server.js +++ b/examples/server.js @@ -1,10 +1,10 @@ // Copyright (c) Tribufu. All Rights Reserved. import dotenv from 'dotenv'; -import { TribufuServer } from '../build'; +import { TribufuServer } from '../build/index.mjs'; dotenv.config(); -const server = TribufuServer.fromEnv(); +const server = TribufuServer.fromEnv("TRIBUFU"); const serverId = server.getServerId(); const clientId = server.getClientId();