mirror of
https://github.com/tribufu/sdk-js
synced 2025-06-15 18:24:19 +00:00
Update examples
This commit is contained in:
@ -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();
|
||||
|
@ -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();
|
||||
|
@ -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();
|
||||
|
@ -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();
|
||||
|
Reference in New Issue
Block a user