1.0.5-2 • Published 1 year ago

@simo.js/rest v1.0.5-2

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

REST

@simo.js/rest is a light and fast module that lets you interact with the Simo API

Installation

The only way to install rest is via npm

npm install @simo.js/rest

Using

Creating a team:

import { REST, Routes } from '@simo.js/rest';

const rest = new REST({ auth: AUTH });

await rest
    .post(Routes.createTeam, {
        name: 'Team Name',
        avatar_url: 'https://some.avatar.com',
        description: 'Here is some description',
    })
    .catch(console.error);

Creating a feedback:

import { REST, Routes } from '@simo.js/rest';

const rest = new REST({ auth: AUTH });

await rest
    .post(Routes.addFeedback(BOT_ID), {
        stars: 5,
        content: 'Your bot is amazing!',
    })
    .catch(console.error);

Updating a feedback with @simo.js/simo-api-types:

import { REST, Routes } from '@simo.js/rest';
import type { RESTPatchFeedbackResult } from '@simo.js/simo-api-types';

const rest = new REST({ auth: AUTH });

await rest
    .patch<RESTPatchFeedbackResult>(Routes.updateFeedback(BOT_ID), {
        reply_message: {
            content: 'Thanks!',
            posted_at: new Date().toISOString(),
        },
    })
    .catch(console.error);

Util Links

Help

If you don't understand something or you are experiencing problems, please join simo Server

1.0.5-2

1 year ago

1.0.5-1

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago