Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {if:{getuser:gallery}|=||then:{js:
- async function createJSON() {
- const url = 'https://jsonblob.com/api/jsonBlob'
- const data = {}
- const respuesta = await fetch(url, {
- method: 'POST',
- headers: {
- 'Content-Type': 'application/json',
- 'Accept': 'application/json'
- },
- body: JSON.stringify(data)
- })
- discord.storage.user.gallery = respuesta.headers.get('location')
- }
- createJSON();
- }}{set:gallery|{download:{getuser:gallery}}}{js:
- const com = discord.variables.__args[0];
- const gallery = JSON.parse(discord.variables.gallery);
- const galleryList = Object.keys(gallery);
- const HEADER = {
- "icon_url": `https://cdn.discordapp.com/avatars/${discord.user.id}/${discord.user.avatar}`,
- "name": discord.user.username
- }
- const FOOTER = {
- "text": "Gallery"
- }
- switch(com) {
- case "list":
- const pages = Math.ceil(galleryList.length);
- const currentPage = Number(discord.variables.__args?.[1] ?? 1)-1;
- console.log(`## Showing page ${currentPage+1}/${Math.ceil(pages/50)}`);
- console.log(galleryList.slice(currentPage*50,currentPage*50+50).map(x => "- `" + x + "`").join("\n"))
- break;
- default:
- console.log(gallery[com].match(/\{attach\:(.+)\}/)[1])
- break;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment