repo_name stringlengths 5 122 | path stringlengths 3 232 | text stringlengths 6 1.05M |
|---|---|---|
balovbohdan/fwd-ann | dist/lib/teacher/types.d.ts | <reponame>balovbohdan/fwd-ann
import { ANN } from '../ann';
import { Signals } from '../signals';
export declare type Result = {
ann: ANN;
log: Log;
};
export declare type Log = Array<{
epoch: number;
cycle: number;
RootMSE: number;
}>;
export declare type PreparedParams = {
epoches: number;
};
... |
balovbohdan/fwd-ann | src/lib/units/utils.ts | <filename>src/lib/units/utils.ts
import { Data as LayerDataRaw } from './create';
export const calcUnitsQtyInRawLayerData = ({ unitsData }:LayerDataRaw):number =>
unitsData.reduce((totalQty, { qty }) => totalQty + qty, 0);
|
balovbohdan/fwd-ann | src/utils/object-utils.ts | export const clone = <T extends object>(obj:T):T =>
JSON.parse(JSON.stringify(obj));
export const assignDeep = <T extends object>(target:object, source:object, concatArrays:boolean = false):T => {
const res = {};
const isObject = obj => obj && typeof obj === 'object';
if (!isObject(target) || !isObjec... |
balovbohdan/fwd-ann | src/lib/signals/SignalsErrors.ts | import { Matrix } from 'matrix-calculus';
export class SignalsErrors {
constructor(errors:Matrix) {
this.errors = errors;
}
getMatrix():Matrix {
return this.errors;
}
getSum():number {
return this.errors.getUnitsSum();
}
private readonly errors:Matrix;
}
|
balovbohdan/fwd-ann | dist/lib/calculators/output-errors/types.d.ts | import { SignalsErrors } from '../../signals';
export declare type OutputErrors = {
errors: SignalsErrors | null;
};
|
balovbohdan/fwd-ann | src/lib/weights/layers-pair-weights/index.ts | export { Weights } from './Weights';
|
balovbohdan/fwd-ann | src/lib/calculators/back-error-propagation/calc-delta-weights.ts | // https://docs.google.com/document/d/1DSlzdK0LM1GqxDPES9GFLvuniNYoJNe5kEUfMS4FWsM
import { Matrix } from 'matrix-calculus';
import { ANN } from '../../ann';
import calcDelta from './calc-delta';
import { LayersPair } from '../../layers/types';
import { Signals, SignalsErrors } from '../../signals';
type Data = {
... |
balovbohdan/fwd-ann | dist/utils/math-utils/number-capacity.d.ts | export declare const getCapacity: (n: number) => number;
export declare const getCapacityBase: (capacity: number) => number;
export declare const getNumberByCapacity: (capacity: number) => number;
export declare const getBaseCapacityNumber: (n: number) => number;
export declare const sign: (n: number) => number;
|
balovbohdan/fwd-ann | dist/lib/weights/layers-pairs-weights/rnd/create-rnd-layers-weights.d.ts | import { LayersWeights } from '../LayersWeights';
import { Params as RndWeightsParams } from '../../layers-pair-weights/rnd/create-rnd-weights';
export declare type Params = Array<RndWeightsParams>;
declare const createRndLayersWeights: (params: RndWeightsParams[]) => LayersWeights;
export default createRndLayersWeight... |
balovbohdan/fwd-ann | dist/lib/units/utils.d.ts | import { Data as LayerDataRaw } from './create';
export declare const calcUnitsQtyInRawLayerData: ({ unitsData }: LayerDataRaw) => number;
|
balovbohdan/fwd-ann | dist/lib/activation-funcs/utils.d.ts | import { ActivationFunction } from './types';
export declare const getByName: (name: string) => ActivationFunction | null;
|
balovbohdan/fwd-ann | src/lib/ann/ANN.ts | import * as T from './types';
import {Layers} from '../layers';
import config from '../../config';
import { Signals } from '../signals';
import { assignDeep } from '../../utils/object-utils';
import { decimal } from '../../utils/math-utils/random-number';
import { LayersWeights } from '../weights/layers-pairs-weights';... |
balovbohdan/fwd-ann | dist/utils/math-utils/arithmetic-average.d.ts | declare type Calculator = (numbers: Array<number>) => number;
export declare const simple: (values: number[]) => number;
export declare const crossed: (left: number[], right: number[], calc?: Calculator | undefined) => number[];
export {};
|
balovbohdan/fwd-ann | src/lib/calculators/ann-output/calc-ann-output.ts | import { ANN } from '../../ann';
import { Signals } from '../../signals';
import calcLayersPair from './calc-layers-pair';
export type Res = {
output:Signals;
layersInputs:Array<Signals>;
layersOutputs:Array<Signals>;
};
type Data = {
ann:ANN;
signals:Signals;
};
const prepareAnnOutput = (ann:ANN... |
balovbohdan/fwd-ann | dist/lib/calculators/ann-output/weights-to-signals.d.ts | <reponame>balovbohdan/fwd-ann<filename>dist/lib/calculators/ann-output/weights-to-signals.d.ts
import { Signals } from '../../signals';
import { Weights } from '../../weights/layers-pair-weights';
declare type Data = {
weights: Weights;
signals: Signals;
};
declare const weightsToSignals: (data: Data) => Signal... |
balovbohdan/fwd-ann | dist/lib/layers/Layers.d.ts | import * as T from './types';
import { Units } from '../units';
export declare class Layers {
constructor(layers: T.LayersData);
getOutputLayer(): Units | never;
getQty(): number;
getAll(): T.LayersData;
getPairs(): Array<T.LayersPair>;
forEach(f: (layer: Units, i?: number, arr?: T.LayersData) =... |
balovbohdan/fwd-ann | src/utils/math-utils/numbers-collection-alias.ts | // Encodes/decodes collection of positive numbers (n > 0) to integer alias.
import { clone } from '../object-utils';
export const encode = (numbers:Array<number>):number => {
const numbersPrepared = clone(numbers)
.filter(n => n > 0)
.sort();
const maxNumber:number = Math.max.apply(Math, numb... |
balovbohdan/fwd-ann | dist/lib/weights/layers-pairs-weights/create.d.ts | import { LayersWeights } from './LayersWeights';
declare const create: (data: number[][][]) => LayersWeights;
export default create;
|
balovbohdan/fwd-ann | src/lib/weights/layers-pair-weights/Weights.ts | import { Matrix } from 'matrix-calculus';
export class Weights {
constructor(weights:Matrix) {
this.weights = weights;
}
getMatrix():Matrix {
return this.weights;
}
private readonly weights:Matrix;
}
|
balovbohdan/fwd-ann | src/lib/weights/layers-pairs-weights/types.ts | <filename>src/lib/weights/layers-pairs-weights/types.ts<gh_stars>0
import { Weights } from '../layers-pair-weights';
export type Data = Array<Weights>;
export type DirtyData = Array<Array<Array<number>>>;
|
balovbohdan/fwd-ann | src/lib/calculators/back-error-propagation/calc-delta.ts | <filename>src/lib/calculators/back-error-propagation/calc-delta.ts
// https://docs.google.com/document/d/1DSlzdK0LM1GqxDPES9GFLvuniNYoJNe5kEUfMS4FWsM
import { Matrix } from 'matrix-calculus';
import { T } from '../../layers';
import calcTheta from './calc-theta';
import { Signals, SignalsErrors } from '../../signals'... |
balovbohdan/fwd-ann | dist/lib/layers/LayerName.d.ts | <gh_stars>0
export declare class LayerName {
static readonly LAYER = "Layer";
static readonly INPUT = "InputLayer";
static readonly OUTPUT = "OutputLayer";
static readonly HIDDEN = "HiddenLayer";
}
|
balovbohdan/fwd-ann | src/lib/units/create.ts | import * as T from './types';
import { Unit } from './Unit';
import { Units } from './Units';
import {LayerType} from '../layers';
import { ActivationFunction } from '../activation-funcs';
export type SingleData = {
qty:number;
names?:Array<string>;
ActivationFunction:ActivationFunction;
};
export type D... |
balovbohdan/fwd-ann | dist/lib/weights/layers-pairs-weights/rnd/create-params.d.ts | <filename>dist/lib/weights/layers-pairs-weights/rnd/create-params.d.ts
import { Params as RandomWeightParam } from '../../layers-pair-weights/rnd/create-rnd-weight';
import { LayersRawData } from '../../../layers/types';
export declare type Data = {
layersData: LayersRawData;
randomWeightParams?: Array<RandomWe... |
balovbohdan/fwd-ann | dist/lib/activation-funcs/activation-funcs.d.ts | <gh_stars>0
import { ActivationFunction } from './types';
export declare const Areasinus: ActivationFunction;
export declare const BinaryStep: ActivationFunction;
export declare const ReLU: ActivationFunction;
export declare const Logistic: ActivationFunction;
export declare const HyperbolicTangent: ActivationFunction;... |
balovbohdan/fwd-ann | src/lib/weights/layers-pairs-weights/rnd/create-rnd-layers-weights-from-layers-raw-data.ts | <reponame>balovbohdan/fwd-ann<filename>src/lib/weights/layers-pairs-weights/rnd/create-rnd-layers-weights-from-layers-raw-data.ts
import { T as TLayers } from '../../../layers';
import { LayersWeights } from '../LayersWeights';
import { calcUnitsQtyInRawLayerData } from '../../../units/utils';
import createRndLayersWei... |
balovbohdan/fwd-ann | dist/lib/units/create.d.ts | import { Units } from './Units';
import { LayerType } from '../layers';
import { ActivationFunction } from '../activation-funcs';
export declare type SingleData = {
qty: number;
names?: Array<string>;
ActivationFunction: ActivationFunction;
};
export declare type Data = {
name?: string;
type: LayerT... |
balovbohdan/fwd-ann | src/lib/calculators/back-error-propagation/calc-layer-output-errors.ts | import { Matrix } from 'matrix-calculus';
import { ANN } from '../../ann';
import { Units } from '../../units';
import { SignalsErrors } from '../../signals';
import { Weights } from '../../weights/layers-pair-weights';
type Data = {
ann:ANN;
aimLayer:Units;
layersPairIndex:number|null;
nextLayerOutpu... |
balovbohdan/fwd-ann | dist/lib/weights/layers-pairs-weights/rnd/create.d.ts | import { LayersWeights } from '../LayersWeights';
import { Data } from './create-params';
declare const create: (data: Data) => LayersWeights;
export default create;
|
balovbohdan/fwd-ann | dist/lib/units/types.d.ts | <gh_stars>0
import { Unit } from './Unit';
import { LayerType } from '../layers';
export declare type UnitsData = Array<Unit>;
export declare type UnitsRaw = {
name?: string;
type: LayerType;
units: UnitsData;
};
|
balovbohdan/fwd-ann | dist/utils/math-utils/random-number.d.ts | declare type FloatingParams = {
min?: number;
max?: number;
exclude?: Array<number>;
};
declare type DecimalParameterizedParams = {
min?: number;
max?: number;
exclude?: Array<number>;
};
export declare const decimal: () => number;
export declare const sign: () => 1 | -1;
export declare const de... |
balovbohdan/fwd-ann | dist/lib/signals/normalize.d.ts | <gh_stars>0
import { Signals } from './Signals';
import { Mutator } from './mutators';
declare const normalize: (signals: Signals, mutator?: Mutator | null) => Signals;
export default normalize;
|
balovbohdan/fwd-ann | dist/lib/ann/types.d.ts | <gh_stars>0
import { Layers } from '../layers';
import { Mutator } from '../signals';
import { LayersWeights } from '../weights/layers-pairs-weights';
import { Res as AnnOutputCalculatorRes } from '../calculators/ann-output/calc-ann-output';
export declare type ComplexOutput = AnnOutputCalculatorRes;
export declare typ... |
balovbohdan/fwd-ann | dist/lib/weights/layers-pairs-weights/types.d.ts | import { Weights } from '../layers-pair-weights';
export declare type Data = Array<Weights>;
export declare type DirtyData = Array<Array<Array<number>>>;
|
balovbohdan/fwd-ann | src/lib/weights/layers-pairs-weights/utils.ts | <gh_stars>0
import { Matrix } from 'matrix-calculus';
import { LayersWeights } from './LayersWeights';
import { Weights } from '../layers-pair-weights';
export const isIdentical = async (left:LayersWeights, right:LayersWeights):Promise<boolean> => {
const leftStr = JSON.stringify(left.getAllDirty());
const ri... |
balovbohdan/fwd-ann | src/lib/weights/layers-pairs-weights/rnd/create.ts | import { LayersWeights } from '../LayersWeights';
import createParams, { Data } from './create-params';
import createRndLayersWeights from './create-rnd-layers-weights';
const create = (data:Data):LayersWeights => {
const params = createParams(data);
return createRndLayersWeights(params);
};
export default c... |
balovbohdan/fwd-ann | dist/lib/weights/layers-pair-weights/rnd/create-weights-params.d.ts | import { Params as Res } from './create-rnd-weights';
import { Data as LayerData } from '../../../units/create';
import { Params as RndWeightParams } from './create-rnd-weight';
declare type Data = {
leftLayerData: LayerData;
rightLayerData: LayerData;
randomWeightParams?: RndWeightParams;
};
declare const ... |
balovbohdan/fwd-ann | src/lib/activation-funcs/activation-funcs.ts | <reponame>balovbohdan/fwd-ann<filename>src/lib/activation-funcs/activation-funcs.ts
import { Matrix } from 'matrix-calculus';
import { funcs } from 'math-funcs-calculus';
import { ActivationFunction } from './types';
export const Areasinus:ActivationFunction = {
func: funcs.Areasinus,
calc: funcs.Areasinus.ca... |
balovbohdan/fwd-ann | dist/lib/signals/SignalsErrors.d.ts | import { Matrix } from 'matrix-calculus';
export declare class SignalsErrors {
constructor(errors: Matrix);
getMatrix(): Matrix;
getSum(): number;
private readonly errors;
}
|
balovbohdan/fwd-ann | src/lib/activation-funcs/utils.ts | import { ActivationFunction } from './types';
import * as activationFuncs from './activation-funcs';
export const getByName = (name:string):ActivationFunction|null =>
activationFuncs[name] || null;
|
balovbohdan/fwd-ann | dist/lib/weights/layers-pairs-weights/LayersWeights.d.ts | <reponame>balovbohdan/fwd-ann
import * as T from './types';
import { Weights } from '../layers-pair-weights';
export declare class LayersWeights {
constructor(layersWeights: T.Data);
get(layersPairIndex: number | null): Weights | null;
getAllDirty(): T.DirtyData;
getAll(): Array<Weights>;
private re... |
balovbohdan/fwd-ann | dist/lib/units/Unit.d.ts | import { ActivationFunction } from '../activation-funcs';
declare type Params = {
name?: string;
ActivationFunction: ActivationFunction;
};
export declare class Unit {
constructor(params: Params);
getName(): string;
getActivationFunction(): ActivationFunction;
private readonly name;
private ... |
balovbohdan/fwd-ann | dist/lib/activation-funcs/types.d.ts | <gh_stars>0
import { Matrix } from 'matrix-calculus';
export declare type ActivationFunction = {
func: Func;
calc: (n: number) => number;
calcComplexDerivative: (matrix: Matrix) => Matrix;
};
declare type Func = {
calc: (n: number) => number;
};
export {};
|
balovbohdan/fwd-ann | src/lib/weights/layers-pair-weights/rnd/create-weights-params.ts | <reponame>balovbohdan/fwd-ann
import { Params as Res } from './create-rnd-weights';
import { Data as LayerData } from '../../../units/create';
import { assignDeep } from '../../../../utils/object-utils';
import { Params as RndWeightParams } from './create-rnd-weight';
type Data = {
leftLayerData:LayerData;
rig... |
balovbohdan/fwd-ann | src/lib/units/Unit.ts | <gh_stars>0
import { ActivationFunction } from '../activation-funcs';
import { decimal } from '../../utils/math-utils/random-number';
type Params = {
name?:string;
ActivationFunction:ActivationFunction;
};
export class Unit {
constructor(params:Params) {
this.name = params.name || ('Unit-' + decim... |
YourBetterAssistant/yourbetterassistant | commands/Music/leave.ts | <reponame>YourBetterAssistant/yourbetterassistant<gh_stars>0
"use strict";
import { Client, Message } from "discord.js";
module.exports = {
name: "leave",
description: "Leaves a voice channel",
category: "Music",
memberpermissions: ["CONNECT", "SPEAK"],
adminPermOverride: true,
cooldown: 2,
usage: "leav... |
YourBetterAssistant/yourbetterassistant | commands/Economy/deposit.ts | "use strict";
import Discord, { Client, Message } from "discord.js";
import money from "../../Constructors/economy";
const currency = new money();
import { reply } from "../../exports";
module.exports = {
name: "deposit",
aliases: ["dep"],
description: "deposits YMCs to the bank",
category: "Economy",
guildO... |
YourBetterAssistant/yourbetterassistant | lib/logger.ts | import chalk from "chalk";
export default class Logger {
private defaultFormat: string;
private errorFormat: string;
private infoFormat: string;
private warnFormat: string;
constructor(private command: string) {
this.defaultFormat = `${chalk.blue(`[%commandname]`)} - ${chalk.green(
"%message"
)}... |
YourBetterAssistant/yourbetterassistant | Schemas/onJoin.ts | "use strict";
import mongoose from "mongoose";
const joinroles = new mongoose.Schema({
guildId: {
type: String,
required: true,
unique: true,
},
roleId: {
type: String,
required: true,
},
});
export default mongoose.model<Ijoinroles>("joinroles", joinroles);
interface Ijoinroles extends mo... |
YourBetterAssistant/yourbetterassistant | Utils/count.ts | import countSchema from "../Schemas/countSchema";
import mongo from "../botconfig/mongo";
import { Message } from "discord.js";
async function count(message: Message) {
try {
await mongo().then(async () => {
let countInfo = await countSchema.findOne({ _id: message.guild?.id });
if (countInfo) {
... |
YourBetterAssistant/yourbetterassistant | Schemas/serverConfSchema.ts | <gh_stars>0
"use strict";
import mongoose from "mongoose";
const serverConfSchema = new mongoose.Schema({
_id: {
type: String,
required: true,
},
memberroleID: {
type: String,
required: true,
},
adminroleID: {
type: String,
required: true,
},
ownerroleID: {
type: String,
r... |
YourBetterAssistant/yourbetterassistant | typings/global.d.ts | <reponame>YourBetterAssistant/yourbetterassistant
import { Collection, PermissionResolvable } from "discord.js";
import { Node } from "lavaclient";
module "discord.js" {
export interface Client {
lavalink: Node;
queue: Map<string, any>;
commands: Collection<unknown, command>;
aliases: Collection<unkn... |
YourBetterAssistant/yourbetterassistant | Schemas/workSchema.ts | 'use strict';
import mongoose from 'mongoose';
const workScehma=new mongoose.Schema({
userID: {
type: String,
required: true
},
job: {
type: String,
required: true
}
})
const WorkSchema=mongoose.model<IworkSchema>('workSchema', workScehma)
export default WorkSchema
int... |
YourBetterAssistant/yourbetterassistant | commands/Economy/hire.ts | "use strict";
import { Client, Message, MessageEmbed, MessageFlags } from "discord.js";
import { reply, hiremongo } from "../../exports";
import id from "../../botconfig/id.json";
module.exports = {
name: "hire",
description: "get a job",
category: "Economy",
memberpermissions: "VIEW_CHANNEL",
cooldown: 60 *... |
YourBetterAssistant/yourbetterassistant | commands/Information/support.ts | "use strict";
import { Client, Message } from "discord.js";
import { reply } from "../../exports";
module.exports = {
name: "support",
description: "Sends support server link",
category: "Information",
guildOnly: true,
memberpermissions: "VIEW_CHANNEL",
adminPermOverride: true,
cooldown: 5,
usage: "sup... |
YourBetterAssistant/yourbetterassistant | slash/botinfo.ts | "use strict";
import funcs from "../handlers/functions";
const osinfo = require("@felipebutcher/node-os-info");
import packageJson from "../package.json";
import Discord, { Client, CommandInteraction } from "discord.js";
module.exports = {
name: "botinfo",
description: "Shows Bot Info",
run: async (client: Client... |
YourBetterAssistant/yourbetterassistant | Utils/prefix-load.ts | import { Client } from "discord.js";
import commandPrefixSchema from "../Schemas/prefixSchema";
const cache: { id: string; prefix: string }[] = [];
export async function prefixLoad(
client: Client,
guildPrefixes: { [key: string]: string | undefined },
globalPrefix: string
) {
client.cache = cache;
try {
/... |
YourBetterAssistant/yourbetterassistant | start.ts | <gh_stars>0
require("dotenv").config();
import axios from "axios";
const url: string[] = [];
url.push(process.env.URL);
async function push() {
if (process.env.URL) {
await axios.post(
url[0],
{ content: ">>> Uptime For YourBetterAssistant" },
{ headers: { "Content-Type": "application/json" } }
... |
YourBetterAssistant/yourbetterassistant | commands/Games/chess.ts | <reponame>YourBetterAssistant/yourbetterassistant
"use strict";
import { DiscordTogether } from "discord-together";
import { Client, Message } from "discord.js";
module.exports = {
name: "chess",
description: "Play chess with your buds",
category: "Games",
guildOnly: true,
memberpermissions: "VIEW_CHANNEL",
... |
YourBetterAssistant/yourbetterassistant | events/guild/voiceStateUpdate.ts | import { Client } from "discord.js";
module.exports = async (client: Client, oldState: any, newState: any) => {
const server_queue = client.queue.get(oldState.guild.id);
if (
server_queue &&
newState.id == client.user?.id &&
oldState.channelId &&
!newState.channelId
) {
server_queue?.player.s... |
YourBetterAssistant/yourbetterassistant | commands/Music/play.ts | <filename>commands/Music/play.ts
"use strict";
require("@lavaclient/queue/register");
import { Client, Message, MessageEmbed } from "discord.js";
module.exports = {
name: "play",
description: "plays music",
category: "Music",
memberpermissions: ["CONNECT", "SPEAK"],
cooldown: 5,
usage: "play <song>",
run... |
YourBetterAssistant/yourbetterassistant | commands/levels/rank.ts | <filename>commands/levels/rank.ts
"use strict";
import Levels from "discord-xp";
import Discord, { Client, Message } from "discord.js";
module.exports = {
name: "rank",
description: "Shows the rank of the user",
category: "levels",
guildOnly: true,
memberpermissions: "VIEW_CHANNEL",
cooldown: 2,
usage: "... |
YourBetterAssistant/yourbetterassistant | events/guild/interactionCreate.ts | "use strict";
import rrSchema from "../../Schemas/rrSchema";
import Discord, {
Interaction,
Client,
GuildMemberRoleManager,
} from "discord.js";
module.exports = async (client: Client, interaction: Interaction) => {
if (interaction.isCommand()) {
let cmd = client.interactions.get(interaction.commandName);
... |
YourBetterAssistant/yourbetterassistant | commands/OWNER/servers.ts | <reponame>YourBetterAssistant/yourbetterassistant<gh_stars>0
"use strict";
import { Client, Message, MessageEmbed } from "discord.js";
module.exports = {
name: "servers",
aliases: ["guilds", "list-guilds"],
description: "lists the guild names of all the guilds the bot is in",
category: "OWNER",
memberpermiss... |
YourBetterAssistant/yourbetterassistant | index.ts | //Importing all needed Commands
import Discord from "discord.js"; //this is the official discord.js wrapper for the Discord Api, which we use!
require("dotenv").config();
import { Node } from "lavaclient";
import Logger from "./lib/logger";
require("@weky/inlinereply");
let token = process.env.TOKEN;
import fs from "fs... |
YourBetterAssistant/yourbetterassistant | commands/Fun/snake.ts | <reponame>YourBetterAssistant/yourbetterassistant<filename>commands/Fun/snake.ts
"use strict";
import { Client, Message } from "discord.js";
import { reply } from "../../exports";
module.exports = {
name: "snake",
description: "snake game",
category: "Fun",
memberpermissions: "VIEW_CHANNEL",
cooldown: 5,
... |
YourBetterAssistant/yourbetterassistant | events/guild/messageCreate.ts | <reponame>YourBetterAssistant/yourbetterassistant<filename>events/guild/messageCreate.ts
"use strict";
import Levels from "discord-xp";
import count from "../../Utils/count";
import level from "../../Utils/level";
import check from "../../Utils/checkChatChannel";
import Logger from "../../lib/logger";
import Trainer fr... |
YourBetterAssistant/yourbetterassistant | commands/Economy/leaderboard.ts | "use strict";
import money from "../../Constructors/economy";
import funcs from "../../handlers/functions";
import { Client, GuildMember, Message, MessageEmbed } from "discord.js";
const currency = new money();
module.exports = {
name: "rich",
description: "Currency Leaderboard first q0",
category: "Economy",
... |
YourBetterAssistant/yourbetterassistant | commands/Fun/weather.ts | "use strict";
import Discord, { Client, Message } from "discord.js";
module.exports = {
name: "weather",
description: "Shows the weather of a country",
category: "Fun",
memberpermissions: "VIEW_CHANNEL",
cooldown: 5,
usage: "weather <country>",
run: async (client: Client, message: Message, args: string[]... |
YourBetterAssistant/yourbetterassistant | events/guild/guildMemberAdd.ts | "use strict";
import { Client, GuildMember, TextChannel } from "discord.js";
import welcomeSchema from "../../Schemas/welcomeSchema";
import logSchema from "../../Schemas/logSchema";
import countSchema from "../../Schemas/countSchema";
import joinRoles from "../../Schemas/onJoin";
import mongo from "../../botconfig/mo... |
YourBetterAssistant/yourbetterassistant | events/guild/guildMemberRemove.ts | "use strict";
import { Client, GuildMember, TextChannel } from "discord.js";
import countSchema from "../../Schemas/countSchema";
import Logger from "../../lib/logger";
import logSchema from "../../Schemas/logSchema";
import mongo from "../../botconfig/mongo";
import Discord from "discord.js";
const logger = new Logge... |
YourBetterAssistant/yourbetterassistant | commands/Fun/image.ts | "use strict";
import Discord, { Client, Message } from "discord.js";
import fetch from "node-fetch";
//@ts-check
interface Image_Results {
_type: "Images";
readLink: string;
webSearchUrl: string;
queryContext: Object;
totalEstimatedMatches: number;
nextOffset: number;
currentOffset: number;
value: {
... |
YourBetterAssistant/yourbetterassistant | commands/Information/help.ts | import { Client, Message, MessageEmbed } from "discord.js";
import config from "../../botconfig/config.json";
import ee from "../../botconfig/embed.json";
import Logger from "../../lib/logger";
const logger = new Logger("Commands - Help");
module.exports = {
name: "help",
description: "help command for text command... |
YourBetterAssistant/yourbetterassistant | slash/unmute.ts | <reponame>YourBetterAssistant/yourbetterassistant
import {
Client,
CommandInteraction,
GuildMember,
MessageEmbed,
} from "discord.js";
import serverConfSchema from "../Schemas/serverConfSchema";
const roles: { [key: string]: any } = {};
module.exports = {
name: "unmute",
description: "unmute",
options: [{... |
YourBetterAssistant/yourbetterassistant | commands/Fun/say.ts | "use strict";
import { Client, Message, MessageEmbed } from "discord.js";
import { MessageMentions } from "discord.js";
import ee from "../../botconfig/embed.json";
import Logger from "../../lib/logger";
module.exports = {
name: "say",
category: "Fun",
cooldown: 2,
usage: "say <TEXT>",
description: "Resends ... |
YourBetterAssistant/yourbetterassistant | commands/Economy/daily.ts | <reponame>YourBetterAssistant/yourbetterassistant
"use strict";
import { Client, Message, MessageEmbed } from "discord.js";
import funcs from "../../handlers/functions";
import economySchema from "../../Schemas/economySchema";
module.exports = {
name: "daily",
description: "Get your daily YBCs",
category: "Econ... |
YourBetterAssistant/yourbetterassistant | commands/Information/uptime.ts | "use strict";
import { Client, Message, MessageEmbed } from "discord.js";
import ee from "../../botconfig/embed.json";
import funcs from "../../handlers/functions";
module.exports = {
name: "uptime",
category: "Information",
aliases: [""],
cooldown: 10,
usage: "uptime",
description: "Returns the duration o... |
YourBetterAssistant/yourbetterassistant | commands/Music/join.ts | "use strict";
import { Client, Message } from "discord.js";
module.exports = {
name: "join",
description: "Joins a voice channel",
category: "Music",
guildOnly: true,
memberpermissions: ["CONNECT", "SPEAK"],
cooldown: 5,
usage: "join",
run: async (client: Client, message: Message, args: string[]) => {... |
YourBetterAssistant/yourbetterassistant | Schemas/countSchema.ts | 'use strict';
import mongoose from 'mongoose';
const countSchema=new mongoose.Schema({
_id:{
type:String,
required:true
},
voiceChannelID:{
type:String,
required:true
}
})
export default mongoose.model<IcountSchema>('countSchema', countSchema)
interface IcountSchema e... |
YourBetterAssistant/yourbetterassistant | slash/mute.ts | import {
Client,
CommandInteraction,
GuildMember,
MessageEmbed,
} from "discord.js";
import serverConfSchema from "../Schemas/serverConfSchema";
const roles: {
[key: string]: { admin: string; member: string; owner: string };
} = {};
module.exports = {
name: "mute",
description: "Mute",
options: [
{ ... |
YourBetterAssistant/yourbetterassistant | commands/Information/roleinfo.ts | import { Client, Message, MessageEmbed } from "discord.js";
module.exports = {
name: "roleinfo",
description: "Shows Information About a Role",
category: "Information",
memberpermissions: ["VIEW_CHANNEL"],
cooldown: 2,
usage: "roleinfo <role mentioned or typed>",
run: async (client: Client, message: Mess... |
YourBetterAssistant/yourbetterassistant | commands/Administration/serverconfig.ts | <filename>commands/Administration/serverconfig.ts
"use strict";
import { Client, Message } from "discord.js";
module.exports = {
name: "serverconfig",
description: "DEPRECATED USE WEBSITE",
category: "Administration",
memberpermissions: "MANAGE_GUILD",
run: async (client: Client, message: Message, args: str... |
YourBetterAssistant/yourbetterassistant | typings/enviroment.d.ts | declare namespace NodeJS {
interface ProcessEnv {
TOKEN: string;
URL: string;
TOPGGTOKEN: string;
APISECRET: string;
BINGAPIKEY: string;
}
}
|
YourBetterAssistant/yourbetterassistant | Constructors/economy.ts | import mongo from "../botconfig/mongo";
import economySchema from "../Schemas/economySchema";
import errHandler from "../handlers/errorHandler";
import inventory from "../Schemas/inventory";
import { Message } from "discord.js";
async function createUser(
userID: string,
coins: number,
bank: number,
bs: number
... |
YourBetterAssistant/yourbetterassistant | Schemas/prefixSchema.ts | <filename>Schemas/prefixSchema.ts<gh_stars>0
"use strict";
import mongoose from "mongoose";
const commandPrefixSchema = new mongoose.Schema({
_id: {
type: String,
required: true,
},
prefix: {
type: String,
required: true,
},
});
const PrefixSchema = mongoose.model<IprefixSchema>(
"guild-pref... |
YourBetterAssistant/yourbetterassistant | commands/Economy/bal.ts | "use strict";
import money from "../../Constructors/economy";
import Discord, { Client, Message } from "discord.js";
import { reply } from "../../exports";
const currency = new money();
module.exports = {
name: "bal",
aliases: ["balance"],
description: "shows your balance",
category: "Economy",
memberpermiss... |
YourBetterAssistant/yourbetterassistant | events/client/disconnect.ts | "use strict";
//here the event starts
module.exports = () => {
console.log(`You have been disconnected at ${new Date()}.`.red);
};
/** Template by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template */
|
YourBetterAssistant/yourbetterassistant | Schemas/autoMod.ts | <filename>Schemas/autoMod.ts
'use strict';
import mongoose from 'mongoose';
const automod=new mongoose.Schema({
guildId: {
type: String,
required: true
},
strictMode: {
type: Boolean,
required: true
}
})
export interface IUser extends mongoose.Document {
guildId:strin... |
YourBetterAssistant/yourbetterassistant | commands/Fun/gtn.ts | "use strict";
import { Client, Message } from "discord.js";
import { reply } from "../../exports";
const djsGames = require("djs-games");
module.exports = {
name: "gtn",
aliases: ["guessthenumber"],
description: "guess the number game",
memberpermissions: "VIEW_CHANNEL",
adminPermOverride: true,
cooldown: ... |
YourBetterAssistant/yourbetterassistant | exports.ts | <gh_stars>0
import workSchema from "./Schemas/workSchema";
import mongo from "./botconfig/mongo";
import errHandler from "./handlers/errorHandler";
import { Message } from "discord.js";
/**
* @param content what the message is
* @param mention type in true or false this determines if you are pinging the member or not... |
YourBetterAssistant/yourbetterassistant | slash/clear.ts | import { Client, CommandInteraction } from "discord.js";
module.exports = {
name: "clear",
description: "Mass Clear Messages",
options: [
{
type: 10,
name: "limit",
description: "Number of messages to clear",
required: true,
},
],
run: async (client: Client, interaction: Comma... |
YourBetterAssistant/yourbetterassistant | commands/Fun/mcserver.ts | <reponame>YourBetterAssistant/yourbetterassistant<filename>commands/Fun/mcserver.ts<gh_stars>0
"use strict";
import util from "minecraft-server-util";
import Discord, { Client, Message } from "discord.js";
module.exports = {
name: "mcserver",
aliases: ["miencraft", "server"],
description: "Display stats bout teh... |
YourBetterAssistant/yourbetterassistant | commands/Fun/profilep.ts | "use strict";
import Discord, { Client, Message } from "discord.js";
module.exports = {
name: "profilepic",
category: "Fun",
cooldown: 1,
aliases: ["picture", "av", "avatar"],
usage: "profilepic <username>",
description: "gets the profile pic of the person asked",
run: async (client: Client, message: Mes... |
YourBetterAssistant/yourbetterassistant | slash/vr.ts | "use strict";
import { Client, CommandInteraction, MessageEmbed } from "discord.js";
module.exports = {
name: "vr",
description: "VR",
options: [{ name: "user", description: "user", type: 6 }],
run: async (client: Client, interaction: CommandInteraction) => {
let user = interaction.options.getUser("user");... |
YourBetterAssistant/yourbetterassistant | commands/Information/invitelink.ts | <filename>commands/Information/invitelink.ts
"use strict";
import Discord, { Client, Message } from "discord.js";
module.exports = {
name: "invitelink",
aliases: ["invite", "link"],
description: "sends the invitelink of the bot",
category: "Information",
memberpermissions: "VIEW_CHANNEL",
cooldown: 2,
us... |
YourBetterAssistant/yourbetterassistant | handlers/command.ts | <filename>handlers/command.ts<gh_stars>0
"use strict";
import { Client, Message } from "discord.js";
import color from "chalk";
import { readdirSync } from "fs";
import Table from "cli-table";
import logger from "../lib/logger";
import { command, interaction } from "../typings/global";
const commandtable = new Table()... |
YourBetterAssistant/yourbetterassistant | Schemas/inventory.ts | 'use strict';
import mongoose from 'mongoose';
const inventory=new mongoose.Schema({
userId: {
type: String,
required: true,
},
inventory: {
type: Array,
required: true,
}
})
const Inventory=mongoose.model<Iinventory>('inventory', inventory)
export default Inventory
in... |
YourBetterAssistant/yourbetterassistant | handlers/functions.ts | <reponame>YourBetterAssistant/yourbetterassistant<gh_stars>0
"use strict";
import { GuildMemberManager, Message, User } from "discord.js";
export default {
duration: function (ms: number) {
const sec = Math.floor((ms / 1000) % 60).toString();
const min = Math.floor((ms / (60 * 1000)) % 60).toString();
c... |
YourBetterAssistant/yourbetterassistant | Schemas/logSchema.ts | "use strict";
import mongoose from "mongoose";
const logSchema = new mongoose.Schema({
_id: {
type: String,
required: true,
},
channelID: {
type: String,
required: true,
},
});
export default mongoose.model<IlogSchema>("logschemas", logSchema);
interface IlogSchema extends mongoose.Document {
... |
YourBetterAssistant/yourbetterassistant | commands/levels/leaderboard.ts | "use strict";
import Levels from "discord-xp";
import { Client, Message, MessageEmbed } from "discord.js";
module.exports = {
name: "leaderboard",
description: "Shows the leaderboard",
category: "levels",
guildOnly: true,
memberpermissions: "VIEW_CHANNEL",
cooldown: 2,
usage: "leaderboard",
run: async ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.