Skip to content

Commit 97a52e5

Browse files
committed
Print welcome message
1 parent 130dc8e commit 97a52e5

File tree

5 files changed

+16
-0
lines changed

5 files changed

+16
-0
lines changed

.github/config.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
},
2525
"moderatorRoleIds": ["893179190709477413"],
2626

27+
"sendWelcomeMessage": true,
28+
2729
"command": {
2830
"faulenzerPing": {
2931
"allowedRoleIds": [],

config.template.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@
2828
"command": "xd",
2929
"modCommand": "yd"
3030
},
31+
32+
"sendWelcomeMessage": true,
33+
3134
"moderatorRoleIds": ["893179190709477413"],
3235

3336
"command": {

src/app.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,12 @@ login().then(
166166
log.info("--dry-run was specified, shutting down");
167167
process.exit(0);
168168
}
169+
170+
if (botContext.sendWelcomeMessage) {
171+
await botContext.textChannels.hauptchat.send(
172+
`Hallo, ich wurde gerade gestartet!\nMeine Präfixe sind: \`${botContext.prefix.command}\`/\`${botContext.prefix.modCommand}\``,
173+
);
174+
}
169175
},
170176
err => {
171177
log.error(err, "Token login was not successful");

src/context.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ export interface BotContext {
3636
modCommand: string;
3737
};
3838

39+
sendWelcomeMessage: boolean;
40+
3941
spotifyClient: SpotifyApi | null;
4042

4143
youtube: {
@@ -219,6 +221,7 @@ export async function createBotContext(client: Client<true>): Promise<BotContext
219221
command: config.prefix.command,
220222
modCommand: config.prefix.modCommand,
221223
},
224+
sendWelcomeMessage: config.sendWelcomeMessage ?? false,
222225
spotifyClient:
223226
config.spotify?.clientId && config.spotify?.clientSecret
224227
? SpotifyApi.withClientCredentials(

src/service/config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ export interface Config {
8181
modCommand: string;
8282
};
8383

84+
sendWelcomeMessage?: boolean;
85+
8486
moderatorRoleIds: readonly Snowflake[];
8587

8688
command: {

0 commit comments

Comments
 (0)