Skip to content

Commit

Permalink
Port distort and disable OCR on send by default.
Browse files Browse the repository at this point in the history
  • Loading branch information
retrixe committed Nov 4, 2018
1 parent 9223a53 commit 11f8e92
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
4 changes: 2 additions & 2 deletions components/settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@ mutation variables(
/>
</FormGroup>
<Typography gutterBottom>
{'This option is disabled by default and recognizes text from any image whenever \
an image is sent in any channel and posts the result using /ocr.'}
{'This option recognizes text from any image whenever an image is sent in any \
channel and posts the result using /ocr.'}
</Typography>
<div style={{ height: 10 }} />
<Button size='small'>Cancel</Button>
Expand Down
13 changes: 13 additions & 0 deletions server/bot/commands/games.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,3 +185,16 @@ export const handleCalculate: Command = {
}
}
}

export const handleDistort: Command = {
name: 'distort',
opts: {
description: 'Pretty distorted text.',
fullDescription: 'Pretty distorted text.',
usage: '/distort <text>',
example: '/distort lol'
},
generator: (message, args) => args.map(i => (
i.split('').join('*') + (i.length % 2 === 0 ? '*' : '')
)).join(' ')
}
1 change: 1 addition & 0 deletions server/bot/commands/help.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ let generalHelp = ` ** Jony Ive can do many commands 📡**
\`/8ball\` - Random answers to random questions.
\`/repeat\` - Repeat a string.
\`/calculate\` - Calculate an expression.
\`/distort\` - Pretty distorted text.
**Random searches.**
\`/urban\` - Get an Urban Dictionary definition ;)
\`/cat\` and \`/dog\` - Random cats and dogs from <https://random.cat> and <https://dog.ceo>
Expand Down
2 changes: 1 addition & 1 deletion server/bot/imports/tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const getServerSettings = async (db: Db, serverID: string) => {
let serverSettings = await db.collection('servers').find({ serverID }).toArray()
if (serverSettings.length === 0) {
// Initialize server settings.
await db.collection('servers').insertOne({ serverID, ocrOnSend: true })
await db.collection('servers').insertOne({ serverID })
serverSettings = await db.collection('servers').find({ serverID }).toArray()
}
return serverSettings[0]
Expand Down

0 comments on commit 11f8e92

Please sign in to comment.