Skip to content

Commit

Permalink
rm unnecessary typing
Browse files Browse the repository at this point in the history
  • Loading branch information
Geczy committed Oct 9, 2023
1 parent 64ced55 commit fe7251a
Show file tree
Hide file tree
Showing 19 changed files with 38 additions and 45 deletions.
1 change: 1 addition & 0 deletions packages/dota/src/twitch/commandLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import './commands/lg.js'
import './commands/lgs.js'
import './commands/locale.js'
import './commands/match.js'
import './commands/mute.js'
import './commands/mmr.js'
import './commands/mmr=.js'
import './commands/modsonly.js'
Expand Down
4 changes: 2 additions & 2 deletions packages/dota/src/twitch/commands/apm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import { t } from 'i18next'

import { getHeroNameOrColor } from '../../dota/lib/heroes.js'
import { chatClient } from '../chatClient.js'
import commandHandler, { MessageType } from '../lib/CommandHandler.js'
import commandHandler from '../lib/CommandHandler.js'
import { profileLink } from './profileLink.js'

commandHandler.registerCommand('apm', {
onlyOnline: true,
dbkey: DBSettings.commandAPM,
handler: async (message: MessageType, args: string[], command) => {
handler: async (message, args, command) => {
const {
channel: { name: channel, client },
} = message
Expand Down
4 changes: 2 additions & 2 deletions packages/dota/src/twitch/commands/avg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import { t } from 'i18next'
import { calculateAvg } from '../../dota/lib/calculateAvg.js'
import { getAccountsFromMatch } from '../../dota/lib/getAccountsFromMatch.js'
import { chatClient } from '../chatClient.js'
import commandHandler, { MessageType } from '../lib/CommandHandler.js'
import commandHandler from '../lib/CommandHandler.js'

commandHandler.registerCommand('avg', {
onlyOnline: true,
dbkey: DBSettings.commandAvg,
handler: async (message: MessageType, args: string[]) => {
handler: async (message, args) => {
const {
channel: { client },
} = message
Expand Down
4 changes: 2 additions & 2 deletions packages/dota/src/twitch/commands/count.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import { t } from 'i18next'
import { server } from '../../dota/index.js'
import { gsiHandlers } from '../../dota/lib/consts.js'
import { chatClient } from '../chatClient.js'
import commandHandler, { MessageType } from '../lib/CommandHandler.js'
import commandHandler from '../lib/CommandHandler.js'

commandHandler.registerCommand('count', {
handler: async (message: MessageType, args: string[]) => {
handler: async (message, args) => {
const sockets = (await server.io.fetchSockets()).length
const gsiSize = gsiHandlers.size

Expand Down
4 changes: 2 additions & 2 deletions packages/dota/src/twitch/commands/d2pt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ import { t } from 'i18next'

import { getHeroNameOrColor } from '../../dota/lib/heroes.js'
import { chatClient } from '../chatClient.js'
import commandHandler, { MessageType } from '../lib/CommandHandler.js'
import commandHandler from '../lib/CommandHandler.js'
import { findAccountFromCmd } from '../lib/findGSIByAccountId.js'

commandHandler.registerCommand('d2pt', {
aliases: ['dota2pt', 'build', 'builds', 'getbuild'],
onlyOnline: true,
dbkey: DBSettings.commandBuilds,
handler: async (message: MessageType, args: string[], command) => {
handler: async (message, args, command) => {
const {
channel: { name: channel, client },
} = message
Expand Down
4 changes: 2 additions & 2 deletions packages/dota/src/twitch/commands/fixdbl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { t } from 'i18next'
import supabase from '../../db/supabase.js'
import { updateMmr } from '../../dota/lib/updateMmr.js'
import { chatClient } from '../chatClient.js'
import commandHandler, { MessageType } from '../lib/CommandHandler.js'
import commandHandler from '../lib/CommandHandler.js'

interface DoubledownMmr {
currentMmr: number
Expand All @@ -21,7 +21,7 @@ commandHandler.registerCommand('fixdbl', {
aliases: ['fixdd'],
permission: 2,
cooldown: 0,
handler: async (message: MessageType, args: string[]) => {
handler: async (message, args) => {
const { data } = await supabase
.from('bets')
.select('matchId, won, is_party, id, is_doubledown')
Expand Down
4 changes: 2 additions & 2 deletions packages/dota/src/twitch/commands/fixparty.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { t } from 'i18next'
import supabase from '../../db/supabase.js'
import { updateMmr } from '../../dota/lib/updateMmr.js'
import { chatClient } from '../chatClient.js'
import commandHandler, { MessageType } from '../lib/CommandHandler.js'
import commandHandler from '../lib/CommandHandler.js'

interface PartyMmr {
currentMmr: number
Expand All @@ -23,7 +23,7 @@ commandHandler.registerCommand('fixparty', {
aliases: ['fixsolo'],
permission: 2,
cooldown: 0,
handler: async (message: MessageType, args: string[]) => {
handler: async (message, args) => {
const { data } = await supabase
.from('bets')
.select('matchId, won, is_party, id, is_doubledown')
Expand Down
4 changes: 2 additions & 2 deletions packages/dota/src/twitch/commands/gm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import { t } from 'i18next'
import { getAccountsFromMatch } from '../../dota/lib/getAccountsFromMatch.js'
import { gameMedals } from '../../steam/medals.js'
import { chatClient } from '../chatClient.js'
import commandHandler, { MessageType } from '../lib/CommandHandler.js'
import commandHandler from '../lib/CommandHandler.js'

commandHandler.registerCommand('gm', {
aliases: ['medals', 'ranks'],
onlyOnline: true,
dbkey: DBSettings.commandGM,
handler: async (message: MessageType, args: string[]) => {
handler: async (message, args) => {
const {
channel: { client },
} = message
Expand Down
4 changes: 2 additions & 2 deletions packages/dota/src/twitch/commands/gpm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import { t } from 'i18next'

import { getHeroNameOrColor } from '../../dota/lib/heroes.js'
import { chatClient } from '../chatClient.js'
import commandHandler, { MessageType } from '../lib/CommandHandler.js'
import commandHandler from '../lib/CommandHandler.js'
import { findAccountFromCmd } from '../lib/findGSIByAccountId.js'

commandHandler.registerCommand('gpm', {
onlyOnline: true,
dbkey: DBSettings.commandGPM,
handler: async (message: MessageType, args: string[], command) => {
handler: async (message, args, command) => {
const {
channel: { name: channel, client },
} = message
Expand Down
4 changes: 2 additions & 2 deletions packages/dota/src/twitch/commands/lg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import { t } from 'i18next'
import { getAccountsFromMatch } from '../../dota/lib/getAccountsFromMatch.js'
import lastgame from '../../steam/lastgame.js'
import { chatClient } from '../chatClient.js'
import commandHandler, { MessageType } from '../lib/CommandHandler.js'
import commandHandler from '../lib/CommandHandler.js'

commandHandler.registerCommand('lg', {
aliases: ['lastgame'],
onlyOnline: true,
dbkey: DBSettings.commandLG,
handler: async (message: MessageType, args: string[]) => {
handler: async (message, args) => {
const {
channel: { client },
} = message
Expand Down
4 changes: 2 additions & 2 deletions packages/dota/src/twitch/commands/lgs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import { t } from 'i18next'
import supabase from '../../db/supabase.js'
import getHero, { HeroNames } from '../../dota/lib/getHero.js'
import { chatClient } from '../chatClient.js'
import commandHandler, { MessageType } from '../lib/CommandHandler.js'
import commandHandler from '../lib/CommandHandler.js'

commandHandler.registerCommand('lgs', {
aliases: ['lastgamescore', 'lgscore', 'lgwl'],
dbkey: DBSettings.commandLGS,
handler: async (message: MessageType, args: string[]) => {
handler: async (message, args) => {
if (!message.channel.client.steam32Id) {
chatClient.say(
message.channel.name,
Expand Down
4 changes: 2 additions & 2 deletions packages/dota/src/twitch/commands/np.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ import MongoDBSingleton from '../../steam/MongoDBSingleton.js'
import { notablePlayers } from '../../steam/notableplayers.js'
import { logger } from '../../utils/logger.js'
import { chatClient } from '../chatClient.js'
import commandHandler, { MessageType } from '../lib/CommandHandler.js'
import commandHandler from '../lib/CommandHandler.js'

commandHandler.registerCommand('np', {
aliases: ['players', 'who'],
onlyOnline: true,
dbkey: DBSettings.commandNP,
handler: async (message: MessageType, args: string[]) => {
handler: async (message, args) => {
const [addOrRemove, forSteam32Id, ...name] = args
const {
user: { name: chatterName },
Expand Down
4 changes: 2 additions & 2 deletions packages/dota/src/twitch/commands/ranked.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ import { isSpectator } from '../../dota/lib/isSpectator.js'
import MongoDBSingleton from '../../steam/MongoDBSingleton.js'
import { DelayedGames } from '../../types.js'
import { chatClient } from '../chatClient.js'
import commandHandler, { MessageType } from '../lib/CommandHandler.js'
import commandHandler from '../lib/CommandHandler.js'

commandHandler.registerCommand('ranked', {
aliases: ['isranked'],
onlyOnline: true,
dbkey: DBSettings.commandRanked,
handler: async (message: MessageType, args: string[]) => {
handler: async (message, args) => {
const {
channel: { name: channel, client },
} = message
Expand Down
4 changes: 2 additions & 2 deletions packages/dota/src/twitch/commands/roshan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ import {
import { generateRoshanMessage, RoshRes } from '../../dota/events/gsi-events/event.roshan_killed.js'
import { isPlayingMatch } from '../../dota/lib/isPlayingMatch.js'
import { chatClient } from '../chatClient.js'
import commandHandler, { MessageType } from '../lib/CommandHandler.js'
import commandHandler from '../lib/CommandHandler.js'

commandHandler.registerCommand('roshan', {
onlyOnline: true,
aliases: ['rosh', 'aegis'],
dbkey: DBSettings.commandRosh,
handler: async (message: MessageType, args: string[]) => {
handler: async (message, args) => {
const {
channel: { name: channel, client },
} = message
Expand Down
4 changes: 2 additions & 2 deletions packages/dota/src/twitch/commands/setdelay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import { t } from 'i18next'

import supabase from '../../db/supabase.js'
import { chatClient } from '../chatClient.js'
import commandHandler, { MessageType } from '../lib/CommandHandler.js'
import commandHandler from '../lib/CommandHandler.js'

commandHandler.registerCommand('setdelay', {
aliases: ['delay=', 'setstreamdelay', 'streamdelay='],
permission: 2,
cooldown: 0,
handler: async (message: MessageType, args: string[]) => {
handler: async (message, args) => {
if (isNaN(Number(args[0]))) {
chatClient.say(
message.channel.name,
Expand Down
4 changes: 2 additions & 2 deletions packages/dota/src/twitch/commands/smurfs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import { t } from 'i18next'
import { getAccountsFromMatch } from '../../dota/lib/getAccountsFromMatch.js'
import { smurfs } from '../../steam/smurfs.js'
import { chatClient } from '../chatClient.js'
import commandHandler, { MessageType } from '../lib/CommandHandler.js'
import commandHandler from '../lib/CommandHandler.js'

commandHandler.registerCommand('smurfs', {
aliases: ['lifetimes', 'totals', 'games', 'smurf'],
onlyOnline: true,
dbkey: DBSettings.commandSmurfs,
handler: async (message: MessageType, args: string[]) => {
handler: async (message, args) => {
const {
channel: { client },
} = message
Expand Down
4 changes: 2 additions & 2 deletions packages/dota/src/twitch/commands/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ import { steamSocket } from '../../steam/ws.js'
import { DelayedGames } from '../../types.js'
import { logger } from '../../utils/logger.js'
import { chatClient } from '../chatClient.js'
import commandHandler, { MessageType } from '../lib/CommandHandler.js'
import commandHandler from '../lib/CommandHandler.js'

commandHandler.registerCommand('test', {
permission: 4, // Only admin is 4, not even streamer

handler: async (message: MessageType, args: string[]) => {
handler: async (message, args) => {
const {
channel: { name: channel, client },
} = message
Expand Down
4 changes: 2 additions & 2 deletions packages/dota/src/twitch/commands/xpm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import { t } from 'i18next'

import { getHeroNameOrColor } from '../../dota/lib/heroes.js'
import { chatClient } from '../chatClient.js'
import commandHandler, { MessageType } from '../lib/CommandHandler.js'
import commandHandler from '../lib/CommandHandler.js'
import { findAccountFromCmd } from '../lib/findGSIByAccountId.js'

commandHandler.registerCommand('xpm', {
onlyOnline: true,
dbkey: DBSettings.commandXPM,
handler: async (message: MessageType, args: string[], command) => {
handler: async (message, args, command) => {
const {
channel: { name: channel, client },
} = message
Expand Down
14 changes: 3 additions & 11 deletions packages/dota/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,10 @@
/* Basic Options */
"outDir": "dist",
"rootDir": "src",
"types": [
"jest",
"node"
],
"types": ["jest", "node"]
},
"include": [
"src/**/*",
"./.eslintrc.js"
],
"exclude": [
"node_modules",
],
"include": ["src/**/*", "./.eslintrc.js"],
"exclude": ["node_modules"],
"ts-node": {
"transpileOnly": true,
"typeCheck": false
Expand Down

0 comments on commit fe7251a

Please sign in to comment.