Skip to content

Commit

Permalink
update: made some minor changes and cleared logs
Browse files Browse the repository at this point in the history
  • Loading branch information
tobi-bams committed Mar 10, 2023
1 parent 80f71bd commit 726f811
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 19 deletions.
4 changes: 2 additions & 2 deletions dist/src/builtin/sentiment.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/src/builtin/sentiment.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions dist/src/builtin/utill/sentiment.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/src/builtin/utill/sentiment.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions src/builtin/sentiment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,13 @@ export function init() {
const tribe = (await models.Chat.findOne({
where: { uuid: message.channel.id },
})) as ChatRecord
console.log('+++++++++++++ Interval', interval)

if (!interval) {
const bot = (await models.ChatBot.findOne({
where: { chatId: tribe.id, botPrefix, tenant: tribe.tenant },
})) as ChatRecord

if (!bot) return
let meta: SentimentMeta = JSON.parse(bot.meta || `{}`)

interval = setInterval(() => {
Expand All @@ -54,7 +56,7 @@ export function init() {
)
}, timerMs(meta.timer || 60))
}
console.log('++++++++++++ Interval 2', interval)

if (arr[0] === botPrefix && message.author?.bot === botPrefix) {
const cmd = arr[1]
switch (cmd) {
Expand Down

0 comments on commit 726f811

Please sign in to comment.