This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function arr(x: any) { | |
return Array.from(x); | |
} | |
function num(x: any) { | |
return Number(x) || 0; | |
} | |
function str(x: any) { | |
return String(x); | |
} | |
function isEmpty(xs: any) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export async function api( | |
url: string, | |
type: 'json' | 'text' | 'buffer' = 'json' | |
) { | |
const a = await fetch(url); | |
switch (type) { | |
case 'buffer': | |
return await a.arrayBuffer(); | |
case 'text': | |
return await a.text(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
no :) | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const colorStrings: Record<string, string> = { | |
aliceblue: '#f0f8ff', | |
antiquewhite: '#faebd7', | |
aqua: '#00ffff', | |
aquamarine: '#7fffd4', | |
azure: '#f0ffff', | |
beige: '#f5f5dc', | |
bisque: '#ffe4c4', | |
black: '#000000', | |
blanchedalmond: '#ffebcd', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function getKeyDepth(key: string, object: object) { | |
const keyLine = JSON.stringify(object, null, 1) | |
.split("\n") | |
.find((v) => v.includes(key)); | |
if (!keyLine) return undefined; | |
const spaces = keyLine.match(/^ +/); | |
if (!spaces) return 0 | |
return spaces[0].length | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class FunctionMap<T> { | |
private items: Array<() => T>; | |
private self: typeof FunctionMap = FunctionMap; | |
constructor(items: Array<[string, T]>) { | |
this.items = items.map(([k, v]) => this.self.toFunction(k, v)); | |
} | |
static toFunction<T>(key: string, value: T) { | |
const wrap = { | |
[key]: () => value | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as config from '../modules/config'; | |
const content = "sex!" | |
const group = config.CLIENT.INTERACTION_COMMANDS; | |
const subreddit_storage = new pylon.KVNamespace('subreddits'); | |
let subreddits = []; | |
let firstTime = true; | |
const interval = config.REDDIT.INTERVAL; | |
const channel_id = config.CHANNEL.REDDIT; | |
const REDDIT_COMMAND = config.CLIENT.INTERACTION_COMMANDS; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Constructor<U extends Array<unknown>> = new (...args: U) => unknown; | |
type Keys<T, M = any> = keyof { | |
[P in keyof T as T[P] extends M ? P : never]: T[P]; | |
}; | |
export class Ops<T = {}> { | |
public mem: T = {} as never; | |
public define<K extends string, U>( | |
key: K, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* eslint-disable @typescript-eslint/ban-types */ | |
export interface Struct<Static, Instance> { | |
self: Static & (new () => Instance); | |
build(): Static & (new () => Instance); | |
impl<U>( | |
builder: (constructor: Static) => U | |
): Struct<Static & ToStatic<Instance, U>, Instance & U>; | |
impl_static<U>( | |
builder: (self: Static & (new () => Instance)) => U | |
): Struct<Static & U, Instance>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bot_autodifficulty_threshold_high 5.0 | |
bot_autodifficulty_threshold_low 5.0 | |
bot_defer_to_human_goals 0 | |
bot_defer_to_human_items 0 | |
bot_difficulty 3 | |
bot_quota 9 | |
bot_allow_grenades 0 | |
sv_auto_adjust_bot_difficulty 0 | |
sv_bots_get_easier_each_win 0 | |
sv_bots_get_harder_after_each_wave 1 |
OlderNewer