1.0.2 • Published 5 years ago
dlist-wrapper v1.0.2
Wrapper for DList.top API released on the MIT license.
Installation and usage
npm install dlist-wrapper --save
const dblista = require("dlist-wrapper")Guide
1. BOTS:
- getBotInfo(BOT_ID)
Example:
dblista.getBotInfo("676816022241673226").then(async response => response.json().then(async json => { console.log(json); })); - getBotList(PAGE)
Example:
dblista.getBotList(1).then(async response => response.json().then(async json => { console.log(json); })); - getPremiumBots()
Example:
dblista.getPremiumBots().then(async response => response.json().then(async json => { console.log(json); })); - getUnverifiedBots()
Example:
dblista.getUnverifiedBots().then(async response => response.json().then(async json => { console.log(json); })); - getRejectedBots()
Example:
dblista.getRejectedBots().then(async response => response.json().then(async json => { console.log(json); })); - searchBots(QUERY)
Example:
dblista.searchBots("dlist").then(async response => response.json().then(async json => { console.log(json); })); - addBot(USER_DBLISTA_TOKEN, JSON_BODY)
Example:
dblista.addBot("XXXXXXXXXXXXXXXXXXX", "{ \"id\": \"676816022241673226\", \"info\": { \"library\": \"DiscordGo\", \"tags\": [ \"moderacja\", \"inne\" ], \"prefix\": \"!\", \"fullDescription\": \"Long description\", \"shortDescription\": \"Shord description\" }, \"links\": { \"gitRepository\": \"https://github.com/example\", \"website\": \"https://example.com\", \"discordServer\": \"https://discord.gg/example\" }, \"owners\": [ \"328902624738934784\" ]}") - editBot(USER_DBLISTA_TOKEN, JSON_BODY)
Example:
dblista.editBot("XXXXXXXXXXXXXXXXXXX", "{ \"id\": \"676816022241673226\", \"info\": { \"library\": \"DiscordGo\", \"tags\": [ \"moderacja\", \"inne\" ], \"prefix\": \"!\", \"fullDescription\": \"Long description\", \"shortDescription\": \"Shord description\" }, \"links\": { \"gitRepository\": \"https://github.com/example\", \"website\": \"https://example.com\", \"discordServer\": \"https://discord.gg/example\" }, \"owners\": [ \"328902624738934784\" ]}") - deleteBot(USER_DBLISTA_TOKEN, BOT_ID)
Example:
dblista.deleteBot("XXXXXXXXXXXXXXXXXXX", "676816022241673226"); - voteBot(USER_DBLISTA_TOKEN, BOT_ID)
Example:
dblista.voteBot("XXXXXXXXXXXXXXXXXXX", "676816022241673226").then(async response => response.json().then(async json => { console.log(json); })); - setPending(USER_DBLISTA_TOKEN, BOT_ID)
Example:
dblista.setPending("XXXXXXXXXXXXXXXXXXX", "676816022241673226").then(async response => response.json().then(async json => { console.log(json); })); - boostBot(USER_DBLISTA_TOKEN, BOT_ID)
Example:
dblista.boostBot("XXXXXXXXXXXXXXXXXXX", "676816022241673226").then(async response => response.json().then(async json => { console.log(json); })); - deleteBoostBot(USER_DBLISTA_TOKEN, BOT_ID)
Example:
dblista.deleteBoostBot("XXXXXXXXXXXXXXXXXXX", "676816022241673226").then(async response => response.json().then(async json => { console.log(json); })); - rateBot(USER_DBLISTA_TOKEN, BOT_ID, RATING, DETAILS)
Example:
dblista.rateBot("XXXXXXXXXXXXXXXXXXX", "676816022241673226", 5, "Example comment").then(async response => response.json().then(async json => { console.log(json); })); - deleteRateBot(USER_DBLISTA_TOKEN, BOT_ID)
Example:
dblista.deleteRateBot("XXXXXXXXXXXXXXXXXXX", "676816022241673226").then(async response => response.json().then(async json => { console.log(json); })); - sendStats(BOT_DBLISTA_TOKEN, USERS, SERVERS)
Example:
dblista.sendStats("XXXXXXXXXXXXXXXXXXX", 100000, 450).then(async response => response.json().then(async json => { console.log(json); }));
2. SERVERS:
- getServerInfo(SERVER_ID)
Example:
dblista.getServerInfo("663668731095941150").then(async response => response.json().then(async json => { console.log(json); })); - getServers(PAGE)
Example:
dblista.getServers(1).then(async response => response.json().then(async json => { console.log(json); })); - getPremiumServers()
Example:
dblista.getPremiumServers().then(async response => response.json().then(async json => { console.log(json); })); - searchServers(QUERY)
Example:
dblista.searchServers("dblista").then(async response => response.json().then(async json => { console.log(json); })); - addServer(USER_DBLISTA_TOKEN, JSON_BODY)
Example:
dblista.addServer("XXXXXXXXXXXXXXXXXXX", "{ \"id\":\"663668731095941150\",\"info\": {\"tags\":[\"programowanie\",\"inne\"],\"fullDescription\":\"Long description\",\"shortDescription\":\"Shord description\"},\"links\": {\"website\":\"https://example.com\"}}") - editServer(USER_DBLISTA_TOKEN, JSON_BODY)
Example:
dblista.editServer("XXXXXXXXXXXXXXXXXXX", "{ \"id\":\"663668731095941150\",\"info\": {\"tags\":[\"programowanie\",\"inne\"],\"fullDescription\":\"Long description\",\"shortDescription\":\"Shord description\"},\"links\": {\"website\":\"https://example.com\"}}") - deleteServer(USER_DBLISTA_TOKEN, SERVER_ID)
Example:
dblista.deleteServer("XXXXXXXXXXXXXXXXXXX", "663668731095941150"); - voteServer(USER_DBLISTA_TOKEN, SERVER_ID)
Example:
dblista.voteServer("XXXXXXXXXXXXXXXXXXX", "663668731095941150").then(async response => response.json().then(async json => { console.log(json); })); - boostServer(USER_DBLISTA_TOKEN, SERVER_ID)
Example:
dblista.boostBot("XXXXXXXXXXXXXXXXXXX", "663668731095941150").then(async response => response.json().then(async json => { console.log(json); })); - deleteBoostServer(USER_DBLISTA_TOKEN, SERVER_ID)
Example:
dblista.deleteBoostBot("XXXXXXXXXXXXXXXXXXX", "663668731095941150").then(async response => response.json().then(async json => { console.log(json); })); - rateServer(USER_DBLISTA_TOKEN, SERVER_ID, RATING, DETAILS)
Example:
dblista.rateServer("XXXXXXXXXXXXXXXXXXX", "663668731095941150", 5, "Example comment").then(async response => response.json().then(async json => { console.log(json); })); - deleteRateServer(USER_DBLISTA_TOKEN, SERVER_ID)
Example:
dblista.deleteRateServer("XXXXXXXXXXXXXXXXXXX", "663668731095941150").then(async response => response.json().then(async json => { console.log(json); }));
3. USERS:
- getUserInfo(USER_ID)
Example:
dblista.getUserInfo("328902624738934784").then(async response => response.json().then(async json => { console.log(json); }));
4. FOR MODS:
- approveBot(USER_DBLISTA_TOKEN, BOT_ID, REASON)
- rejectBot(USER_DBLISTA_TOKEN, BOT_ID, REASON)
- deleteUserRateBot(USER_DBLISTA_TOKEN, BOT_ID, REASON)
- deleteUserRateServer(USER_DBLISTA_TOKEN, BOT_ID, REASON)