This repository has been archived by the owner on May 15, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 465
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Core bug Fixes + New Custom Alive + Upstreams (#10)
* some cherry-pick fixing merge conflicts * fix some more typos (#151) * add broad Exception to ytdl stuff * Update config.py * Will use it later * some alive tweaks * alive tweaks * some random bugs https://nekobin.com/riqagareso.txt * Update alive.py * Check for remote 'heroku' * Update alive.py * custon alive support * Update help.py * Update api.sh * Deleted and readded whole init/ - improved stability * Testing updater Co-authored-by: rking32 <[email protected]> Co-authored-by: TheWeaver786 <[email protected]>
- Loading branch information
1 parent
935e691
commit 45995bd
Showing
29 changed files
with
343 additions
and
293 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,4 +52,4 @@ runUserge() { | |
startLogBotPolling | ||
startUserge "$@" | ||
stopUserge | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#!/bin/bash | ||
# | ||
# Copyright (C) 2020 by UsergeTeam@Github, < https://github.com/UsergeTeam >. | ||
# | ||
# This file is part of < https://github.com/UsergeTeam/Userge > project, | ||
# and is released under the "GNU v3.0 License Agreement". | ||
# Please see < https://github.com/uaudith/Userge/blob/master/LICENSE > | ||
# | ||
# All rights reserved. | ||
|
||
. init/logbot/core/utils.sh | ||
|
||
api.getUpdates() { | ||
local params=($*) | ||
_getResponse $FUNCNAME ${params[*]} | ||
} | ||
|
||
api.sendMessage() { | ||
local params=( | ||
chat_id=$1 | ||
text=$(urlEncode "$2") | ||
parse_mode=HTML | ||
) | ||
test -n $3 && params+=(reply_to_message_id=$3) | ||
log "$2" | ||
_getResponse $FUNCNAME ${params[*]} | ||
} | ||
|
||
api.editMessageText() { | ||
local params=( | ||
chat_id=$1 | ||
message_id=$2 | ||
text=$(urlEncode "$3") | ||
parse_mode=HTML | ||
) | ||
log "$3" | ||
_getResponse $FUNCNAME ${params[*]} | ||
} | ||
|
||
api.deleteMessage() { | ||
local params=( | ||
chat_id=$1 | ||
message_id=$2 | ||
) | ||
unset _allMessages[$3] | ||
_getResponse $FUNCNAME ${params[*]} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/bash | ||
# | ||
# Copyright (C) 2020 by UsergeTeam@Github, < https://github.com/UsergeTeam >. | ||
# | ||
# This file is part of < https://github.com/UsergeTeam/Userge > project, | ||
# and is released under the "GNU v3.0 License Agreement". | ||
# Please see < https://github.com/uaudith/Userge/blob/master/LICENSE > | ||
# | ||
# All rights reserved. | ||
|
||
. init/logbot/core/methods/apiMethods.sh | ||
. init/logbot/core/methods/rawMethods.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/bash | ||
# | ||
# Copyright (C) 2020 by UsergeTeam@Github, < https://github.com/UsergeTeam >. | ||
# | ||
# This file is part of < https://github.com/UsergeTeam/Userge > project, | ||
# and is released under the "GNU v3.0 License Agreement". | ||
# Please see < https://github.com/uaudith/Userge/blob/master/LICENSE > | ||
# | ||
# All rights reserved. | ||
|
||
raw.getMessageCount() { | ||
return ${#_allMessages[@]} | ||
} | ||
|
||
raw.getAllMessages() { | ||
echo ${_allMessages[@]} | ||
} | ||
|
||
raw.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.methods.$FUNCNAME\")\n"$2"" | ||
else | ||
log "$2" | ||
fi | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,4 @@ | |
# | ||
# All rights reserved. | ||
|
||
. init/logbot/methods/methods.sh | ||
. init/logbot/core/types/message.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
# | ||
# Copyright (C) 2020 by UsergeTeam@Github, < https://github.com/UsergeTeam >. | ||
# | ||
# This file is part of < https://github.com/UsergeTeam/Userge > project, | ||
# and is released under the "GNU v3.0 License Agreement". | ||
# Please see < https://github.com/uaudith/Userge/blob/master/LICENSE > | ||
# | ||
# All rights reserved. | ||
|
||
urlEncode() { | ||
echo "<code>$(echo "${1#\~}" | sed -E 's/(\\t)|(\\n)/ /g' | | ||
curl -Gso /dev/null -w %{url_effective} --data-urlencode @- "" | cut -c 3-)</code>" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,4 +36,4 @@ printMessages() { | |
for msg in $(raw.getAllMessages); do | ||
printf "{%s: %s}\n" $msg "$($msg.print)" | ||
done | ||
} | ||
} |
Oops, something went wrong.