Currently learning stuff and building things
daswolke / snowtransfer Goto Github PK
View Code? Open in Web Editor NEWMinimalistic rest client for the discord api
License: MIT License
Minimalistic rest client for the discord api
License: MIT License
I wanted to ask if there was any reason this library is using a custom typings library from https://github.com/AmandaDiscord/DiscordTypings rather than something more widely used and updated such as https://github.com/discordjs/discord-api-types.
I'm having trouble implementing certain functionalities because I'm getting type errors between the two and I can't cast some of the objects (easily....) because it seems the typings this library uses are outdated.
An example is ApplicationCommandBase
from DiscordTypings appears to be older. According to the docs, there should be a required id, version, and among other things that the ApplicationCommandBase
does not seem to include but APIApplicationCommand
from the more widely-used library has the type that is identical to the discord API docs.
I like the way this library acts as a lightweight rest client, I'm just wondering if this is something intended, if I am missing something, or I should use something else/fork and adjust.
Hi, I tried using SnowTransfer so the ratelimits of one of my feature could work properly.
I am using user.createDirectMessageChannel
in a "massive way", this means I am requesting for the endpoint many times at the same millisecond.
I tried multiple times but when there is many at the same milliseconds the createDirectMessageChannel
method is not working at all and no issue is thrown, the promises are pending forever.
Could someone look at the issue? Tyvm
const client = new SnowTransfer(process.env.TOKEN)
const members = await client.guild.getGuildMembers(guildId, { limit: 10 })
members
will always be an array with only 1 GuildMember regardless of what the limit is set to.
I made the request myself using fetch:
const headers = new Headers()
headers.set('Authorization', 'Bot ' + process.env.TOKEN!)
const response = await fetch(
`https://discord.com/api/v10/guilds/${guildId}/members?limit=10`,
{ headers }
)
const members = await response.json()
Here members
is an array with 10 GuildMembers.
I have made sure that process.env.TOKEN
and guildId
are correct, and the bot has the GUILD_MEMBERS
intent enabled.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.