Skip to content

Commit

Permalink
BREAKING CHANGE: interactions support
Browse files Browse the repository at this point in the history
  • Loading branch information
egorprnn committed Aug 6, 2021
1 parent bb633ce commit b46d830
Show file tree
Hide file tree
Showing 44 changed files with 27,515 additions and 1,133 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
],
"quotes": [
"error",
"double"
"single"
],
"semi": [
"error",
Expand Down
Binary file added .github/demo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
.idea
.github
node_modules
lib
build
scripts
.gitignore
.eslintrc.json
babel.config.json
tsconfig.json
51 changes: 48 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,58 @@
<img src="https://badge.fury.io/js/discord.js-pages.svg" alt="npm version" height="18">
</a>

| πŸ“– [Documentation](docs/introduction.md) | πŸ€– [Examples](docs/examples) |
| --------------------------------------- | ---------------------------- |
| πŸ“– [Documentation](https://mrzillagold.github.io/discord.js-pages/index.html) |
| ---------------------------------------------------------------------------- |

</p>

### Install πŸ“¦
`npm i discord.js-pages`

### Usage πŸ“¦
```js
import { PagesBuilder } from 'discord.js-pages';
import { Client, MessageEmbed } from 'discord.js';

const client = new Client({
intents: [
'GUILDS'
]
});

// Middleware is useful in bots with modular commands
client.on('interactionCreate', (interaction) => {
pagesManager.middleware(interaction);

message.pagesBuilder()
.setTitle('Global title')
.setPages([
new MessageEmbed()
.setDescription('First page'),
new MessageEmbed()
.setDescription('Second page')
])
.addField('Global field', 'discord.js-pages', true)
.setColor('GREEN')
.build();
});

client.on('interactionCreate', (interaction) => {
new PagesBuilder(interaction)
.setTitle('Global title')
.setPages([
new MessageEmbed()
.setDescription('First page'),
new MessageEmbed()
.setDescription('Second page')
])
.addField('Global field', 'discord.js-pages', true)
.setColor('GREEN')
.build();
});

client.login(process.env.TOKEN);
```

### Demo πŸŽ₯
<img src="https://github.com/MrZillaGold/discord.js-pages/raw/master/docs/demo.gif" height="200">
<img src="https://github.com/MrZillaGold/discord.js-pages/raw/master/.github/demo.gif" height="500">
Loading

0 comments on commit b46d830

Please sign in to comment.