Update examples

This commit is contained in:
Guilherme Werner
2024-01-01 14:05:40 -03:00
parent d743c1b53f
commit 81cabdd26c
4 changed files with 14 additions and 8 deletions

View File

@ -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();

View File

@ -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();

View File

@ -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();

View File

@ -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();