Skip to content

Commit

Permalink
add swapfile and epic web dev support emoji
Browse files Browse the repository at this point in the history
  • Loading branch information
kentcdodds committed Oct 24, 2023
1 parent 75f5d6b commit 86f2adb
Show file tree
Hide file tree
Showing 6 changed files with 251 additions and 35 deletions.
12 changes: 12 additions & 0 deletions app/bot/reactions/reactions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const reactions: Record<string, ReactionFn> = {
botcall: callKent,
bottjssupport: tjssupport,
boterdsupport: erdsupport,
botewdsupport: ewdsupport,
} as const

async function help(messageReaction: Discord.MessageReaction) {
Expand Down Expand Up @@ -241,4 +242,15 @@ async function erdsupport(messageReaction: Discord.MessageReaction) {
}
erdsupport.description = `Replies to the message telling the user to email EpicReact.dev support.`

async function ewdsupport(messageReaction: Discord.MessageReaction) {
void messageReaction.remove()
const { channel, author, guild } = messageReaction.message
if (!guild || !channel || !author) return

await messageReaction.message.reply(
`For support with EpicWeb.dev, please email [email protected]. Thanks!`,
)
}
ewdsupport.description = `Replies to the message telling the user to email EpicWeb.dev support.`

export default reactions
259 changes: 224 additions & 35 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
"discord-api-types": "^0.37.11",
"discord.js": "^14.5.0",
"dotenv": "^16.0.2",
"execa": "^8.0.1",
"got": "^12.5.1",
"htmlparser2": "^8.0.1",
"isbot": "^3.5.4",
Expand Down
Binary file added scripts/bot-emoji/botewdsupport.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions scripts/setup-swap.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env node

import { writeFile } from 'node:fs/promises'
import { $ } from 'execa'

console.log('setting up swapfile...')
await $`fallocate -l 256M /swapfile`
await $`chmod 0600 /swapfile`
await $`mkswap /swapfile`
await writeFile('/proc/sys/vm/swappiness', '10')
await $`swapon /swapfile`
await writeFile('/proc/sys/vm/overcommit_memory', '1')
console.log('swapfile setup complete')
1 change: 1 addition & 0 deletions start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
set -ex
# node ./scripts/deploy-commands.js
# node ./scripts/deploy-emoji.js
node ./scripts/setup-swap.js
npm run start

0 comments on commit 86f2adb

Please sign in to comment.