Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 14 additions & 16 deletions Examples/CustomEndpoint.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
<div align="center">
<br />
<p>
<a href="https://api.rambot.xyz"><img src="https://gamearoo.top/ram/ramapijs.png" width="546" alt="ram-api.js" /></a>
<a href="https://api.rambot.xyz"><img src="https://rambot.xyz/ram-api-images/ram/ram-apijs.png" width="546" alt="ram-api.js" /></a>
</p>
<br />
<p>
<a href="https://discord.gg/q3ycRjBG9q"><img src="https://img.shields.io/discord/1068088656377692170?color=5865F2&logo=discord&logoColor=white" alt="Discord server" /></a>
<a href="https://www.npmjs.com/package/ram-api.js"><img src="https://img.shields.io/npm/v/ram-api.js.svg" alt="npm version" /></a>
<a href="https://www.npmjs.com/package/ram-api.js"><img src="https://img.shields.io/npm/dt/ram-api.js.svg?maxAge=3600" alt="npm downloads" /></a>
<a href="https://github.com/Gamearoos-development/ram-api.js/actions"><img src="https://github.com/Gamearoos-development/ram-api.js/actions/workflows/text.yml/badge.svg" alt="Tests status" /></a>
<a href="https://discord.gamearoo.dev"><img src="https://img.shields.io/badge/chat-Discord-5865F2?logo=discord&logoColor=white" alt="Discord server" /></a>
<a href="https://www.npmjs.com/package/ram-api.js"><img src="https://img.shields.io/npm/v/ram-api.js" alt="npm version" /></a>
<a href="https://www.npmjs.com/package/ram-api.js"><img src="https://img.shields.io/npm/dm/ram-api.js?style=flat" alt="npm downloads" /></a>
<a href="https://github.com/Ram-Bot-Development/ram-api.js/actions"><img src="https://img.shields.io/github/actions/workflow/status/Ram-Bot-Development/ram-api.js/text.yml?branch=main&label=Tests" alt="Tests status" /></a>

</p>
<a href="https://nodei.co/npm/ram-api.js/"><img src="https://nodei.co/npm/ram-api.js.png?downloads=true&downloadRank=true&stars=true"></a>
Expand All @@ -22,25 +20,25 @@

```javascript

import \* as ramapi from "ram-api.js"; // typescript
import * as ramapi from "ram-api.js"; // typescript
const ramapi = require("ram-api.js"); // javascript
const lang = "english"; // "spanish" for spanish
//demo v14+
// demo uses the latest api version
// hello returns { text }
new ramapi.Utils().customAsync("/hello", "demo", { params: { lang: lang } }).then(data => { console.log(data); }).catch(err => { });

//basic v13 or under
//basic ended at v13, and v13 is retired

new ramapi.Utils().customAsync("/hello", "basic", { version: "v13", params: { lang: lang } }).then(data => { console.log(data); }).catch(err => { });
//pro, normal, or extended are also available options instead of demo below are examples NOTICE: extended only exists in v14 and v15

//pro, normal, or extended are also available options instead of demo or basic below are examples NOTICE: extended only exists in v14 and above

//v17
new ramapi.Utils().customAsync("/hello", "normal", { version: "v17", params: { lang: lang }, headers: {"token": "api key here"} }).then(data => { console.log(data); }).catch(err => { });

//v16 & up
new ramapi.Utils().customAsync("/hello", "normal", { params: { lang: lang }, headers: {"token": "api key here"} }).then(data => { console.log(data); }).catch(err => { });
//provide version ex v16 (v16 and up)
//v16 still uses the token header
new ramapi.Utils().customAsync("/hello", "normal", { version: "v16", params: { lang: lang }, headers: {"token": "api key here"} }).then(data => { console.log(data); }).catch(err => { });

//provide version ex v13 (v15 and under)
//v15 and under use the api-key header
new ramapi.Utils().customAsync("/hello", "normal", { version: "v15", params: { lang: lang }, headers: {"api-key": "api key here"} }).then(data => { console.log(data); }).catch(err => { });


Expand Down
147 changes: 112 additions & 35 deletions Examples/Demo.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
<div align="center">
<br />
<p>
<a href="https://api.rambot.xyz"><img src="https://gamearoo.top/ram/ramapijs.png" width="546" alt="ram-api.js" /></a>
<a href="https://api.rambot.xyz"><img src="https://rambot.xyz/ram-api-images/ram/ram-apijs.png" width="546" alt="ram-api.js" /></a>
</p>
<br />
<p>
<a href="https://discord.gg/q3ycRjBG9q"><img src="https://img.shields.io/discord/1068088656377692170?color=5865F2&logo=discord&logoColor=white" alt="Discord server" /></a>
<a href="https://www.npmjs.com/package/ram-api.js"><img src="https://img.shields.io/npm/v/ram-api.js.svg" alt="npm version" /></a>
<a href="https://www.npmjs.com/package/ram-api.js"><img src="https://img.shields.io/npm/dt/ram-api.js.svg?maxAge=3600" alt="npm downloads" /></a>
<a href="https://github.com/Gamearoos-development/ram-api.js/actions"><img src="https://github.com/Gamearoos-development/ram-api.js/actions/workflows/text.yml/badge.svg" alt="Tests status" /></a>
<a href="https://discord.gamearoo.dev"><img src="https://img.shields.io/badge/chat-Discord-5865F2?logo=discord&logoColor=white" alt="Discord server" /></a>
<a href="https://www.npmjs.com/package/ram-api.js"><img src="https://img.shields.io/npm/v/ram-api.js" alt="npm version" /></a>
<a href="https://www.npmjs.com/package/ram-api.js"><img src="https://img.shields.io/npm/dm/ram-api.js?style=flat" alt="npm downloads" /></a>
<a href="https://github.com/Ram-Bot-Development/ram-api.js/actions"><img src="https://img.shields.io/github/actions/workflow/status/Ram-Bot-Development/ram-api.js/text.yml?branch=main&label=Tests" alt="Tests status" /></a>

</p>
<a href="https://nodei.co/npm/ram-api.js/"><img src="https://nodei.co/npm/ram-api.js.png?downloads=true&downloadRank=true&stars=true"></a>
Expand All @@ -18,62 +16,141 @@

> Demo Examples

Returns below are the objects the methods resolve with.

```javascript
import \* as ramapi from "ram-api.js"; // typescript
import * as ramapi from "ram-api.js"; // typescript
const ramapi = require("ram-api.js"); // javascript

const lang = "english"; // "spanish" for spanish

let RamApi = new ramapi.DemoEndpoints(60000, 1);

// { url }
RamApi.laughAsync().then((data) => { console.log(data); }).catch((error) => {});

// { version, outdated, supported, latest }
// { version: "v17", outdated: false, supported: true, latest: "v17" }
RamApi.versionInfoAsync("v17").then(data => { console.log(data); }).catch(error => {});

// { text, url }
RamApi.birthdayAsync(lang).then(data => { console.log(data); }).catch(error => {});

// { url, text }
RamApi.cryAsync(lang).then(data => { console.log(data); }).catch(error => {});

// { url }
RamApi.tiredAsync().then(data => { console.log(data); }).catch(error => {});

// { url }
RamApi.sickAsync().then(data => { console.log(data); }).catch(error => {});

// { url, text, text2, text3, text4, textFormatted }
// textFormatted is "Ada Had slapped Bea". text2, text3, and text4 may be "NULL"
RamApi.slapAsync("Ada", "Bea").then(data => { console.log(data); }).catch(error => {});

// { url }
RamApi.kissAsync().then(data => { console.log(data); }).catch(error => {});

// { url }
RamApi.hugAsync().then(data => { console.log(data); }).catch(error => {});

// { url, text }
RamApi.goodNightAsync(lang).then(data => { console.log(data); }).catch(error => {});

// { url, text }
RamApi.goodMorningAsync(lang).then(data => { console.log(data); }).catch(error => {});

// { url }
RamApi.cuddleAsync().then(data => { console.log(data); }).catch(error => {});

// { text: "Hi, How are you?" }
RamApi.helloAsync(lang).then(data => { console.log(data); }).catch(error => {});

// { api_choice: "rock", your_choice: "paper" }
RamApi.rpsAsync("paper").then(data => { console.log(data); }).catch(error => {});

// { text }
RamApi._8ballAsync(lang).then(data => { console.log(data); }).catch(error => {});

RamApi.laughAsync()
.then((data) => {
console.log(data);
})
.catch((error) => {});
// { limit, current, remaining, resetTime, resetTimeFormated }
// { limit: 2, current: 1, remaining: 1, resetTime: "2026-10-21T05:12:05.972Z", resetTimeFormated: "Today at 5:12 AM" }
RamApi.rateLimitAsync().then(data => { console.log(data); }).catch(error => {});

RamApi.versionInfoAsync("v14").then(data => {console.log(data)}).catch(error => {})
// { Number, roundedNumber, flooredNumber, enteredNumbers }
// { Number: 4.09, roundedNumber: 4, flooredNumber: 4, enteredNumbers: "Min: 1 Max: 10" }
RamApi.randomNumberAsync(1, 10).then(data => { console.log(data); }).catch(error => {});

RamApi.birthdayAsync(lang).then(data => {console.log(data)}).catch(error => {})
// "Completed!"
RamApi.suggestionAsync("This is a suggestion", "Example User").then(data => { console.log(data); }).catch(error => {});

RamApi.cryAsync(lang).then(data => {console.log(data)}).catch(error => {})
// { ping: "108ms" }
RamApi.pingAsync().then(data => { console.log(data); }).catch(error => {});

RamApi.tiredAsync().then(data => {console.log(data)}).catch(error => {})
// { url }
RamApi.ramAsync().then(data => { console.log(data); }).catch(error => {});

RamApi.sickAsync().then(data => {console.log(data)}).catch(error => {})
// { url }
RamApi.nekoparaAsync().then(data => { console.log(data); }).catch(error => {});

RamApi.slapAsync("user1", "user2").then(data => {console.log(data)}).catch(error => {})
// { url }
RamApi.mikuAsync().then(data => { console.log(data); }).catch(error => {});

RamApi.kissAsync().then(data => {console.log(data)}).catch(error => {})
// { url }
RamApi.memeAsync().then(data => { console.log(data); }).catch(error => {});

RamApi.hugAsync().then(data => {console.log(data)}).catch(error => {})
// { text }
RamApi.roastAsync().then(data => { console.log(data); }).catch(error => {});

RamApi.goodNightAsync(lang).then(data => {console.log(data)}).catch(error => {})
// { text }
RamApi.complimentAsync().then(data => { console.log(data); }).catch(error => {});

RamApi.goodMorningAsync(lang).then(data => {console.log(data)}).catch(error => {})
// { setup, punchline }
RamApi.dadJokeAsync().then(data => { console.log(data); }).catch(error => {});

RamApi.cuddleAsync().then(data => {console.log(data)}).catch(error => {})
// topic: space, food, animals, places, or science
// { id: "fact_01", topic: "space", text }
RamApi.factAsync("space").then(data => { console.log(data); }).catch(error => {});

RamApi.helloAsync(lang).then(data => {console.log(data)}).catch(error => {})
// { text }
RamApi.fortuneAsync().then(data => { console.log(data); }).catch(error => {});

RamApi.rpsAsync("paper").then(data => {console.log(data)}).catch(error => {})
// { name, scientificName, habitat, diet, fact, image }
RamApi.animalAsync().then(data => { console.log(data); }).catch(error => {});

RamApi._8ballAsync(lang).then(data => {console.log(data)}).catch(error => {})
// category: general, science, history, or games. difficulty: easy, medium, or hard
// The answer is not included. Check it with quizCheckAsync
// { id, category, difficulty, question, choices: ["Venus", "Mars", "Jupiter", "Mercury"] }
RamApi.triviaAsync("science", "easy").then(data => { console.log(data); }).catch(error => {});

RamApi.rateLimitAsync().then(data => {console.log(data)}).catch(error => {})
// { id, prompt }
RamApi.wyrAsync().then(data => { console.log(data); }).catch(error => {});

RamApi.randomNumberAsync(9, 7).then(data => {console.log(data)}).catch(error => {})
// { id, prompt }
RamApi.neverHaveIEverAsync().then(data => { console.log(data); }).catch(error => {});

RamApi.suggestionAsync("This is a suggestion", "Example User").then(data => {console.log(data)}).catch(error => {})
// type: truth, dare, or any. rating: pg or teen
// { type: "truth", rating: "pg", prompt }
RamApi.truthOrDareAsync("truth", "pg").then(data => { console.log(data); }).catch(error => {});

RamApi.pingAsync().then(data => {console.log(data)}).catch(error => {})
// pass "yes" to include hint
// { id, scrambled, length, hint }
RamApi.wordScrambleAsync("yes").then(data => { console.log(data); }).catch(error => {});

RamApi.ramAsync().then(data => {console.log(data)}).catch(error => {})
// { id, min: 1, max: 20, attempts: 8, prompt }
RamApi.guessNumberAsync(20).then(data => { console.log(data); }).catch(error => {});

RamApi.nekoparaAsync().then(data => {console.log(data)}).catch(error => {})
// trivia or scramble: { id, correct, answer }
// wrong number guess: { id, correct: false, direction: "higher", attemptsLeft: 7 }
RamApi.quizCheckAsync("question id", "answer").then(data => { console.log(data); }).catch(error => {});

RamApi.mikuAsync().then(data => {console.log(data)}).catch(error => {})
// game: guess, trivia, or scramble
// { sessionId, game: "guess", status: "lobby", host: "Ada", players: [{ name: "Ada", score: 0 }], expiresAt }
RamApi.gameSessionAsync("guess", "Ada").then(data => { console.log(data); }).catch(error => {});

RamApi.memeAsync().then(data => { console.log(data)}).catch(error => {})
// action: join, start, guess, or answer. value is the guess or answer
// join: { sessionId, game, status: "lobby", host, players, expiresAt, result: "joined" }
// start: { sessionId, game, status: "active", host, players, expiresAt, round: { prompt, attemptsLeft }, result: "started" }
// guess: { sessionId, game, status: "active", host, players, expiresAt, round: { prompt, attemptsLeft }, result: "higher" }
RamApi.gameMoveAsync("session id", "Ada", "guess", "10").then(data => { console.log(data); }).catch(error => {});
```
12 changes: 5 additions & 7 deletions Examples/Events.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
<div align="center">
<br />
<p>
<a href="https://api.rambot.xyz"><img src="https://gamearoo.top/ram/ramapijs.png" width="546" alt="ram-api.js" /></a>
<a href="https://api.rambot.xyz"><img src="https://rambot.xyz/ram-api-images/ram/ram-apijs.png" width="546" alt="ram-api.js" /></a>
</p>
<br />
<p>
<a href="https://discord.gg/q3ycRjBG9q"><img src="https://img.shields.io/discord/1068088656377692170?color=5865F2&logo=discord&logoColor=white" alt="Discord server" /></a>
<a href="https://www.npmjs.com/package/ram-api.js"><img src="https://img.shields.io/npm/v/ram-api.js.svg" alt="npm version" /></a>
<a href="https://www.npmjs.com/package/ram-api.js"><img src="https://img.shields.io/npm/dt/ram-api.js.svg?maxAge=3600" alt="npm downloads" /></a>
<a href="https://github.com/Gamearoos-development/ram-api.js/actions"><img src="https://github.com/Gamearoos-development/ram-api.js/actions/workflows/text.yml/badge.svg" alt="Tests status" /></a>
<a href="https://discord.gamearoo.dev"><img src="https://img.shields.io/badge/chat-Discord-5865F2?logo=discord&logoColor=white" alt="Discord server" /></a>
<a href="https://www.npmjs.com/package/ram-api.js"><img src="https://img.shields.io/npm/v/ram-api.js" alt="npm version" /></a>
<a href="https://www.npmjs.com/package/ram-api.js"><img src="https://img.shields.io/npm/dm/ram-api.js?style=flat" alt="npm downloads" /></a>
<a href="https://github.com/Ram-Bot-Development/ram-api.js/actions"><img src="https://img.shields.io/github/actions/workflow/status/Ram-Bot-Development/ram-api.js/text.yml?branch=main&label=Tests" alt="Tests status" /></a>

</p>
<a href="https://nodei.co/npm/ram-api.js/"><img src="https://nodei.co/npm/ram-api.js.png?downloads=true&downloadRank=true&stars=true"></a>
Expand Down
14 changes: 6 additions & 8 deletions Examples/ExecuteLogger.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
<div align="center">
<br />
<p>
<a href="https://api.rambot.xyz"><img src="https://gamearoo.top/ram/ramapijs.png" width="546" alt="ram-api.js" /></a>
<a href="https://api.rambot.xyz"><img src="https://rambot.xyz/ram-api-images/ram/ram-apijs.png" width="546" alt="ram-api.js" /></a>
</p>
<br />
<p>
<a href="https://discord.gg/q3ycRjBG9q"><img src="https://img.shields.io/discord/1068088656377692170?color=5865F2&logo=discord&logoColor=white" alt="Discord server" /></a>
<a href="https://www.npmjs.com/package/ram-api.js"><img src="https://img.shields.io/npm/v/ram-api.js.svg" alt="npm version" /></a>
<a href="https://www.npmjs.com/package/ram-api.js"><img src="https://img.shields.io/npm/dt/ram-api.js.svg?maxAge=3600" alt="npm downloads" /></a>
<a href="https://github.com/Gamearoos-development/ram-api.js/actions"><img src="https://github.com/Gamearoos-development/ram-api.js/actions/workflows/text.yml/badge.svg" alt="Tests status" /></a>
<a href="https://discord.gamearoo.dev"><img src="https://img.shields.io/badge/chat-Discord-5865F2?logo=discord&logoColor=white" alt="Discord server" /></a>
<a href="https://www.npmjs.com/package/ram-api.js"><img src="https://img.shields.io/npm/v/ram-api.js" alt="npm version" /></a>
<a href="https://www.npmjs.com/package/ram-api.js"><img src="https://img.shields.io/npm/dm/ram-api.js?style=flat" alt="npm downloads" /></a>
<a href="https://github.com/Ram-Bot-Development/ram-api.js/actions"><img src="https://img.shields.io/github/actions/workflow/status/Ram-Bot-Development/ram-api.js/text.yml?branch=main&label=Tests" alt="Tests status" /></a>

</p>
<a href="https://nodei.co/npm/ram-api.js/"><img src="https://nodei.co/npm/ram-api.js.png?downloads=true&downloadRank=true&stars=true"></a>
Expand All @@ -19,7 +17,7 @@
> Execute Examples

```javascript
import \* as ramapi from "ram-api.js"; // typescript
import * as ramapi from "ram-api.js"; // typescript
const ramapi = require("ram-api.js"); // javascript

new ramapi.ExecuteLogger("Test Logger").infoAsync("testing without a process name")
Expand Down
Loading
Loading