Skip to content

Commit 27c807e

Browse files
committed
Started working on discord bot.
1 parent 29dd559 commit 27c807e

File tree

6 files changed

+127
-124
lines changed

6 files changed

+127
-124
lines changed

backend/env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
DISCORD_BOT_TOKEN=

backend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"build": "tsup src/index.ts --minify"
1414
},
1515
"dependencies": {
16-
"discordeno": "19.0.0-next.faaa8af",
16+
"@discordeno/bot": "19.0.0-next.b1bfe94",
1717
"dotenv": "^16.4.5",
1818
"hono": "^4.5.11"
1919
},

backend/src/index.ts

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,23 @@
1-
throw new Error('Not implemented')
1+
import { createBot, Intents } from '@discordeno/bot'
2+
3+
import dotenv from 'dotenv'
4+
dotenv.config()
5+
6+
const bot = createBot({
7+
token: process.env.DISCORD_BOT_TOKEN!,
8+
intents: Intents.Guilds | Intents.GuildMessages, // Or other intents that you might needs.
9+
events: {
10+
ready: (data) => {
11+
console.log(`The shard ${data.shardId} is ready!`)
12+
},
13+
},
14+
})
15+
16+
// You can add events after the createBot call if you prefer
17+
18+
bot.events.messageCreate = (message) => {
19+
// Do stuff with the message object ...
20+
console.log(message.content)
21+
}
22+
23+
await bot.start()

frontend/quasar.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ module.exports = configure(function (/* ctx */) {
9494
// Full list of options: https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#devServer
9595
devServer: {
9696
// https: true
97-
open: true, // opens browser window automatically
97+
open: false, // opens browser window automatically
9898
},
9999

100100
// https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#framework

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,14 @@
99
"scripts": {
1010
"lint": "eslint --ext .js,.ts,.vue ./",
1111
"format": "prettier --write \"**/*.{js,ts,vue,scss,html,md,json}\" --ignore-path .gitignore",
12-
"dev": "yarn workspace vgc-tools dev & yarn workspace vgc dev",
13-
"build": "yarn workspace vgc-tools build && yarn workspace vgc build"
12+
"dev": "concurrently 'yarn workspace vgc-tools dev' 'npm:dev:api' 'yarn workspace vgc dev'",
13+
"dev:api": "yarn workspace vgc-api dev",
14+
"build": "yarn workspace vgc-tools build && yarn workspace vgc-api build && yarn workspace vgc build"
1415
},
1516
"devDependencies": {
1617
"@typescript-eslint/eslint-plugin": "^8.4.0",
1718
"@typescript-eslint/parser": "^8.4.0",
19+
"concurrently": "^8.2.2",
1820
"eslint": "^9.9.1",
1921
"eslint-config-prettier": "^9.1.0",
2022
"eslint-plugin-vue": "^9.28.0",

0 commit comments

Comments
 (0)