mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-03 17:30:07 +00:00
add debug logs
This commit is contained in:
@@ -82,8 +82,8 @@ const process_headers = (url: string, headers: Headers) => {
|
||||
// Get all useful headers
|
||||
const remaining = headers.get("x-ratelimit-remaining")
|
||||
const reset_timestamp = headers.get("x-ratelimit-reset")
|
||||
const retry_after = headers.get('retry-after')
|
||||
const global = headers.get('x-ratelimit-global')
|
||||
const retry_after = headers.get("retry-after")
|
||||
const global = headers.get("x-ratelimit-global")
|
||||
|
||||
// If there is no remaining rate limit for this endpoint, we save it in cache
|
||||
if (remaining && remaining === "0") {
|
||||
@@ -99,8 +99,8 @@ const process_headers = (url: string, headers: Headers) => {
|
||||
if (global) {
|
||||
ratelimited = true
|
||||
|
||||
ratelimited_paths.set('global', {
|
||||
url: 'global',
|
||||
ratelimited_paths.set("global", {
|
||||
url: "global",
|
||||
reset_timestamp: Date.now() + Number(retry_after)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -72,6 +72,7 @@ export const create_channel = (data: Channel_Create_Payload, client: Client) =>
|
||||
},
|
||||
/** Send a message to the channel. Requires SEND_MESSAGES permission. */
|
||||
send_message: async (content: string | MessageContent) => {
|
||||
console.log('SENDING_MESSAGE:', content)
|
||||
if (typeof content === "string") content = { content }
|
||||
|
||||
if (data.guild_id) {
|
||||
@@ -83,7 +84,9 @@ export const create_channel = (data: Channel_Create_Payload, client: Client) =>
|
||||
|
||||
if (content.content && content.content.length > 2000) throw new Error(Errors.MESSAGE_MAX_LENGTH)
|
||||
|
||||
console.log(endpoints.CHANNEL_MESSAGES(data.id))
|
||||
const result = await Request_Manager.post(endpoints.CHANNEL_MESSAGES(data.id), content)
|
||||
console.log(result)
|
||||
return create_message(result, client)
|
||||
},
|
||||
/** The position of the channel in the server. If this channel does not have a position for example DM channels, it will be -1 */
|
||||
|
||||
Reference in New Issue
Block a user