Skip to content

Commit a357f16

Browse files
committed
Corrected Typos in README
1 parent 6d7723e commit a357f16

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

Diff for: README.md

+12-13
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,19 @@
77

88
`open-trivia-db` is a small and simple library for interacting with the [OpenTDB](https://opentdb.com/) API.
99

10-
**Live Demo**: https://replit.com/@Elitezenv/open-trivia-db-DEMO?v=1
11-
1210
**Documentation**: https://github.com/Elitezen/open-trivia-db-wrapper/wiki/Documentation
1311

1412
## Discord.JS Add On
1513

16-
Planning a trivia command for your Discord bot?
17-
Checkout `discord-trivia`!: https://github.com/Elitezen/discord-trivia
14+
Checkout the powerful module `discord-trivia`: https://github.com/Elitezen/discord-trivia
1815

1916
# 2.1.6
2017
- Added typescript as a developer depencency.
2118
- Added safegaurd for unknown thrown exceptions from `OpenTDBError`.
2219

2320
## Example Code
2421
```js
25-
import { getQuestions, CategoryNames } from "open-trivia-db";
22+
import { getQuestions, CategoryNames, QuestionDifficulties } from "open-trivia-db";
2623

2724
const questions = await getQuestions({
2825
amount: 10,
@@ -90,18 +87,20 @@ To jump between resolvables, use `Category.idByName()` and `Category.nameById()`
9087
```js
9188
import { Category, CategoryNames } from "open-trivia-db";
9289

93-
Category.idByName('Art'); // 25
94-
Category.nameById(25); // 'Art'
90+
Category.idByName('Art'); // 25
91+
Category.idByName(CategoryNames.Art); // 25
92+
93+
Category.nameById(25); // 'Art'
9594
```
9695

9796
### Getting a Category's Data
9897
Use `Category.getCategory()` to get a category's data such as name, id, and question counts.
9998

10099
```js
101-
import { Category, CategoryNames } from "open-trivia-db"
100+
import { Category, CategoryNames } from "open-trivia-db";
102101

103102
Category.getCategory(CategoryNames.Geography)
104-
.then(console.log)
103+
.then(console.log);
105104
```
106105

107106
```js
@@ -118,18 +117,18 @@ Category.getCategory(CategoryNames.Geography)
118117
You can also complete a category's data through a question via `Question.category.getData()`
119118

120119
```js
121-
const targetQuestion = questions[0] // from getQuestions()
120+
const targetQuestion = questions[0]; // from getQuestions()
122121

123122
targetQuestion.category.getData()
124-
.then(console.log)
123+
.then(console.log);
125124
```
126125

127126
## Sessions
128127
A session ensures you are not supplied a question more than once throughout it's lifetime.
129128

130129
Initialize a session and supply the instance into `getQuestions()`. Make sure to await or resolve `Session.start()`.
131130
```js
132-
import { Session } from "open-trivia-db"
131+
import { Session } from "open-trivia-db";
133132

134133
const mySession = new Session();
135134
await mySession.start();
@@ -139,7 +138,7 @@ getQuestions({
139138
})
140139
```
141140

142-
`getQuestions()` will return an error once your session has served every single question in OpenTDB. Don't worry, theres thousands of questions! You will likely never come accross a session's end. However, if you wish to reset your session, use `Session.reset()`.
141+
`getQuestions()` will return an error once your session has served every single question in OpenTDB. Don't worry, there are thousands of questions! You will likely never come accross a session's end. However, if you wish to reset your session, use `Session.reset()`.
143142

144143
```js
145144
await mySession.reset();

0 commit comments

Comments
 (0)