Skip to content

Commit 5ed9cd8

Browse files
committed
commons: add console debug mode
1 parent 1309f79 commit 5ed9cd8

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

config.ini

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ username = soge__bot
44
; owners = owner1,owner2
55
owners = soge__
66
channel = soge__
7-
password =
7+
password =
88
clientId = 1wjn1i3792t71tl90fmyvd0zl6ri2vg
99
; set your bot color - Blue, BlueViolet, CadetBlue, Chocolate, Coral, DodgerBlue, Firebrick, GoldenRod, Green, HotPink, OrangeRed, Red, SeaGreen, SpringGreen, YellowGreen
1010
color = OrangeRed
@@ -53,4 +53,6 @@ accessToken = access_token_here
5353
secretToken = access_token_secret_here
5454

5555
[bot]
56+
; !!! don't enable anything unless you know what you are doing !!!
5657
debug = false
58+
console = false

libs/commons.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ Commons.prototype.sendMessage = async function (message, sender, attr = {}) {
113113
attr.sender = sender
114114
message = await global.parser.parseMessage(message, attr)
115115
if (message === '') return false // if message is empty, don't send anything
116-
if (global.configuration.get().bot.debug) {
116+
if (global.configuration.get().bot.debug || global.configuration.get().bot.console) {
117117
if (_.isUndefined(sender) || _.isNull(sender)) sender = { username: null }
118118
let username = (global.configuration.getValue('atUsername') ? '@' : '') + sender.username
119119
message = !_.isUndefined(sender) && !_.isUndefined(sender.username) ? message.replace(/\$sender/g, username) : message

0 commit comments

Comments
 (0)