Parse bot token to get id and add examples

This commit is contained in:
Guilherme Werner
2024-01-01 00:41:40 -03:00
parent 5047dada7c
commit de1f90c622
14 changed files with 298 additions and 146 deletions

8
examples/api.js Normal file
View File

@ -0,0 +1,8 @@
// Copyright (c) Tribufu. All Rights Reserved.
import dotenv from 'dotenv';
import { TribufuApi } from '../src';
dotenv.config();
const api = TribufuApi.fromEnv();

9
examples/bot.js Normal file
View File

@ -0,0 +1,9 @@
// Copyright (c) Tribufu. All Rights Reserved.
import dotenv from 'dotenv';
import { TribufuBot } from '../build';
dotenv.config();
const bot = TribufuBot.fromEnv();
const botId = bot.getBotId();

9
examples/client.js Normal file
View File

@ -0,0 +1,9 @@
// Copyright (c) Tribufu. All Rights Reserved.
import dotenv from 'dotenv';
import { TribufuClient } from '../build';
dotenv.config();
const client = TribufuClient.fromEnv();
const clientId = client.getClientId();

10
examples/server.js Normal file
View File

@ -0,0 +1,10 @@
// Copyright (c) Tribufu. All Rights Reserved.
import dotenv from 'dotenv';
import { TribufuServer } from '../build';
dotenv.config();
const server = TribufuServer.fromEnv();
const serverId = server.getServerId();
const clientId = server.getClientId();