From 14c2f4581ffdffd54417d6c86f2c96d6e7388dba Mon Sep 17 00:00:00 2001
From: Roman Khabarov
Date: Sun, 23 Jun 2024 10:21:13 +0000
Subject: [PATCH] Deploy website - based on
7a5970a70d0d376e5c2f7ba336a7af7f044120ca
---
404.html | 2 +-
__docusaurus/debug.html | 2 +-
__docusaurus/debug/config.html | 2 +-
__docusaurus/debug/content.html | 2 +-
__docusaurus/debug/globalData.html | 2 +-
__docusaurus/debug/metadata.html | 2 +-
__docusaurus/debug/registry.html | 2 +-
__docusaurus/debug/routes.html | 2 +-
assets/js/1d02dd36.2ce0823e.js | 1 +
assets/js/1d02dd36.7a6f267a.js | 1 -
...time~main.654f5dcc.js => runtime~main.d876fdd0.js} | 2 +-
contributing/code-of-conduct.html | 2 +-
contributing/commit-convention.html | 2 +-
contributing/contribution-guide.html | 2 +-
contributing/funding.html | 2 +-
index.html | 2 +-
interactions/context-menus.html | 2 +-
interactions/message-components.html | 2 +-
interactions/modals.html | 2 +-
interactions/slash-commands.html | 2 +-
interceptors/defer-interceptor.html | 2 +-
listeners.html | 2 +-
packages/localization.html | 2 +-
packages/pagination.html | 11 +++++++----
packages/stat-reporter.html | 2 +-
search.html | 2 +-
start.html | 2 +-
sw.js | 2 +-
techniques/async-configuration.html | 2 +-
techniques/client-providers.html | 2 +-
techniques/sharding.html | 2 +-
techniques/standalone-application.html | 2 +-
techniques/validation.html | 2 +-
text-commands.html | 2 +-
34 files changed, 39 insertions(+), 36 deletions(-)
create mode 100644 assets/js/1d02dd36.2ce0823e.js
delete mode 100644 assets/js/1d02dd36.7a6f267a.js
rename assets/js/{runtime~main.654f5dcc.js => runtime~main.d876fdd0.js} (98%)
diff --git a/404.html b/404.html
index aac2ebe..4596a74 100644
--- a/404.html
+++ b/404.html
@@ -14,7 +14,7 @@
-
+
diff --git a/__docusaurus/debug.html b/__docusaurus/debug.html
index 66f1d3c..430bb82 100644
--- a/__docusaurus/debug.html
+++ b/__docusaurus/debug.html
@@ -14,7 +14,7 @@
-
+
diff --git a/__docusaurus/debug/config.html b/__docusaurus/debug/config.html
index 2e6595b..d51496b 100644
--- a/__docusaurus/debug/config.html
+++ b/__docusaurus/debug/config.html
@@ -14,7 +14,7 @@
-
+
diff --git a/__docusaurus/debug/content.html b/__docusaurus/debug/content.html
index 86057c0..3e519d2 100644
--- a/__docusaurus/debug/content.html
+++ b/__docusaurus/debug/content.html
@@ -14,7 +14,7 @@
-
+
diff --git a/__docusaurus/debug/globalData.html b/__docusaurus/debug/globalData.html
index a764e17..1f4c555 100644
--- a/__docusaurus/debug/globalData.html
+++ b/__docusaurus/debug/globalData.html
@@ -14,7 +14,7 @@
-
+
diff --git a/__docusaurus/debug/metadata.html b/__docusaurus/debug/metadata.html
index 82aa13a..d957ca3 100644
--- a/__docusaurus/debug/metadata.html
+++ b/__docusaurus/debug/metadata.html
@@ -14,7 +14,7 @@
-
+
diff --git a/__docusaurus/debug/registry.html b/__docusaurus/debug/registry.html
index 89abd9b..0dc6dd8 100644
--- a/__docusaurus/debug/registry.html
+++ b/__docusaurus/debug/registry.html
@@ -14,7 +14,7 @@
-
+
diff --git a/__docusaurus/debug/routes.html b/__docusaurus/debug/routes.html
index 2a7b9ba..5be91a1 100644
--- a/__docusaurus/debug/routes.html
+++ b/__docusaurus/debug/routes.html
@@ -14,7 +14,7 @@
-
+
diff --git a/assets/js/1d02dd36.2ce0823e.js b/assets/js/1d02dd36.2ce0823e.js
new file mode 100644
index 0000000..575c861
--- /dev/null
+++ b/assets/js/1d02dd36.2ce0823e.js
@@ -0,0 +1 @@
+"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[753],{2611:(n,e,t)=>{t.r(e),t.d(e,{assets:()=>l,contentTitle:()=>s,default:()=>d,frontMatter:()=>o,metadata:()=>r,toc:()=>c});var a=t(6070),i=t(5710);const o={id:"pagination",title:"Pagination",sidebar_position:1},s=void 0,r={id:"packages/pagination",title:"Pagination",description:"Certainly! Pagination is a useful technique employed in user interfaces to present large amounts of information in a structured and",source:"@site/content/packages/pagination.md",sourceDirName:"packages",slug:"/packages/pagination",permalink:"/packages/pagination",draft:!1,unlisted:!1,editUrl:"https://github.com/GlobalArtInc/nestcord/tree/master/docs/content/packages/pagination.md",tags:[],version:"current",sidebarPosition:1,frontMatter:{id:"pagination",title:"Pagination",sidebar_position:1},sidebar:"docsSidebar",previous:{title:"Defer command",permalink:"/interceptors/defer-interceptor"},next:{title:"Localization",permalink:"/packages/localization"}},l={},c=[{value:"Usage",id:"usage",level:2},{value:"Buttons pagination",id:"buttons-pagination",level:3},{value:"Select Menu Pagination",id:"select-menu-pagination",level:3}];function p(n){const e={code:"code",h2:"h2",h3:"h3",p:"p",pre:"pre",...(0,i.R)(),...n.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(e.p,{children:"Certainly! Pagination is a useful technique employed in user interfaces to present large amounts of information in a structured and\nmanageable way. When dealing with substantial volumes of data, such as search results, articles, or product listings, presenting it all at\nonce can overwhelm users and lead to a poor user experience. Pagination allows you to divide the information into smaller, organized chunks,\nenhancing user engagement and ease of navigation. This module allows you to create a pagination with a few lines of code."}),"\n",(0,a.jsx)(e.h2,{id:"usage",children:"Usage"}),"\n",(0,a.jsxs)(e.p,{children:["Once the installation process is complete, we can import the ",(0,a.jsx)(e.code,{children:"NestCordPaginationModule"})," with your ",(0,a.jsx)(e.code,{children:"NestCordModule"})," into the root ",(0,a.jsx)(e.code,{children:"AppModule"}),":"]}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-typescript",children:"import { NestCordModule } from '@globalart/nestcord';\nimport { Module } from '@nestjs/common';\nimport { NestCordPaginationModule } from '@globalart/nestcord';\nimport { AppService } from './app.service';\n\n@Module({\n imports: [\n NestCordModule.forRoot({\n token: 'DISCORD_BOT_TOKEN',\n intents: ['Guilds', 'GuildMessages', 'DirectMessages']\n }),\n NestCordPaginationModule.forRoot(null)\n ],\n providers: [AppService]\n})\nexport class AppModule {}\n"})}),"\n",(0,a.jsxs)(e.p,{children:["Then, we can inject the ",(0,a.jsx)(e.code,{children:"PaginationService"})," into our service and register a pagination handler:"]}),"\n",(0,a.jsx)(e.h3,{id:"buttons-pagination",children:"Buttons pagination"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-typescript",children:"import { OnModuleInit, Injectable } from '@nestjs/common';\nimport { NestCordPaginationService, PageBuilder } from '@globalart/nestcord/pagination';\nimport { Context, SlashCommand, PaginatorTypeEnum, SlashCommandContext } from '@globalart/nestcord';\n\n@Injectable()\nexport class AppService implements OnModuleInit {\n public constructor(private readonly paginationService: NestCordPaginationService) {\n }\n\n public onModuleInit(): void {\n this.paginationService.register(PaginatorTypeEnum.BUTTONS, (builder) =>\n builder\n .setCustomId('test')\n \n );\n }\n\n @SlashCommand({ name: 'pagination', description: 'Test pagination' })\n public async onPagination(@Context() [interaction]: SlashCommandContext) {\n const pagination = this.paginationService.get('test');\n pagination.setButtons([\n [\n { \n customId: 'page1',\n label: 'Page 1',\n style: ButtonStyle.Secondary,\n },\n { \n customId: 'page2',\n label: 'Page 2',\n style: ButtonStyle.Secondary,\n }\n ]\n ]);\n pagination.setPages([\n new PageBuilder().setContent('Page 1'),\n new PageBuilder().setContent('Page 2')\n ]);\n const page = await pagination.build(1);\n\n return interaction.reply(page);\n }\n}\n"})}),"\n",(0,a.jsx)(e.h3,{id:"select-menu-pagination",children:"Select Menu Pagination"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-typescript",children:"import { OnModuleInit, Injectable } from '@nestjs/common';\nimport { NestCordPaginationService, PageBuilder } from '@globalart/nestcord/pagination';\nimport { Context, SlashCommand, PaginatorTypeEnum, SlashCommandContext } from '@globalart/nestcord';\n\n@Injectable()\nexport class AppService implements OnModuleInit {\n public constructor(private readonly paginationService: NestCordPaginationService) {\n }\n\n public onModuleInit(): void {\n this.paginationService.register(PaginatorTypeEnum.SELECT_MENU, (builder) =>\n builder\n .setCustomId('test')\n \n );\n }\n\n @SlashCommand({ name: 'pagination', description: 'Test pagination' })\n public async onPagination(@Context() [interaction]: SlashCommandContext) {\n const pagination = this.paginationService.get('test');\n pagination.setSelectMenuItems(this.setMenuItems());\n pagination.setPages(this.setMenuPages());\n const page = await pagination.build('page1');\n\n return interaction.reply(page);\n }\n\n @StringSelect('nestcord-pagination/test')\n async MenusInteraction(@Context() [interaction]: ButtonContext, @SelectedStrings() selected: string[]) {\n const selectedPage = selected?.[0] || null;\n const pagination = this.paginationService.get('menus');\n pagination.setSelectMenuItems(this.setMenuItems());\n pagination.setPages(this.setMenuPages());\n const page = await pagination.build(selectedPage);\n\n await interaction.update(page);\n }\n\n private readonly setMenuPages() {\n return [\n {\n pageId: 'page1',\n builder: new PageBuilder().setContent('Page 1'),\n },\n {\n pageId: 'page2',\n builder: new PageBuilder().setContent('Page 2'),\n },\n ];\n }\n\n private readonly setMenuItems() {\n return [\n {\n label: 'Page 1',\n value: 'page1',\n },\n {\n label: 'Page 2',\n value: 'page2',\n },\n ]\n }\n}\n"})}),"\n",(0,a.jsxs)(e.p,{children:["Congratulations! You have successfully created your first pagination!\nJust use ",(0,a.jsx)(e.code,{children:"pagination"})," command and you will see your pagination!"]})]})}function d(n={}){const{wrapper:e}={...(0,i.R)(),...n.components};return e?(0,a.jsx)(e,{...n,children:(0,a.jsx)(p,{...n})}):p(n)}},5710:(n,e,t)=>{t.d(e,{R:()=>s,x:()=>r});var a=t(758);const i={},o=a.createContext(i);function s(n){const e=a.useContext(o);return a.useMemo((function(){return"function"==typeof n?n(e):{...e,...n}}),[e,n])}function r(n){let e;return e=n.disableParentContext?"function"==typeof n.components?n.components(i):n.components||i:s(n.components),a.createElement(o.Provider,{value:e},n.children)}}}]);
\ No newline at end of file
diff --git a/assets/js/1d02dd36.7a6f267a.js b/assets/js/1d02dd36.7a6f267a.js
deleted file mode 100644
index f34060e..0000000
--- a/assets/js/1d02dd36.7a6f267a.js
+++ /dev/null
@@ -1 +0,0 @@
-"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[753],{2611:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>s,default:()=>p,frontMatter:()=>i,metadata:()=>r,toc:()=>l});var a=t(6070),o=t(5710);const i={id:"pagination",title:"Pagination",sidebar_position:1},s=void 0,r={id:"packages/pagination",title:"Pagination",description:"Certainly! Pagination is a useful technique employed in user interfaces to present large amounts of information in a structured and",source:"@site/content/packages/pagination.md",sourceDirName:"packages",slug:"/packages/pagination",permalink:"/packages/pagination",draft:!1,unlisted:!1,editUrl:"https://github.com/GlobalArtInc/nestcord/tree/master/docs/content/packages/pagination.md",tags:[],version:"current",sidebarPosition:1,frontMatter:{id:"pagination",title:"Pagination",sidebar_position:1},sidebar:"docsSidebar",previous:{title:"Defer command",permalink:"/interceptors/defer-interceptor"},next:{title:"Localization",permalink:"/packages/localization"}},c={},l=[{value:"Usage",id:"usage",level:2}];function d(e){const n={code:"code",h2:"h2",p:"p",pre:"pre",...(0,o.R)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.p,{children:"Certainly! Pagination is a useful technique employed in user interfaces to present large amounts of information in a structured and\nmanageable way. When dealing with substantial volumes of data, such as search results, articles, or product listings, presenting it all at\nonce can overwhelm users and lead to a poor user experience. Pagination allows you to divide the information into smaller, organized chunks,\nenhancing user engagement and ease of navigation. This module allows you to create a pagination with a few lines of code."}),"\n",(0,a.jsx)(n.h2,{id:"usage",children:"Usage"}),"\n",(0,a.jsxs)(n.p,{children:["Once the installation process is complete, we can import the ",(0,a.jsx)(n.code,{children:"NestCordPaginationModule"})," with your ",(0,a.jsx)(n.code,{children:"NestCordModule"})," into the root ",(0,a.jsx)(n.code,{children:"AppModule"}),":"]}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-typescript",children:"import { NestCordModule } from '@globalart/nestcord';\nimport { Module } from '@nestjs/common';\nimport { NestCordPaginationModule } from '@globalart/nestcord';\nimport { AppService } from './app.service';\n\n@Module({\n imports: [\n NestCordModule.forRoot({\n token: 'DISCORD_BOT_TOKEN',\n intents: ['Guilds', 'GuildMessages', 'DirectMessages']\n }),\n NestCordPaginationModule.forRoot({\n // Change your buttons appearance\n buttons: {},\n // Add buttons for skip to first and last page\n allowSkip: true,\n // Add buttons for search page\n allowTraversal: true\n })\n ],\n providers: [AppService]\n})\nexport class AppModule {}\n"})}),"\n",(0,a.jsxs)(n.p,{children:["Then, we can inject the ",(0,a.jsx)(n.code,{children:"PaginationService"})," into our service and register a pagination handler:"]}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-typescript",children:"import { OnModuleInit, Injectable } from '@nestjs/common';\nimport { NestCordPaginationService, PageBuilder } from '@globalart/nestcord/pagination';\nimport { Context, SlashCommand, SlashCommandContext } from '@globalart/nestcord';\n\n@Injectable()\nexport class AppService implements OnModuleInit {\n public constructor(private readonly paginationService: NestCordPaginationService) {\n }\n\n public onModuleInit(): void {\n return this.paginationService.register(builder =>\n builder\n // Required, need for search your builder\n .setCustomId('test')\n // First way to set pages\n .setPages([\n new PageBuilder().setContent('Page 1'),\n new PageBuilder().setContent('Page 2'),\n new PageBuilder().setContent('Page 3'),\n new PageBuilder().setContent('Page 4'),\n new PageBuilder().setContent('Page 5')\n ])\n // Second way, you can manually set pages using `setPages` method\n .setPagesFactory(page => new PageBuilder().setContent(`Page ${page}`))\n // Optional, only if you want to use pages factory\n .setMaxPages(5)\n );\n }\n\n @SlashCommand({ name: 'pagination', description: 'Test pagination' })\n public async onPagination(@Context() [interaction]: SlashCommandContext) {\n const pagination = this.paginationService.get('test');\n const page = await pagination.build();\n\n return interaction.reply(page);\n }\n}\n"})}),"\n",(0,a.jsxs)(n.p,{children:["Congratulations! You have successfully created your first pagination!\nJust use ",(0,a.jsx)(n.code,{children:"pagination"})," command and you will see your pagination!"]})]})}function p(e={}){const{wrapper:n}={...(0,o.R)(),...e.components};return n?(0,a.jsx)(n,{...e,children:(0,a.jsx)(d,{...e})}):d(e)}},5710:(e,n,t)=>{t.d(n,{R:()=>s,x:()=>r});var a=t(758);const o={},i=a.createContext(o);function s(e){const n=a.useContext(i);return a.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function r(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:s(e.components),a.createElement(i.Provider,{value:n},e.children)}}}]);
\ No newline at end of file
diff --git a/assets/js/runtime~main.654f5dcc.js b/assets/js/runtime~main.d876fdd0.js
similarity index 98%
rename from assets/js/runtime~main.654f5dcc.js
rename to assets/js/runtime~main.d876fdd0.js
index 0c9a973..fb15d69 100644
--- a/assets/js/runtime~main.654f5dcc.js
+++ b/assets/js/runtime~main.d876fdd0.js
@@ -1 +1 @@
-(()=>{"use strict";var e,a,t,r,d,o={},f={};function c(e){var a=f[e];if(void 0!==a)return a.exports;var t=f[e]={id:e,loaded:!1,exports:{}};return o[e].call(t.exports,t,t.exports,c),t.loaded=!0,t.exports}c.m=o,c.c=f,e=[],c.O=(a,t,r,d)=>{if(!t){var o=1/0;for(i=0;i=d)&&Object.keys(c.O).every((e=>c.O[e](t[b])))?t.splice(b--,1):(f=!1,d0&&e[i-1][2]>d;i--)e[i]=e[i-1];e[i]=[t,r,d]},c.n=e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return c.d(a,{a:a}),a},t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,c.t=function(e,r){if(1&r&&(e=this(e)),8&r)return e;if("object"==typeof e&&e){if(4&r&&e.__esModule)return e;if(16&r&&"function"==typeof e.then)return e}var d=Object.create(null);c.r(d);var o={};a=a||[null,t({}),t([]),t(t)];for(var f=2&r&&e;"object"==typeof f&&!~a.indexOf(f);f=t(f))Object.getOwnPropertyNames(f).forEach((a=>o[a]=()=>e[a]));return o.default=()=>e,c.d(d,o),d},c.d=(e,a)=>{for(var t in a)c.o(a,t)&&!c.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:a[t]})},c.f={},c.e=e=>Promise.all(Object.keys(c.f).reduce(((a,t)=>(c.f[t](e,a),a)),[])),c.u=e=>"assets/js/"+({48:"a94703ab",98:"a7bd4aaa",123:"ede3a018",138:"1a4e3797",140:"e7393073",174:"5aea931f",222:"b38399eb",254:"68e633d4",315:"9eb1dac9",329:"66d9f3df",365:"717a4525",399:"a4b529fe",401:"17896441",497:"f217256c",504:"d291a071",506:"003b49f9",531:"393eff57",539:"7eb5a8bf",567:"22dd74f7",597:"3c0a97de",610:"946bd85a",647:"5e95c892",680:"6794d4cd",713:"6c4d718c",742:"aba21aa0",753:"1d02dd36",793:"ebd218ab",810:"9ce5ed71",815:"ba8b3534",886:"0b6bdc6b",911:"23abe487",931:"ec3f407b",936:"107a3993",957:"c141421f",978:"a7f4de78",981:"7d07d949",984:"5ca74542"}[e]||e)+"."+{43:"37d158a2",48:"e8c68aa1",98:"54a9f721",123:"3bb38c40",138:"6d5600fe",140:"505ed063",174:"abda0e45",222:"b50206ab",254:"d8332719",300:"30a0d5cd",315:"67926fb5",329:"c421a468",365:"e500b740",399:"05fb8963",401:"f5d444cf",431:"cae4ca62",497:"787d3070",504:"4e06f95c",506:"0812a3f2",531:"a7016edb",539:"a7999c0e",567:"aa312007",597:"6a5c3fdb",610:"1046101e",647:"9fb68879",680:"f48320b9",713:"f857faa6",742:"eb7bf6f2",753:"7a6f267a",793:"be6b4cd9",795:"67995017",810:"f4cf5300",815:"8f6afdff",873:"71e8067e",886:"c79070e0",911:"cb53ba38",931:"56aff0d0",935:"6519dbf5",936:"ffa1b29a",957:"faee654a",978:"aa550ef0",981:"f5a6cf03",984:"446ff499",994:"5efa2256"}[e]+".js",c.miniCssF=e=>{},c.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),c.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),r={},d="docs:",c.l=(e,a,t,o)=>{if(r[e])r[e].push(a);else{var f,b;if(void 0!==t)for(var n=document.getElementsByTagName("script"),i=0;i{f.onerror=f.onload=null,clearTimeout(s);var d=r[e];if(delete r[e],f.parentNode&&f.parentNode.removeChild(f),d&&d.forEach((e=>e(t))),a)return a(t)},s=setTimeout(l.bind(null,void 0,{type:"timeout",target:f}),12e4);f.onerror=l.bind(null,f.onerror),f.onload=l.bind(null,f.onload),b&&document.head.appendChild(f)}},c.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},c.p="/",c.gca=function(e){return e={17896441:"401",a94703ab:"48",a7bd4aaa:"98",ede3a018:"123","1a4e3797":"138",e7393073:"140","5aea931f":"174",b38399eb:"222","68e633d4":"254","9eb1dac9":"315","66d9f3df":"329","717a4525":"365",a4b529fe:"399",f217256c:"497",d291a071:"504","003b49f9":"506","393eff57":"531","7eb5a8bf":"539","22dd74f7":"567","3c0a97de":"597","946bd85a":"610","5e95c892":"647","6794d4cd":"680","6c4d718c":"713",aba21aa0:"742","1d02dd36":"753",ebd218ab:"793","9ce5ed71":"810",ba8b3534:"815","0b6bdc6b":"886","23abe487":"911",ec3f407b:"931","107a3993":"936",c141421f:"957",a7f4de78:"978","7d07d949":"981","5ca74542":"984"}[e]||e,c.p+c.u(e)},(()=>{var e={354:0,869:0};c.f.j=(a,t)=>{var r=c.o(e,a)?e[a]:void 0;if(0!==r)if(r)t.push(r[2]);else if(/^(354|869)$/.test(a))e[a]=0;else{var d=new Promise(((t,d)=>r=e[a]=[t,d]));t.push(r[2]=d);var o=c.p+c.u(a),f=new Error;c.l(o,(t=>{if(c.o(e,a)&&(0!==(r=e[a])&&(e[a]=void 0),r)){var d=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;f.message="Loading chunk "+a+" failed.\n("+d+": "+o+")",f.name="ChunkLoadError",f.type=d,f.request=o,r[1](f)}}),"chunk-"+a,a)}},c.O.j=a=>0===e[a];var a=(a,t)=>{var r,d,o=t[0],f=t[1],b=t[2],n=0;if(o.some((a=>0!==e[a]))){for(r in f)c.o(f,r)&&(c.m[r]=f[r]);if(b)var i=b(c)}for(a&&a(t);n{"use strict";var e,a,t,r,d,o={},f={};function c(e){var a=f[e];if(void 0!==a)return a.exports;var t=f[e]={id:e,loaded:!1,exports:{}};return o[e].call(t.exports,t,t.exports,c),t.loaded=!0,t.exports}c.m=o,c.c=f,e=[],c.O=(a,t,r,d)=>{if(!t){var o=1/0;for(i=0;i=d)&&Object.keys(c.O).every((e=>c.O[e](t[b])))?t.splice(b--,1):(f=!1,d0&&e[i-1][2]>d;i--)e[i]=e[i-1];e[i]=[t,r,d]},c.n=e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return c.d(a,{a:a}),a},t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,c.t=function(e,r){if(1&r&&(e=this(e)),8&r)return e;if("object"==typeof e&&e){if(4&r&&e.__esModule)return e;if(16&r&&"function"==typeof e.then)return e}var d=Object.create(null);c.r(d);var o={};a=a||[null,t({}),t([]),t(t)];for(var f=2&r&&e;"object"==typeof f&&!~a.indexOf(f);f=t(f))Object.getOwnPropertyNames(f).forEach((a=>o[a]=()=>e[a]));return o.default=()=>e,c.d(d,o),d},c.d=(e,a)=>{for(var t in a)c.o(a,t)&&!c.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:a[t]})},c.f={},c.e=e=>Promise.all(Object.keys(c.f).reduce(((a,t)=>(c.f[t](e,a),a)),[])),c.u=e=>"assets/js/"+({48:"a94703ab",98:"a7bd4aaa",123:"ede3a018",138:"1a4e3797",140:"e7393073",174:"5aea931f",222:"b38399eb",254:"68e633d4",315:"9eb1dac9",329:"66d9f3df",365:"717a4525",399:"a4b529fe",401:"17896441",497:"f217256c",504:"d291a071",506:"003b49f9",531:"393eff57",539:"7eb5a8bf",567:"22dd74f7",597:"3c0a97de",610:"946bd85a",647:"5e95c892",680:"6794d4cd",713:"6c4d718c",742:"aba21aa0",753:"1d02dd36",793:"ebd218ab",810:"9ce5ed71",815:"ba8b3534",886:"0b6bdc6b",911:"23abe487",931:"ec3f407b",936:"107a3993",957:"c141421f",978:"a7f4de78",981:"7d07d949",984:"5ca74542"}[e]||e)+"."+{43:"37d158a2",48:"e8c68aa1",98:"54a9f721",123:"3bb38c40",138:"6d5600fe",140:"505ed063",174:"abda0e45",222:"b50206ab",254:"d8332719",300:"30a0d5cd",315:"67926fb5",329:"c421a468",365:"e500b740",399:"05fb8963",401:"f5d444cf",431:"cae4ca62",497:"787d3070",504:"4e06f95c",506:"0812a3f2",531:"a7016edb",539:"a7999c0e",567:"aa312007",597:"6a5c3fdb",610:"1046101e",647:"9fb68879",680:"f48320b9",713:"f857faa6",742:"eb7bf6f2",753:"2ce0823e",793:"be6b4cd9",795:"67995017",810:"f4cf5300",815:"8f6afdff",873:"71e8067e",886:"c79070e0",911:"cb53ba38",931:"56aff0d0",935:"6519dbf5",936:"ffa1b29a",957:"faee654a",978:"aa550ef0",981:"f5a6cf03",984:"446ff499",994:"5efa2256"}[e]+".js",c.miniCssF=e=>{},c.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),c.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),r={},d="docs:",c.l=(e,a,t,o)=>{if(r[e])r[e].push(a);else{var f,b;if(void 0!==t)for(var n=document.getElementsByTagName("script"),i=0;i{f.onerror=f.onload=null,clearTimeout(s);var d=r[e];if(delete r[e],f.parentNode&&f.parentNode.removeChild(f),d&&d.forEach((e=>e(t))),a)return a(t)},s=setTimeout(l.bind(null,void 0,{type:"timeout",target:f}),12e4);f.onerror=l.bind(null,f.onerror),f.onload=l.bind(null,f.onload),b&&document.head.appendChild(f)}},c.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},c.p="/",c.gca=function(e){return e={17896441:"401",a94703ab:"48",a7bd4aaa:"98",ede3a018:"123","1a4e3797":"138",e7393073:"140","5aea931f":"174",b38399eb:"222","68e633d4":"254","9eb1dac9":"315","66d9f3df":"329","717a4525":"365",a4b529fe:"399",f217256c:"497",d291a071:"504","003b49f9":"506","393eff57":"531","7eb5a8bf":"539","22dd74f7":"567","3c0a97de":"597","946bd85a":"610","5e95c892":"647","6794d4cd":"680","6c4d718c":"713",aba21aa0:"742","1d02dd36":"753",ebd218ab:"793","9ce5ed71":"810",ba8b3534:"815","0b6bdc6b":"886","23abe487":"911",ec3f407b:"931","107a3993":"936",c141421f:"957",a7f4de78:"978","7d07d949":"981","5ca74542":"984"}[e]||e,c.p+c.u(e)},(()=>{var e={354:0,869:0};c.f.j=(a,t)=>{var r=c.o(e,a)?e[a]:void 0;if(0!==r)if(r)t.push(r[2]);else if(/^(354|869)$/.test(a))e[a]=0;else{var d=new Promise(((t,d)=>r=e[a]=[t,d]));t.push(r[2]=d);var o=c.p+c.u(a),f=new Error;c.l(o,(t=>{if(c.o(e,a)&&(0!==(r=e[a])&&(e[a]=void 0),r)){var d=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;f.message="Loading chunk "+a+" failed.\n("+d+": "+o+")",f.name="ChunkLoadError",f.type=d,f.request=o,r[1](f)}}),"chunk-"+a,a)}},c.O.j=a=>0===e[a];var a=(a,t)=>{var r,d,o=t[0],f=t[1],b=t[2],n=0;if(o.some((a=>0!==e[a]))){for(r in f)c.o(f,r)&&(c.m[r]=f[r]);if(b)var i=b(c)}for(a&&a(t);n
-
+
diff --git a/contributing/commit-convention.html b/contributing/commit-convention.html
index 9d81385..18b5ccd 100644
--- a/contributing/commit-convention.html
+++ b/contributing/commit-convention.html
@@ -14,7 +14,7 @@
-
+
diff --git a/contributing/contribution-guide.html b/contributing/contribution-guide.html
index c0c2fea..1e5eca1 100644
--- a/contributing/contribution-guide.html
+++ b/contributing/contribution-guide.html
@@ -14,7 +14,7 @@
-
+
diff --git a/contributing/funding.html b/contributing/funding.html
index b2f7d4d..d1c64d4 100644
--- a/contributing/funding.html
+++ b/contributing/funding.html
@@ -14,7 +14,7 @@
-
+
diff --git a/index.html b/index.html
index 6cf870a..6cc1db2 100644
--- a/index.html
+++ b/index.html
@@ -14,7 +14,7 @@
-
+
diff --git a/interactions/context-menus.html b/interactions/context-menus.html
index d081a95..7cfa762 100644
--- a/interactions/context-menus.html
+++ b/interactions/context-menus.html
@@ -14,7 +14,7 @@
-
+
diff --git a/interactions/message-components.html b/interactions/message-components.html
index 5837f2a..8e04cec 100644
--- a/interactions/message-components.html
+++ b/interactions/message-components.html
@@ -14,7 +14,7 @@
-
+
diff --git a/interactions/modals.html b/interactions/modals.html
index 9350938..3175686 100644
--- a/interactions/modals.html
+++ b/interactions/modals.html
@@ -14,7 +14,7 @@
-
+
diff --git a/interactions/slash-commands.html b/interactions/slash-commands.html
index 4fd45b4..f52f071 100644
--- a/interactions/slash-commands.html
+++ b/interactions/slash-commands.html
@@ -14,7 +14,7 @@
-
+
diff --git a/interceptors/defer-interceptor.html b/interceptors/defer-interceptor.html
index 1411632..9557b22 100644
--- a/interceptors/defer-interceptor.html
+++ b/interceptors/defer-interceptor.html
@@ -14,7 +14,7 @@
-
+
diff --git a/listeners.html b/listeners.html
index 8f00e61..0ec3b03 100644
--- a/listeners.html
+++ b/listeners.html
@@ -14,7 +14,7 @@
-
+
diff --git a/packages/localization.html b/packages/localization.html
index fcf0a80..c783d0d 100644
--- a/packages/localization.html
+++ b/packages/localization.html
@@ -14,7 +14,7 @@
-
+
diff --git a/packages/pagination.html b/packages/pagination.html
index e2ed757..c5a6d3a 100644
--- a/packages/pagination.html
+++ b/packages/pagination.html
@@ -14,7 +14,7 @@
-
+
@@ -24,10 +24,13 @@
enhancing user engagement and ease of navigation. This module allows you to create a pagination with a few lines of code.
Usage
Once the installation process is complete, we can import the NestCordPaginationModule
with your NestCordModule
into the root AppModule
:
-import { NestCordModule } from '@globalart/nestcord';
import { Module } from '@nestjs/common';
import { NestCordPaginationModule } from '@globalart/nestcord';
import { AppService } from './app.service';
@Module({
imports: [
NestCordModule.forRoot({
token: 'DISCORD_BOT_TOKEN',
intents: ['Guilds', 'GuildMessages', 'DirectMessages']
}),
NestCordPaginationModule.forRoot({
buttons: {},
allowSkip: true,
allowTraversal: true
})
],
providers: [AppService]
})
export class AppModule {}
+import { NestCordModule } from '@globalart/nestcord';
import { Module } from '@nestjs/common';
import { NestCordPaginationModule } from '@globalart/nestcord';
import { AppService } from './app.service';
@Module({
imports: [
NestCordModule.forRoot({
token: 'DISCORD_BOT_TOKEN',
intents: ['Guilds', 'GuildMessages', 'DirectMessages']
}),
NestCordPaginationModule.forRoot(null)
],
providers: [AppService]
})
export class AppModule {}
Then, we can inject the PaginationService
into our service and register a pagination handler:
-import { OnModuleInit, Injectable } from '@nestjs/common';
import { NestCordPaginationService, PageBuilder } from '@globalart/nestcord/pagination';
import { Context, SlashCommand, SlashCommandContext } from '@globalart/nestcord';
@Injectable()
export class AppService implements OnModuleInit {
public constructor(private readonly paginationService: NestCordPaginationService) {
}
public onModuleInit(): void {
return this.paginationService.register(builder =>
builder
.setCustomId('test')
.setPages([
new PageBuilder().setContent('Page 1'),
new PageBuilder().setContent('Page 2'),
new PageBuilder().setContent('Page 3'),
new PageBuilder().setContent('Page 4'),
new PageBuilder().setContent('Page 5')
])
.setPagesFactory(page => new PageBuilder().setContent(`Page ${page}`))
.setMaxPages(5)
);
}
@SlashCommand({ name: 'pagination', description: 'Test pagination' })
public async onPagination(@Context() [interaction]: SlashCommandContext) {
const pagination = this.paginationService.get('test');
const page = await pagination.build();
return interaction.reply(page);
}
}
+
+import { OnModuleInit, Injectable } from '@nestjs/common';
import { NestCordPaginationService, PageBuilder } from '@globalart/nestcord/pagination';
import { Context, SlashCommand, PaginatorTypeEnum, SlashCommandContext } from '@globalart/nestcord';
@Injectable()
export class AppService implements OnModuleInit {
public constructor(private readonly paginationService: NestCordPaginationService) {
}
public onModuleInit(): void {
this.paginationService.register(PaginatorTypeEnum.BUTTONS, (builder) =>
builder
.setCustomId('test')
);
}
@SlashCommand({ name: 'pagination', description: 'Test pagination' })
public async onPagination(@Context() [interaction]: SlashCommandContext) {
const pagination = this.paginationService.get<PaginatorTypeEnum.BUTTONS>('test');
pagination.setButtons([
[
{
customId: 'page1',
label: 'Page 1',
style: ButtonStyle.Secondary,
},
{
customId: 'page2',
label: 'Page 2',
style: ButtonStyle.Secondary,
}
]
]);
pagination.setPages([
new PageBuilder().setContent('Page 1'),
new PageBuilder().setContent('Page 2')
]);
const page = await pagination.build(1);
return interaction.reply(page);
}
}
+
+import { OnModuleInit, Injectable } from '@nestjs/common';
import { NestCordPaginationService, PageBuilder } from '@globalart/nestcord/pagination';
import { Context, SlashCommand, PaginatorTypeEnum, SlashCommandContext } from '@globalart/nestcord';
@Injectable()
export class AppService implements OnModuleInit {
public constructor(private readonly paginationService: NestCordPaginationService) {
}
public onModuleInit(): void {
this.paginationService.register(PaginatorTypeEnum.SELECT_MENU, (builder) =>
builder
.setCustomId('test')
);
}
@SlashCommand({ name: 'pagination', description: 'Test pagination' })
public async onPagination(@Context() [interaction]: SlashCommandContext) {
const pagination = this.paginationService.get<PaginatorTypeEnum.SELECT_MENU>('test');
pagination.setSelectMenuItems(this.setMenuItems());
pagination.setPages(this.setMenuPages());
const page = await pagination.build('page1');
return interaction.reply(page);
}
@StringSelect('nestcord-pagination/test')
async MenusInteraction(@Context() [interaction]: ButtonContext, @SelectedStrings() selected: string[]) {
const selectedPage = selected?.[0] || null;
const pagination = this.paginationService.get<PaginatorTypeEnum.SELECT_MENU>('menus');
pagination.setSelectMenuItems(this.setMenuItems());
pagination.setPages(this.setMenuPages());
const page = await pagination.build(selectedPage);
await interaction.update(page);
}
private readonly setMenuPages() {
return [
{
pageId: 'page1',
builder: new PageBuilder().setContent('Page 1'),
},
{
pageId: 'page2',
builder: new PageBuilder().setContent('Page 2'),
},
];
}
private readonly setMenuItems() {
return [
{
label: 'Page 1',
value: 'page1',
},
{
label: 'Page 2',
value: 'page2',
},
]
}
}
Congratulations! You have successfully created your first pagination!
-Just use pagination
command and you will see your pagination!
+Just use pagination
command and you will see your pagination!