Skip to content

Commit affc0c3

Browse files
committed
Display module version and logging
1 parent a7f3611 commit affc0c3

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "kaatisbot",
3-
"version": "1.0.0",
2+
"name": "kaatisbotti",
3+
"version": "1.1.0",
44
"description": "hyvää kontenttia/good content",
55
"type": "module",
66
"main": "index.js",

src/index.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ const htaccessPath = process.env.HTACCESS_PATH || 'public/.htaccess'
2121

2222
const client = new Client()
2323

24+
client.on('ready', async () => {
25+
// Notice: npm_package_version is only available if the application is launched with npm start
26+
client.user.setActivity(`v${process.env.npm_package_version}`)
27+
})
28+
2429
client.on('message', async (message) => {
2530
if (message.channel.id !== memeChannelId) return
2631

@@ -71,6 +76,8 @@ client.on('message', async (message) => {
7176
// The name of the uploader of the file is shown in Apache directory listing
7277
fsp.appendFile(htaccessPath,
7378
`AddDescription "${utils.alphanum(message.author.username)}" ${availableFilename}\n`)
79+
80+
console.log(`Successfully uploaded ${availableFilename} by ${message.author.tag}`)
7481
}
7582
} catch (e) {
7683
const errorMessage = await message.reply(`Kuvaasi ei voitu lähettää kaatikseen: ${e.message}`)

0 commit comments

Comments
 (0)