Merge pull request #896 from Smidy13/develop

Improvement: Discord, Dogecoin Icons and Configuration
This commit is contained in:
Luis Fernando Molina authored and GitHub committed 2021-05-09 07:57:37 -04:00
commit c5b1006fde
12 files changed
+236 -41

No files matched your search

@@ -0,0 +1,89 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
viewBox="0 0 426.4 426.4"
width="533"
height="533"
version="1.1"
id="svg871"
sodipodi:docname="dogecoin.svg"
inkscape:version="1.0.1 (3bc2e813f5, 2020-09-07)"
inkscape:export-filename="E:\Superalgos\Projects\Superalgos\Icons\dogecoin.png"
inkscape:export-xdpi="92.217636"
inkscape:export-ydpi="92.217636">
<metadata
id="metadata877">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs875" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1920"
inkscape:window-height="1017"
id="namedview873"
showgrid="false"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:zoom="0.68"
inkscape:cx="158.093"
inkscape:cy="315.8093"
inkscape:window-x="-8"
inkscape:window-y="-8"
inkscape:window-maximized="1"
inkscape:current-layer="layer2" />
<g
inkscape:groupmode="layer"
id="layer2"
inkscape:label="Layer 2"
style="display:inline">
<rect
style="fill:#f5f5f5;stroke:#4acfd9;stroke-width:0.8"
id="rect1444"
width="257.64706"
height="250.58823"
x="96.470581"
y="88.235298" />
</g>
<g
inkscape:groupmode="layer"
id="layer1"
inkscape:label="Layer 1"
style="display:inline">
<g
fill="#c2a633"
id="g869">
<path
d="m 218.3168,140.4988 h -30.46202 v 60.05631 H 235.78 v 25.14479 h -47.92522 v 60.0521 h 31.95442 c 8.2103,0 67.4053,0.9274 67.3136,-69.8699 -0.092,-70.79737 -57.4126,-75.3833 -68.806,-75.3833 z"
id="path865"
style="stroke-width:0.2132" />
<path
d="M 213.2,0 C 95.451766,0 0,95.45177 0,213.2 0,330.9482 95.451766,426.4 213.2,426.4 330.9482,426.4 426.4,330.9482 426.4,213.2 426.4,95.45177 330.9482,0 213.2,0 Z m 8.3766,328.3493 H 144.36625 V 225.702 h -27.21711 v -25.14476 h 27.21498 V 97.90357 h 66.26682 c 15.67656,0 119.51136,-3.25556 119.51136,117.14913 0,122.396 -108.5635,113.2966 -108.5635,113.2966 z"
id="path867"
style="stroke-width:0.2132" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.9 KiB

@@ -0,0 +1,88 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
id="Layer_1"
viewBox="0 0 533 533"
version="1.1"
sodipodi:docname="discord-bot.svg"
width="533"
height="533"
inkscape:export-filename="E:\Superalgos\Projects\Superalgos\Icons\discord-bot.png"
inkscape:export-xdpi="92.217636"
inkscape:export-ydpi="92.217636"
inkscape:version="1.0.1 (3bc2e813f5, 2020-09-07)">
<metadata
id="metadata13">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs11" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1920"
inkscape:window-height="1017"
id="namedview9"
showgrid="false"
inkscape:zoom="0.62608413"
inkscape:cx="36.435065"
inkscape:cy="256.47149"
inkscape:window-x="-8"
inkscape:window-y="-8"
inkscape:window-maximized="1"
inkscape:current-layer="layer1" />
<style
id="style2">.st0{fill:#7289DA;}</style>
<g
inkscape:groupmode="layer"
id="layer2"
inkscape:label="Layer 2"
style="display:inline">
<rect
style="display:inline;fill:#f5f5f5;stroke:#4acfd9"
id="rect867"
width="397.71014"
height="292.293"
x="77.465599"
y="87.049004"
inkscape:export-filename="E:\Superalgos\Projects\Superalgos\Icons\rect867.png"
inkscape:export-xdpi="92.217636"
inkscape:export-ydpi="92.217636" />
</g>
<g
inkscape:groupmode="layer"
id="layer1"
inkscape:label="Layer 1"
style="display:inline">
<path
class="st0"
d="m 218.26349,223.59351 c -15.19048,0 -27.18298,13.325 -27.18298,29.5815 0,16.2565 12.259,29.5815 27.18298,29.5815 15.1905,0 27.183,-13.325 27.183,-29.5815 0.2665,-16.2565 -11.9925,-29.5815 -27.183,-29.5815 z m 97.27251,0 c -15.1905,0 -27.183,13.325 -27.183,29.5815 0,16.2565 12.259,29.5815 27.183,29.5815 15.1905,0 27.183,-13.325 27.183,-29.5815 0,-16.2565 -11.9925,-29.5815 -27.183,-29.5815 z"
id="path4"
style="fill:#7289da;stroke-width:2.665" />
<path
class="st0"
d="M 445.055,0 H 87.945004 C 57.830503,0 33.3125,24.518 33.3125,54.898998 V 415.20702 c 0,30.381 24.518003,54.899 54.632504,54.899 H 390.156 l -14.1245,-49.3025 34.112,31.7135 32.2465,29.848 57.2975,50.635 V 54.898998 C 499.6875,24.518 475.1695,0 445.055,0 Z M 342.186,348.04901 c 0,0 -9.594,-11.4595 -17.589,-21.5865 34.9115,-9.8605 48.2365,-31.7135 48.2365,-31.7135 -10.9265,7.1955 -21.32,12.259 -30.6475,15.7235 -13.325,5.5965 -26.117,9.3275 -38.6425,11.4595 -25.584,4.797 -49.036,3.4645 -69.02351,-0.2665 -15.1905,-2.9315 -28.24898,-7.1955 -39.17548,-11.4595 -6.1295,-2.3985 -12.792,-5.33 -19.4545,-9.061 -0.7995,-0.533 -1.599,-0.7995 -2.3985,-1.3325 -0.533,-0.2665 -0.7995,-0.533 -1.066,-0.7995 -4.797,-2.665 -7.462,-4.5305 -7.462,-4.5305 0,0 12.792,21.32 46.6375,31.447 -7.995,10.127 -17.8555,22.1195 -17.8555,22.1195 -58.89651,-1.8655 -81.28251,-40.508 -81.28251,-40.508 0,-85.813 38.37601,-155.36951 38.37601,-155.36951 38.376,-28.782 74.88648,-27.9825 74.88648,-27.9825 l 2.665,3.198 c -47.96998,13.858 -70.08948,34.9115 -70.08948,34.9115 0,0 5.863,-3.198 15.7235,-7.7285 28.5155,-12.5255 51.16798,-15.99 60.49548,-16.7895 1.599,-0.2665 2.9315,-0.533 4.5305,-0.533 16.25651,-2.132 34.64501,-2.665 53.83301,-0.533 25.3175,2.9315 52.5005,10.3935 80.2165,25.584 0,0 -21.0535,-19.9875 -66.3585,-33.8455 l 3.731,-4.264 c 0,0 36.5105,-0.7995 74.8865,27.9825 0,0 38.376,69.55651 38.376,155.36951 0,0 -22.6525,38.6425 -81.549,40.508 z"
id="path6"
style="fill:#7289da;stroke-width:2.665" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

@@ -23,7 +23,7 @@
"action": "Add UI Object",
"disableIfPropertyIsDefined": true,
"propertyToCheckFor": "announcementCondition",
"label": "Add Condition",
"label": "Add Announcement Condition",
"relatedUiObject": "Announcement Condition",
"actionFunction": "payload.executeAction"
},
@@ -103,6 +103,10 @@
{
"codeName": "XRP",
"iconName": "xrp"
},
{
"codeName": "DOGE",
"iconName": "dogecoin"
}
]
}
@@ -32,10 +32,10 @@
"config": "{\n\"webhookURL\": \"Paste the webhook url obtained from Discord > Channel Settings > Integrations > Webhooks > New Webhook\"\n}"
},
"addLeftIcons": true,
"level": 4,
"level": 3,
"attachingRules": {
"compatibleTypes": "->Social Bots->"
},
"childrenNodesProperties": [],
"propertyNameAtParent": "bots"
"propertyNameAtParent": "discordBots"
}
@@ -30,13 +30,13 @@
},
"childrenNodesProperties": [
{
"name": "bots",
"name": "telegramBots",
"type": "array",
"childType": "Telegram Bot",
"autoAdd": true
},
{
"name": "bots",
"name": "discordBots",
"type": "array",
"childType": "Discord Bot",
"autoAdd": true
@@ -32,10 +32,10 @@
"config": "{ \n\"botToken\": \"Paste the bot token obtained from Telegram Bot Father\",\n\"chatId\": \"Type or paste the chat or group id -a number with no quotes- where announcements are going to be sent to\"\n}"
},
"addLeftIcons": true,
"level": 4,
"level": 3,
"attachingRules": {
"compatibleTypes": "->Social Bots->"
},
"childrenNodesProperties": [],
"propertyNameAtParent": "bots"
"propertyNameAtParent": "telegramBots"
}
@@ -12,33 +12,39 @@ exports.newSuperalgosBotModulesSocialBots = function (processIndex) {
function initialize() {
if (TS.projects.superalgos.globals.processConstants.CONSTANTS_BY_PROCESS_INDEX_MAP.get(processIndex).SESSION_NODE.socialBots !== undefined) {
if (TS.projects.superalgos.globals.processConstants.CONSTANTS_BY_PROCESS_INDEX_MAP.get(processIndex).SESSION_NODE.socialBots.bots !== undefined) {
for (let i = 0; i < TS.projects.superalgos.globals.processConstants.CONSTANTS_BY_PROCESS_INDEX_MAP.get(processIndex).SESSION_NODE.socialBots.bots.length; i++) {
let socialBot = TS.projects.superalgos.globals.processConstants.CONSTANTS_BY_PROCESS_INDEX_MAP.get(processIndex).SESSION_NODE.socialBots.bots[i]
if (socialBot.type === "Telegram Bot") {
let config = socialBot.config
socialBot.botInstance = TS.projects.superalgos.botModules.telegramBot.newSuperalgosBotModulesTelegramBot(processIndex)
socialBot.botInstance.initialize(config.botToken, config.chatId)
} else if (socialBot.type === "Discord Bot"){
let config = socialBot.config
socialBot.botInstance = TS.projects.superalgos.botModules.discordBot.newSuperalgosBotModulesDiscordBot(processIndex)
socialBot.botInstance.initialize(config.webhookURL)
for (let prop in TS.projects.superalgos.globals.processConstants.CONSTANTS_BY_PROCESS_INDEX_MAP.get(processIndex).SESSION_NODE.socialBots) {
if (prop.toLowerCase().includes("Bots".toLowerCase())) {
for (let i = 0; i < TS.projects.superalgos.globals.processConstants.CONSTANTS_BY_PROCESS_INDEX_MAP.get(processIndex).SESSION_NODE.socialBots[prop].length; i++) {
let socialBot = TS.projects.superalgos.globals.processConstants.CONSTANTS_BY_PROCESS_INDEX_MAP.get(processIndex).SESSION_NODE.socialBots[prop][i]
if (socialBot.type === "Telegram Bot") {
let config = socialBot.config
socialBot.botInstance = TS.projects.superalgos.botModules.telegramBot.newSuperalgosBotModulesTelegramBot(processIndex)
socialBot.botInstance.initialize(config.botToken, config.chatId)
} else if (socialBot.type === "Discord Bot") {
let config = socialBot.config
socialBot.botInstance = TS.projects.superalgos.botModules.discordBot.newSuperalgosBotModulesDiscordBot(processIndex)
socialBot.botInstance.initialize(config.webhookURL)
}
}
}
}
function announce(text) {
if (TS.projects.superalgos.globals.processConstants.CONSTANTS_BY_PROCESS_INDEX_MAP.get(processIndex).SESSION_NODE.socialBots.bots !== undefined) {
for (let i = 0; i < TS.projects.superalgos.globals.processConstants.CONSTANTS_BY_PROCESS_INDEX_MAP.get(processIndex).SESSION_NODE.socialBots.bots.length; i++) {
let socialBot = TS.projects.superalgos.globals.processConstants.CONSTANTS_BY_PROCESS_INDEX_MAP.get(processIndex).SESSION_NODE.socialBots.bots[i]
try {
if (socialBot.type === "Telegram Bot") {
socialBot.botInstance.telegramAPI.sendMessage(socialBot.botInstance.chatId, text).catch(err => TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME, "[WARN] initialize -> initializeSocialBots -> announce -> Telegram API error -> err = " + err))
} else if (socialBot.type === "Discord Bot") {
socialBot.botInstance.sendMessage(text).catch(err => TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME, "[WARN] initialize -> initializeSocialBots -> announce -> Discord Bot error -> err = " + err))
for (let prop in TS.projects.superalgos.globals.processConstants.CONSTANTS_BY_PROCESS_INDEX_MAP.get(processIndex).SESSION_NODE.socialBots) {
if (prop.toLowerCase().includes("Bots".toLowerCase())) {
if (TS.projects.superalgos.globals.processConstants.CONSTANTS_BY_PROCESS_INDEX_MAP.get(processIndex).SESSION_NODE.socialBots[prop] !== undefined) {
for (let i = 0; i < TS.projects.superalgos.globals.processConstants.CONSTANTS_BY_PROCESS_INDEX_MAP.get(processIndex).SESSION_NODE.socialBots[prop].length; i++) {
let socialBot = TS.projects.superalgos.globals.processConstants.CONSTANTS_BY_PROCESS_INDEX_MAP.get(processIndex).SESSION_NODE.socialBots[prop][i]
try {
if (socialBot.type === "Telegram Bot") {
socialBot.botInstance.telegramAPI.sendMessage(socialBot.botInstance.chatId, text).catch(err => TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME, "[WARN] initialize -> initializeSocialBots -> announce -> Telegram API error -> err = " + err))
} else if (socialBot.type === "Discord Bot") {
socialBot.botInstance.sendMessage(text).catch(err => TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME, "[WARN] initialize -> initializeSocialBots -> announce -> Discord Bot error -> err = " + err))
}
} catch (err) {
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME, "[WARN] initialize -> announce -> err = " + err.stack);
}
}
} catch (err) {
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME, "[WARN] initialize -> announce -> err = " + err.stack);
}
}
}
@@ -50,11 +56,15 @@ exports.newSuperalgosBotModulesSocialBots = function (processIndex) {
function finalize() {
if (TS.projects.superalgos.globals.processConstants.CONSTANTS_BY_PROCESS_INDEX_MAP.get(processIndex).SESSION_NODE.socialBots === undefined) { return }
if (TS.projects.superalgos.globals.processConstants.CONSTANTS_BY_PROCESS_INDEX_MAP.get(processIndex).SESSION_NODE.socialBots.bots !== undefined) {
for (let i = 0; i < TS.projects.superalgos.globals.processConstants.CONSTANTS_BY_PROCESS_INDEX_MAP.get(processIndex).SESSION_NODE.socialBots.bots.length; i++) {
let socialBot = TS.projects.superalgos.globals.processConstants.CONSTANTS_BY_PROCESS_INDEX_MAP.get(processIndex).SESSION_NODE.socialBots.bots[i]
if (socialBot.type === "Telegram Bot" || socialBot.type === "Discord Bot") {
socialBot.botInstance.finalize()
for (let prop in TS.projects.superalgos.globals.processConstants.CONSTANTS_BY_PROCESS_INDEX_MAP.get(processIndex).SESSION_NODE.socialBots) {
if (prop.includes("Bots")) {
if (TS.projects.superalgos.globals.processConstants.CONSTANTS_BY_PROCESS_INDEX_MAP.get(processIndex).SESSION_NODE.socialBots[prop] !== undefined) {
for (let i = 0; i < TS.projects.superalgos.globals.processConstants.CONSTANTS_BY_PROCESS_INDEX_MAP.get(processIndex).SESSION_NODE.socialBots[prop].length; i++) {
let socialBot = TS.projects.superalgos.globals.processConstants.CONSTANTS_BY_PROCESS_INDEX_MAP.get(processIndex).SESSION_NODE.socialBots[prop][i]
if (socialBot.type === "Telegram Bot" || socialBot.type === "Discord Bot") {
socialBot.botInstance.finalize()
}
}
}
}
}
@@ -62,11 +72,15 @@ exports.newSuperalgosBotModulesSocialBots = function (processIndex) {
function sendMessage(message) {
if (TS.projects.superalgos.globals.processConstants.CONSTANTS_BY_PROCESS_INDEX_MAP.get(processIndex).SESSION_NODE.socialBots !== undefined) {
if (TS.projects.superalgos.globals.processConstants.CONSTANTS_BY_PROCESS_INDEX_MAP.get(processIndex).SESSION_NODE.socialBots.bots !== undefined) {
for (let i = 0; i < TS.projects.superalgos.globals.processConstants.CONSTANTS_BY_PROCESS_INDEX_MAP.get(processIndex).SESSION_NODE.socialBots.bots.length; i++) {
let socialBot = TS.projects.superalgos.globals.processConstants.CONSTANTS_BY_PROCESS_INDEX_MAP.get(processIndex).SESSION_NODE.socialBots.bots[i]
if (socialBot.type === "Telegram Bot" || socialBot.type === "Discord Bot") {
socialBot.botInstance.sendMessage(message)
for (let prop in TS.projects.superalgos.globals.processConstants.CONSTANTS_BY_PROCESS_INDEX_MAP.get(processIndex).SESSION_NODE.socialBots) {
if (prop.includes("Bots")) {
if (TS.projects.superalgos.globals.processConstants.CONSTANTS_BY_PROCESS_INDEX_MAP.get(processIndex).SESSION_NODE.socialBots[prop] !== undefined) {
for (let i = 0; i < TS.projects.superalgos.globals.processConstants.CONSTANTS_BY_PROCESS_INDEX_MAP.get(processIndex).SESSION_NODE.socialBots[prop].length; i++) {
let socialBot = TS.projects.superalgos.globals.processConstants.CONSTANTS_BY_PROCESS_INDEX_MAP.get(processIndex).SESSION_NODE.socialBots[prop][i]
if (socialBot.type === "Telegram Bot" || socialBot.type === "Discord Bot") {
socialBot.botInstance.sendMessage(message)
}
}
}
}
}
@@ -129,7 +129,7 @@ function newSuperalgosFunctionLibraryLearningSessionFunctions() {
'Back Learning Session->Live Learning Session->' +
'Learning Parameters->' +
'Learning Algorithm->Time Range->Time Frame->Heartbeats->User Defined Parameters->' +
'Social Bots->Telegram Bot->'
'Social Bots->Telegram Bot->Discord Bot->'
let session = UI.projects.superalgos.functionLibraries.protocolNode.getProtocolNode(node, false, true, true, false, false, lightingPath)
@@ -153,8 +153,8 @@ function newSuperalgosFunctionLibraryTradingSessionFunctions() {
'Backtesting Session->Paper Trading Session->Forward Testing Session->Live Trading Session->' +
'Trading Parameters->' +
'Session Base Asset->Session Quoted Asset->Time Range->Time Frame->Slippage->Fee Structure->Snapshots->Heartbeats->User Defined Parameters->' +
'Exchange Account Asset->Asset->' +
'Social Bots->Telegram Bot->'
'Social Bots->Telegram Bot->Discord Bot->' +
'Exchange Account Asset->Asset->'
let session = UI.projects.superalgos.functionLibraries.protocolNode.getProtocolNode(node, false, true, true, false, false, lightingPath)