Skip to content

Commit

Permalink
now can be opt-out
Browse files Browse the repository at this point in the history
  • Loading branch information
raluvy95 committed Apr 12, 2023
1 parent 78ad7dd commit 80f571c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/constant/defaultConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ export const DEFAULT_SERVER_SETTINGS: ISettingsDB = {
excludeRole: [],
maxXP: 25,
minXP: 15,
multiplyXP: 1
multiplyXP: 1,
noReminderToDisablePing: false
},
autopublish: {
enable: false
Expand Down
3 changes: 2 additions & 1 deletion src/interfaces/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ export interface Modules {
excludeRole: string[]
multiplyXP: number,
maxXP: number,
minXP: number
minXP: number,
noReminderToDisablePing: boolean
}>,
rss: Partial<{
enable: boolean
Expand Down
2 changes: 1 addition & 1 deletion src/utils/levelUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export async function sendLvlUP(user: string, msg: Message, level: ILevelDB) {
let targetMsg = (levelDB.modules.level.lvlup?.message || `Congrats {mention}! You reached level **{level}**!`)
.replace("{mention}", target)
.replace("{level}", level.level.toString())
if (!userPref?.noMentionOnLevelUP && probability(30)) {
if (!userPref?.noMentionOnLevelUP && probability(30) && !levelDB.modules.level.noReminderToDisablePing) {
targetMsg += '\n\nTired of getting pinged? Use `sudo uconf noMentionOnLevelUP true` and I won\'t ping you on level up!'
}
client.createMessage(targetChannelID == undefined || targetChannelID == "0" ? msg.channel.id : targetChannelID!, targetMsg)
Expand Down

0 comments on commit 80f571c

Please sign in to comment.