Added message on boot
This commit is contained in:
parent
1542820f89
commit
38cbb0b961
3
.gitignore
vendored
3
.gitignore
vendored
@ -130,4 +130,5 @@ dist
|
|||||||
.pnp.*
|
.pnp.*
|
||||||
|
|
||||||
# secrets
|
# secrets
|
||||||
botkey.txt
|
botkey.txt
|
||||||
|
defaultchannel.txt
|
||||||
3
asher/src/constants.js
Normal file
3
asher/src/constants.js
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
export const textStrings = {
|
||||||
|
BOOT_MESSAGE: "Hi! Chloe just started me up! I'm not quite ready yet though!",
|
||||||
|
};
|
||||||
@ -0,0 +1,11 @@
|
|||||||
|
import { secretKeys, getSecret } from "../../../secrets.js";
|
||||||
|
import { textStrings } from "../../../constants.js";
|
||||||
|
|
||||||
|
export function startupSendMessage(readyClient) {
|
||||||
|
const channelId = getSecret(secretKeys.DEFAULT_CHANNEL);
|
||||||
|
console.log(channelId);
|
||||||
|
|
||||||
|
const channel = readyClient.channels.resolve(channelId);
|
||||||
|
|
||||||
|
channel.send(textStrings.BOOT_MESSAGE);
|
||||||
|
}
|
||||||
@ -1,6 +1,7 @@
|
|||||||
import { Events } from "discord.js";
|
import { Events } from "discord.js";
|
||||||
// Import routines.
|
// Import routines.
|
||||||
import { startupHeartbeat } from "./client-ready/startup-heartbeat/startupHeartbeat.js";
|
import { startupHeartbeat } from "./client-ready/startup-heartbeat/startupHeartbeat.js";
|
||||||
|
import { startupSendMessage } from "./client-ready/startup-send-message/startupSendMessage.js";
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* All bot actions are "routines" that fire off of some trigger.
|
* All bot actions are "routines" that fire off of some trigger.
|
||||||
@ -17,6 +18,7 @@ export const routineManifest = [
|
|||||||
event: Events.ClientReady,
|
event: Events.ClientReady,
|
||||||
routines: [
|
routines: [
|
||||||
startupHeartbeat,
|
startupHeartbeat,
|
||||||
|
startupSendMessage,
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
@ -1,11 +1,13 @@
|
|||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
|
|
||||||
export const secretKeys = {
|
export const secretKeys = {
|
||||||
BOT_KEY: 'botkey'
|
BOT_KEY: 'botkey',
|
||||||
|
DEFAULT_CHANNEL: 'default-channel',
|
||||||
};
|
};
|
||||||
|
|
||||||
const secretManifest = [
|
const secretManifest = [
|
||||||
secretKeys.BOT_KEY,
|
secretKeys.BOT_KEY,
|
||||||
|
secretKeys.DEFAULT_CHANNEL,
|
||||||
];
|
];
|
||||||
|
|
||||||
let secrets = {};
|
let secrets = {};
|
||||||
|
|||||||
@ -10,8 +10,11 @@ services:
|
|||||||
command: bash -c "cd /asher && npm i && npm run serve"
|
command: bash -c "cd /asher && npm i && npm run serve"
|
||||||
secrets:
|
secrets:
|
||||||
- botkey
|
- botkey
|
||||||
|
- default-channel
|
||||||
|
|
||||||
|
|
||||||
secrets:
|
secrets:
|
||||||
botkey:
|
botkey:
|
||||||
file: ./botkey.txt
|
file: ./botkey.txt
|
||||||
|
default-channel:
|
||||||
|
file: ./defaultchannel.txt
|
||||||
Loading…
x
Reference in New Issue
Block a user