Skip to content

Commit

Permalink
Add log channel for introduction message
Browse files Browse the repository at this point in the history
  • Loading branch information
hendraaagil committed Jul 26, 2021
1 parent 7e85ff7 commit 679328e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ BOT_ID = ''
CH_INTRO_ID = ''
CH_LEAVE_ID = ''
CH_LOBBY_ID = ''
CH_LOG_ID = ''
CH_ROLE_ID = ''
CH_RULE_ID = ''
ROLE_ADMIN_ID = ''
Expand Down
2 changes: 2 additions & 0 deletions commands/intro.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@ module.exports = {
const user = message.guild.members.cache.find(
(member) => member.id === message.author.id
);
const chLog = client.channels.cache.get(process.env.CH_LOG_ID);

const regexPattern = new RegExp(
/(Nama|Kelas|Hobi|Asal Sekolah)[\s][:][\s\w]?\w{3,}/
);
if (regexPattern.test(message.content)) {
user.roles.add(roleMember);
chLog.send(message);
message.react('☑');
message.reply(
`Selamat kamu sudah resmi menjadi **${roleMember.name}** dari **${message.guild.name}**.\nSelamat bergabung dan jangan lupa pilih role terlebih dahulu di ${chRole}!`
Expand Down

0 comments on commit 679328e

Please sign in to comment.