mirror of
https://github.com/discordeno/discordeno.git
synced 2026-09-17 08:47:22 +00:00
refactor(rest): improve unauthorized readability (#2946)
Currently we use a double negation in the code which makes it harder to understand what it actually does. Therefore the check has been changed to be understood easier.
This commit is contained in:
@@ -694,7 +694,7 @@ export function createRestManager(options: CreateRestManagerOptions): RestManage
|
||||
'user-agent': `DiscordBot (https://github.com/discordeno/discordeno, v${version})`,
|
||||
}
|
||||
|
||||
if (!options?.unauthorized) headers.authorization = `Bot ${rest.token}`
|
||||
if (options?.unauthorized !== false) headers.authorization = `Bot ${rest.token}`
|
||||
|
||||
// IF A REASON IS PROVIDED ENCODE IT IN HEADERS
|
||||
if (options?.reason !== undefined) {
|
||||
|
||||
Reference in New Issue
Block a user