mirror of
https://github.com/tiramisulabs/seyfert.git
synced 2025-07-03 05:26:07 +00:00
hotfix: undefined behavior
This commit is contained in:
parent
61cb7b26fb
commit
fd9b0284a6
50
egg.json
50
egg.json
@ -1,27 +1,27 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://x.nest.land/eggs@0.3.10/src/schema.json",
|
"$schema": "https://x.nest.land/eggs@0.3.10/src/schema.json",
|
||||||
"name": "biscuit",
|
"name": "biscuit",
|
||||||
"entry": "./mod.ts",
|
"entry": "./mod.ts",
|
||||||
"description": "A brand new bleeding edge non bloated Discord library",
|
"description": "A brand new bleeding edge non bloated Discord library",
|
||||||
"homepage": "https://github.com/oasisjs/biscuit",
|
"homepage": "https://github.com/oasisjs/biscuit",
|
||||||
"version": "0.2.0",
|
"version": "0.2.0",
|
||||||
"releaseType": "minor",
|
"releaseType": "minor",
|
||||||
"unstable": false,
|
"unstable": false,
|
||||||
"unlisted": false,
|
"unlisted": false,
|
||||||
"files": [
|
"files": [
|
||||||
"./packages/**/*",
|
"./packages/**/*",
|
||||||
"./mod.ts",
|
"./mod.ts",
|
||||||
"LICENSE",
|
"LICENSE",
|
||||||
"README.md"
|
"README.md"
|
||||||
],
|
],
|
||||||
"ignore": [
|
"ignore": [
|
||||||
"npm",
|
"npm",
|
||||||
"build.ts",
|
"build.ts",
|
||||||
"scripts.ts",
|
"scripts.ts",
|
||||||
".git"
|
".git"
|
||||||
],
|
],
|
||||||
"checkFormat": true,
|
"checkFormat": true,
|
||||||
"checkTests": false,
|
"checkTests": false,
|
||||||
"checkInstallation": false,
|
"checkInstallation": false,
|
||||||
"check": true
|
"check": true
|
||||||
}
|
}
|
||||||
|
@ -241,20 +241,19 @@ export class Session extends EventEmitter {
|
|||||||
application_id: this.applicationId,
|
application_id: this.applicationId,
|
||||||
details: activity.details,
|
details: activity.details,
|
||||||
state: activity.state,
|
state: activity.state,
|
||||||
emoji: activity.emoji || {
|
emoji: activity.emoji && {
|
||||||
name: activity.emoji!.name,
|
name: activity.emoji.name,
|
||||||
id: activity.emoji!.id,
|
id: activity.emoji.id,
|
||||||
animated: activity.emoji!.animated,
|
animated: activity.emoji.animated,
|
||||||
},
|
},
|
||||||
party: activity.party,
|
party: activity.party,
|
||||||
assets: activity.assets
|
assets: activity.assets &&
|
||||||
? {
|
{
|
||||||
large_image: activity.assets.largeImage,
|
large_image: activity.assets.largeImage,
|
||||||
large_text: activity.assets.largeText,
|
large_text: activity.assets.largeText,
|
||||||
small_image: activity.assets.smallImage,
|
small_image: activity.assets.smallImage,
|
||||||
small_text: activity.assets.smallText,
|
small_text: activity.assets.smallText,
|
||||||
}
|
},
|
||||||
: undefined,
|
|
||||||
secrets: activity.secrets,
|
secrets: activity.secrets,
|
||||||
instance: activity.instance,
|
instance: activity.instance,
|
||||||
flags: activity.flags,
|
flags: activity.flags,
|
||||||
|
@ -55,16 +55,16 @@ export function embed(data: Embed): DiscordEmbed {
|
|||||||
url: data.url,
|
url: data.url,
|
||||||
color: data.color,
|
color: data.color,
|
||||||
description: data.description,
|
description: data.description,
|
||||||
author: {
|
author: data.author && {
|
||||||
name: data.author?.name!,
|
name: data.author.name,
|
||||||
url: data.author?.url,
|
url: data.author.url,
|
||||||
icon_url: data.author?.iconURL,
|
icon_url: data.author.iconURL,
|
||||||
proxy_icon_url: data.author?.proxyIconURL,
|
proxy_icon_url: data.author.proxyIconURL,
|
||||||
},
|
},
|
||||||
footer: data.footer || {
|
footer: data.footer && {
|
||||||
text: data.footer!.text,
|
text: data.footer.text,
|
||||||
icon_url: data.footer!.iconURL,
|
icon_url: data.footer.iconURL,
|
||||||
proxy_icon_url: data.footer!.proxyIconURL,
|
proxy_icon_url: data.footer.proxyIconURL,
|
||||||
},
|
},
|
||||||
fields: data.fields?.map((f) => {
|
fields: data.fields?.map((f) => {
|
||||||
return {
|
return {
|
||||||
@ -73,11 +73,11 @@ export function embed(data: Embed): DiscordEmbed {
|
|||||||
inline: f.inline,
|
inline: f.inline,
|
||||||
};
|
};
|
||||||
}),
|
}),
|
||||||
thumbnail: data.thumbnail || {
|
thumbnail: data.thumbnail && {
|
||||||
url: data.thumbnail!.url,
|
url: data.thumbnail.url,
|
||||||
proxy_url: data.thumbnail!.proxyURL,
|
proxy_url: data.thumbnail.proxyURL,
|
||||||
width: data.thumbnail!.width,
|
width: data.thumbnail.width,
|
||||||
height: data.thumbnail!.height,
|
height: data.thumbnail.height,
|
||||||
},
|
},
|
||||||
video: {
|
video: {
|
||||||
url: data.video?.url,
|
url: data.video?.url,
|
||||||
@ -85,11 +85,11 @@ export function embed(data: Embed): DiscordEmbed {
|
|||||||
width: data.video?.width,
|
width: data.video?.width,
|
||||||
height: data.video?.height,
|
height: data.video?.height,
|
||||||
},
|
},
|
||||||
image: data.image || {
|
image: data.image && {
|
||||||
url: data.image!.url,
|
url: data.image.url,
|
||||||
proxy_url: data.image!.proxyURL,
|
proxy_url: data.image.proxyURL,
|
||||||
width: data.image!.width,
|
width: data.image.width,
|
||||||
height: data.image!.height,
|
height: data.image.height,
|
||||||
},
|
},
|
||||||
provider: {
|
provider: {
|
||||||
url: data.provider?.url,
|
url: data.provider?.url,
|
||||||
|
@ -74,9 +74,8 @@ export function NewInviteCreate(session: Session, invite: DiscordInviteCreate):
|
|||||||
maxUses: invite.max_uses,
|
maxUses: invite.max_uses,
|
||||||
targetType: invite.target_type,
|
targetType: invite.target_type,
|
||||||
targetUser: invite.target_user ? new User(session, invite.target_user) : undefined,
|
targetUser: invite.target_user ? new User(session, invite.target_user) : undefined,
|
||||||
targetApplication: invite.target_application
|
targetApplication: invite.target_application &&
|
||||||
? new Application(session, invite.target_application as DiscordApplication)
|
new Application(session, invite.target_application as DiscordApplication),
|
||||||
: undefined,
|
|
||||||
temporary: invite.temporary,
|
temporary: invite.temporary,
|
||||||
uses: invite.uses,
|
uses: invite.uses,
|
||||||
};
|
};
|
||||||
|
@ -155,11 +155,11 @@ export class Webhook implements Model {
|
|||||||
embeds: options?.embeds,
|
embeds: options?.embeds,
|
||||||
file: options?.files,
|
file: options?.files,
|
||||||
components: options?.components,
|
components: options?.components,
|
||||||
allowed_mentions: options?.allowedMentions || {
|
allowed_mentions: options?.allowedMentions && {
|
||||||
parse: options?.allowedMentions!.parse,
|
parse: options?.allowedMentions.parse,
|
||||||
replied_user: options?.allowedMentions!.repliedUser,
|
replied_user: options?.allowedMentions.repliedUser,
|
||||||
users: options?.allowedMentions!.users,
|
users: options?.allowedMentions.users,
|
||||||
roles: options?.allowedMentions!.roles,
|
roles: options?.allowedMentions.roles,
|
||||||
},
|
},
|
||||||
attachments: options?.attachments?.map((attachment) => {
|
attachments: options?.attachments?.map((attachment) => {
|
||||||
return {
|
return {
|
||||||
|
@ -671,8 +671,8 @@ export class Guild extends BaseGuild implements Model {
|
|||||||
system_channel_flags: options.systemChannelFlags,
|
system_channel_flags: options.systemChannelFlags,
|
||||||
verification_level: options.verificationLevel,
|
verification_level: options.verificationLevel,
|
||||||
icon: "iconURL" in options
|
icon: "iconURL" in options
|
||||||
? options.iconURL || urlToBase64(options.iconURL!)
|
? options.iconURL && urlToBase64(options.iconURL)
|
||||||
: options.iconHash || Util.iconBigintToHash(options.iconHash!),
|
: options.iconHash && Util.iconBigintToHash(options.iconHash),
|
||||||
channels: options.channels?.map((channel) => ({
|
channels: options.channels?.map((channel) => ({
|
||||||
name: channel.name,
|
name: channel.name,
|
||||||
nsfw: channel.nsfw,
|
nsfw: channel.nsfw,
|
||||||
@ -693,7 +693,7 @@ export class Guild extends BaseGuild implements Model {
|
|||||||
hoist: role.hoist,
|
hoist: role.hoist,
|
||||||
position: role.position,
|
position: role.position,
|
||||||
unicode_emoji: role.unicodeEmoji,
|
unicode_emoji: role.unicodeEmoji,
|
||||||
icon: options.iconURL || urlToBase64(options.iconURL!),
|
icon: options.iconURL && urlToBase64(options.iconURL),
|
||||||
})),
|
})),
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -713,18 +713,18 @@ export class Guild extends BaseGuild implements Model {
|
|||||||
system_channel_flags: options.systemChannelFlags,
|
system_channel_flags: options.systemChannelFlags,
|
||||||
verification_level: options.verificationLevel,
|
verification_level: options.verificationLevel,
|
||||||
icon: "iconURL" in options
|
icon: "iconURL" in options
|
||||||
? options.iconURL || urlToBase64(options.iconURL!)
|
? options.iconURL && urlToBase64(options.iconURL)
|
||||||
: options.iconHash || Util.iconBigintToHash(options.iconHash!),
|
: options.iconHash && Util.iconBigintToHash(options.iconHash),
|
||||||
// extra props
|
// extra props
|
||||||
splash: "splashURL" in options
|
splash: "splashURL" in options
|
||||||
? options.splashURL || urlToBase64(options.splashURL!)
|
? options.splashURL && urlToBase64(options.splashURL)
|
||||||
: options.splashHash || Util.iconBigintToHash(options.iconHash!),
|
: options.iconHash && Util.iconBigintToHash(options.iconHash),
|
||||||
banner: "bannerURL" in options
|
banner: "bannerURL" in options
|
||||||
? options.bannerURL || urlToBase64(options.bannerURL!)
|
? options.bannerURL && urlToBase64(options.bannerURL)
|
||||||
: options.bannerHash || Util.iconBigintToHash(options.bannerHash!),
|
: options.bannerHash && Util.iconBigintToHash(options.bannerHash),
|
||||||
discovery_splash: "discoverySplashURL" in options
|
discovery_splash: "discoverySplashURL" in options
|
||||||
? options.discoverySplashURL || urlToBase64(options.discoverySplashURL!)
|
? options.discoverySplashURL && urlToBase64(options.discoverySplashURL)
|
||||||
: options.discoverySplashHash || Util.iconBigintToHash(options.discoverySplashHash!),
|
: options.discoverySplashHash && Util.iconBigintToHash(options.discoverySplashHash),
|
||||||
owner_id: options.ownerId,
|
owner_id: options.ownerId,
|
||||||
rules_channel_id: options.rulesChannelId,
|
rules_channel_id: options.rulesChannelId,
|
||||||
public_updates_channel_id: options.publicUpdatesChannelId,
|
public_updates_channel_id: options.publicUpdatesChannelId,
|
||||||
|
@ -133,11 +133,11 @@ export abstract class BaseInteraction implements Model {
|
|||||||
embeds: options.embeds,
|
embeds: options.embeds,
|
||||||
file: options.files,
|
file: options.files,
|
||||||
components: options.components,
|
components: options.components,
|
||||||
allowed_mentions: options.allowedMentions || {
|
allowed_mentions: options.allowedMentions && {
|
||||||
parse: options.allowedMentions!.parse,
|
parse: options.allowedMentions.parse,
|
||||||
replied_user: options.allowedMentions!.repliedUser,
|
replied_user: options.allowedMentions.repliedUser,
|
||||||
users: options.allowedMentions!.users,
|
users: options.allowedMentions.users,
|
||||||
roles: options.allowedMentions!.roles,
|
roles: options.allowedMentions.roles,
|
||||||
},
|
},
|
||||||
attachments: options.attachments?.map((attachment) => {
|
attachments: options.attachments?.map((attachment) => {
|
||||||
return {
|
return {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user