Simp-O-Matic

Dumb Discord bot in TS.
git clone git://git.knutsen.co/Simp-O-Matic
Log | Files | Refs | README | LICENSE

commit c234455ae13dd3453ac53962cd81d03aad33ac7b
parent cbc482e46462d5bd37c66a87fd01f58e226566e4
Author: Demonstrandum <moi@knutsen.co>
Date:   Wed, 20 May 2020 23:35:45 +0100

Merge branch 'master' of github.com:Demonstrandum/Simp-O-Matic

Diffstat:
A.DS_Store | 0
Alib/.DS_Store | 0
Mlib/action.ts | 1+
Alib/commands/abbreviate.ts | 4++++
Mlib/default.ts | 10+++++++++-
Mlib/extensions.ts | 4++--
Mlib/main.ts | 4+++-
Aweb/.DS_Store | 0
8 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/.DS_Store b/.DS_Store Binary files differ. diff --git a/lib/.DS_Store b/lib/.DS_Store Binary files differ. diff --git a/lib/action.ts b/lib/action.ts @@ -37,6 +37,7 @@ const ACTIONS: Record<ActionType, Actions> = { "https://i.imgur.com/DdUkVBo.gif", "https://i.imgur.com/EcBew8x.gif", "https://i.imgur.com/0iEZleS.gif", + "https://giant.gfycat.com/GroundedTenderKitten.gif" ], transitiveness: true }, diff --git a/lib/commands/abbreviate.ts b/lib/commands/abbreviate.ts @@ -0,0 +1,4 @@ +export default async (home_scope: HomeScope) => { + const { message, args } = home_scope; + message.channel.send(args.map(w => [...w].find(c => isNaN(c as any)?c.toLowerCase() != c.toUpperCase():c) || '').join('').toUpperCase() + ` (${args.join(' ')})`) +} diff --git a/lib/default.ts b/lib/default.ts @@ -2,10 +2,18 @@ /// and to act as a reference to how the config shall be /// laid out. All fields are accounted for here. -const DEFAULT_GUILD_CONFIG : Types.Config = { +const DEFAULT_GUILD_CONFIG = { main_channel: null, system_channel: null, whitelistchannels: [], + stats : { + actions: { + rape: [] + }, + commands: { + + } + }, pp_sizes: { '541761315887120399': 16, '265958795254038535': 36 diff --git a/lib/extensions.ts b/lib/extensions.ts @@ -7,7 +7,7 @@ declare global { HELP_SOURCE: string, HELP_KEY: string, GIT_URL: string, HELP_MESSAGES: string[], HELP_SECTIONS: string[] , ALL_HELP: string[], - CONFIG: Types.Config, SECRETS: any, KNOWN_COMMANDS: string[], + CONFIG: any, SECRETS: any, KNOWN_COMMANDS: string[], expand_alias: (operator: string, args: string[], message: Message) => string, main: SimpOMatic; }; @@ -65,7 +65,7 @@ declare global { tag: string, permissions: number, lang: 'en' | 'en-us' | 'en-gb', - guilds: { [key: string]: Config } + guilds: { [key: string]: any } }; } diff --git a/lib/main.ts b/lib/main.ts @@ -295,7 +295,9 @@ Would you like to slow down a little?`.squeeze()); } operator = operator.toLowerCase(); console.log('Received command:', [operator, args]); - + CONFIG.stats = CONFIG.stats || {}; + CONFIG.stats.commands = CONFIG.stats.commands || {}; + CONFIG.stats.commands[operator] = ++CONFIG.stats.commands[operator] || 0; const homescope : HomeScope = { // Basic 'home-scope' is passed in. message, args, HELP_SOURCE, HELP_KEY, GIT_URL, diff --git a/web/.DS_Store b/web/.DS_Store Binary files differ.