Update examples and formatting

This commit is contained in:
Nicolás Serna 2022-07-13 21:29:14 -03:00
parent dd026e1774
commit 0e51078f48
8 changed files with 37 additions and 36 deletions

1
.gitignore vendored
View File

@ -12,3 +12,4 @@ npm/
node_modules/ node_modules/
package-lock.json package-lock.json
package.json package.json
bun.lockb

View File

@ -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.1.0", "version": "0.1.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
} }

View File

@ -1,5 +1,8 @@
// TODO: remove and include the library appropriately /**
import { GatewayIntents, Session } from "./deps.ts"; * Bun example
*/
import { GatewayIntents, Session } from "@oasisjs/biscuit";
const token = process.env.TOKEN; const token = process.env.TOKEN;
const intents = GatewayIntents.MessageContent | GatewayIntents.Guilds | GatewayIntents.GuildMessages; const intents = GatewayIntents.MessageContent | GatewayIntents.Guilds | GatewayIntents.GuildMessages;

View File

@ -1,6 +1,6 @@
/** /**
* Deno example * Deno example
*/ */
import "https://deno.land/std@0.146.0/dotenv/load.ts"; import "https://deno.land/std@0.146.0/dotenv/load.ts";
import { GatewayIntents, Session } from "https://x.nest.land/biscuit@0.1.0/mod.ts"; import { GatewayIntents, Session } from "https://x.nest.land/biscuit@0.1.0/mod.ts";

View File

@ -1,2 +0,0 @@
// TODO: remove and include the library appropriately
export * from "../mod.ts";

View File

@ -7,7 +7,7 @@ import * as Routes from "../Routes.ts";
/** /**
* A member that comes from a thread * A member that comes from a thread
* @link https://discord.com/developers/docs/resources/channel#thread-member-object * @link https://discord.com/developers/docs/resources/channel#thread-member-object
* **/ * * */
export class ThreadMember implements Model { export class ThreadMember implements Model {
constructor(session: Session, data: DiscordThreadMember) { constructor(session: Session, data: DiscordThreadMember) {
this.session = session; this.session = session;

View File

@ -691,9 +691,8 @@ export class Guild extends BaseGuild implements Model {
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.splashHash || 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!),

View File

@ -1237,7 +1237,7 @@ export type CamelCase<S extends string> = S extends `${infer P1}_${infer P2}${in
: Lowercase<S>; : Lowercase<S>;
export type Camelize<T> = { export type Camelize<T> = {
[K in keyof T as CamelCase<string & K>]: T[K] extends Array<infer U> ? U extends {} ? Array<Camelize<U>> [K in keyof T as CamelCase<string & K>]: T[K] extends Array<infer U> ? U extends {} ? Array<Camelize<U>>
: T[K] : T[K]
: T[K] extends {} ? Camelize<T[K]> : T[K] extends {} ? Camelize<T[K]>
: never; : never;
}; };