Skip to content

Commit

Permalink
some minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
rking32 committed Jul 19, 2020
1 parent 59703d1 commit 730b254
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 33 deletions.
4 changes: 2 additions & 2 deletions init/checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ _checkDatabase() {
import pymongo
try:
pymongo.MongoClient("'$DATABASE_URL'").list_database_names()
pymongo.MongoClient("'$DATABASE_URL'").list_database_names()
except Exception as e:
print(e)
print(e)
')
[[ $err ]] && quit "pymongo response > $err" || log "\tpymongo response > {status : 200}"
}
Expand Down
3 changes: 2 additions & 1 deletion init/logbot/core/api.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ getLastMessage() {
if test ${#_allMessages[@]} -gt 0; then
${_allMessages[-1]}.$1 "$2"
elif [[ -n $BOT_TOKEN && -n $LOG_CHANNEL_ID ]]; then
log "first sendMessage ! caused by (core.Api.$FUNCNAME)"
log "first sendMessage ! caused by (core.Api.$FUNCNAME)\n"$2""
else
log "$2"
fi
}
Expand Down
30 changes: 5 additions & 25 deletions init/logbot/core/messageClass.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,43 +16,23 @@ message_id=2
text=3

_Message.property() {
if [ "$2" == "=" ]; then
_Message_properties[$1]="$3"
else
echo "${_Message_properties[$1]}"
fi
test "$2" = "=" && _Message_properties[$1]="$3" || echo "${_Message_properties[$1]}"
}

_Message.id() {
if [ "$1" == "=" ]; then
_Message.property id = $2
else
_Message.property id
fi
test "$1" = "=" && _Message.property id = $2 || _Message.property id
}

_Message.chat_id() {
if [ "$1" == "=" ]; then
_Message.property chat_id = $2
else
_Message.property chat_id
fi
test "$1" == "=" && _Message.property chat_id = $2 || _Message.property chat_id
}

_Message.message_id() {
if [ "$1" == "=" ]; then
_Message.property message_id = $2
else
_Message.property message_id
fi
test "$1" = "=" && _Message.property message_id = $2 || _Message.property message_id
}

_Message.text() {
if [ "$1" == "=" ]; then
_Message.property text = "$2"
else
_Message.property text
fi
test "$1" = "=" && _Message.property text = "$2" || _Message.property text
}

_Message.parse() {
Expand Down
6 changes: 3 additions & 3 deletions init/logbot/methods/methods.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ _polling() {
declare -i _to=1

_pollsleep() {
let _to+=1
log "sleeping ($_to) caused by (LogBot.polling)"
sleep $_to
let _to+=1
log "sleeping ($_to) caused by (LogBot.polling)"
sleep $_to
}
4 changes: 2 additions & 2 deletions init/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
declare -r pVer=$(sed -E 's/\w+ ([2-3])\.([0-9]+)\.([0-9]+)/\1.\2.\3/g' < <(python3 -V))

log() {
local text=$*
test ${text::1} = '~' || echo -e "[LOGS] >>> ${text#\~}"
local text="$*"
test ${#text} -gt 0 && test ${text::1} != '~' && echo -e "[LOGS] >>> ${text#\~}"
}

quit() {
Expand Down
1 change: 1 addition & 0 deletions userge/plugins/tools/alive.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ async def alive(message: Message):
• **python version** : `{versions.__python_version__}`
• **pyrogram version** : `{versions.__pyro_version__}`
• **userge version** : `{get_version()}`
• **unofficial enabled** : `{Config.LOAD_UNOFFICIAL_PLUGINS}`
• **license** : {versions.__license__}
• **copyright** : {versions.__copyright__}
• **repo** : [Userge]({Config.UPSTREAM_REPO})
Expand Down

0 comments on commit 730b254

Please sign in to comment.