dialog_ruby 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (103) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +1 -0
  3. data/Gemfile +0 -0
  4. data/_dev/get_full_botapi.rb +59 -0
  5. data/_dev/inlinekb_pubsub.rb +69 -0
  6. data/_dev/main.rb +127 -0
  7. data/_dev/restriction.rb +32 -0
  8. data/_dev/ru.yml +79 -0
  9. data/_dev/sidekiq.rb +28 -0
  10. data/_dev/tdlib.rb +154 -0
  11. data/dialog.sh +51 -0
  12. data/dialog_ruby.gemspec +41 -0
  13. data/lib/architecture.md +22 -0
  14. data/lib/configuration.rb +117 -0
  15. data/lib/dialogStart.rb +189 -0
  16. data/lib/dialog_ruby.rb +59 -0
  17. data/lib/exec.sh +61 -0
  18. data/lib/exec_conf/cli_config +7 -0
  19. data/lib/exec_conf/dialog__sync.service +14 -0
  20. data/lib/exec_conf/dialog__sync.timer +11 -0
  21. data/lib/exec_conf/dialog_bot@.path +6 -0
  22. data/lib/exec_conf/dialog_bot@.service +18 -0
  23. data/lib/exec_conf/dialog_bot_dev@.path +6 -0
  24. data/lib/exec_conf/dialog_bot_dev_pre@.service +16 -0
  25. data/lib/exec_conf/dialog_bot_pre@.service +16 -0
  26. data/lib/exec_conf/dialog_redis@.service +14 -0
  27. data/lib/exec_conf/post-merge +5 -0
  28. data/lib/exec_conf/redis_global.conf +49 -0
  29. data/lib/exec_conf/redis_local.conf +4 -0
  30. data/lib/lang/global_ru.yml +29 -0
  31. data/lib/lib/dialect/canvas/canvas.rb +35 -0
  32. data/lib/lib/dialect/canvas/element/convert/SearchBaloo.rb +45 -0
  33. data/lib/lib/dialect/canvas/element/data/search.rb +34 -0
  34. data/lib/lib/dialect/canvas/element/send/Inline_query_result.rb +32 -0
  35. data/lib/lib/dialect/canvas/element/send/bot_message.rb +38 -0
  36. data/lib/lib/dialect/canvas/element/send/keyboards.rb +59 -0
  37. data/lib/lib/dialect/canvas/element/send/recognize.rb +51 -0
  38. data/lib/lib/dialect/canvas/element/send/restrict.rb +42 -0
  39. data/lib/lib/dialect/canvas/element/send/tdlib_chat.rb +33 -0
  40. data/lib/lib/dialect/canvas/element/send/tdlib_message.rb +38 -0
  41. data/lib/lib/dialect/canvas/mod/send/_Inline_query_result.rb +38 -0
  42. data/lib/lib/dialect/canvas/mod/send/_keyboards.rb +40 -0
  43. data/lib/lib/dialect/canvas/mod/send/func.rb +98 -0
  44. data/lib/lib/dialect/canvas/mod/send/general/_heads.rb +27 -0
  45. data/lib/lib/dialect/canvas/mod/send/general/chat.rb +38 -0
  46. data/lib/lib/dialect/canvas/mod/send/general/common.rb +32 -0
  47. data/lib/lib/dialect/canvas/mod/send/general/message.rb +37 -0
  48. data/lib/lib/dialect/canvas/mod/send/general/user.rb +36 -0
  49. data/lib/lib/dialect/canvas/mod/send/inline_query_result/common.rb +36 -0
  50. data/lib/lib/dialect/codegen/codegen.rb +74 -0
  51. data/lib/lib/dialect/codegen/erb/data/1.ModReceive2GetData.erb +27 -0
  52. data/lib/lib/dialect/codegen/erb/data/2.GetData2Elements.erb +27 -0
  53. data/lib/lib/dialect/codegen/erb/data/3.GenData2Dest.erb +34 -0
  54. data/lib/lib/dialect/codegen/erb/functional/1.Expect2Events.erb +37 -0
  55. data/lib/lib/dialect/codegen/erb/functional/2.1.Events2AppEvent.erb +26 -0
  56. data/lib/lib/dialect/codegen/erb/functional/2.2.1.Events2ModReceive.erb +73 -0
  57. data/lib/lib/dialect/codegen/erb/functional/2.2.2.ModReceive2AppEvent.erb +59 -0
  58. data/lib/lib/dialect/codegen/erb/functional/3.Appevent2EventBus.erb +35 -0
  59. data/lib/lib/dialect/codegen/erb/functional/4.1.AppEvent2Elements.erb +72 -0
  60. data/lib/lib/dialect/codegen/erb/functional/5.1.Element2ModElements.erb +70 -0
  61. data/lib/lib/dialect/codegen/erb/functional/5.2.Element2ModSend.erb +69 -0
  62. data/lib/lib/dialect/codegen/erb/functional/7.ElementChains.erb +91 -0
  63. data/lib/lib/dialect/codegen/repack/constructor/DockedGroupings2AppFunctions.rb +36 -0
  64. data/lib/lib/dialect/codegen/repack/constructor/Element2ModSend.rb +49 -0
  65. data/lib/lib/dialect/codegen/repack/constructor/ElementsInElements.rb +34 -0
  66. data/lib/lib/dialect/codegen/repack/functional/1.Expect2Events.rb +35 -0
  67. data/lib/lib/dialect/codegen/repack/functional/2.2.1.Events2ModReceive.rb +71 -0
  68. data/lib/lib/dialect/codegen/repack/functional/2.2.2.ModReceive2AppEvent.rb +45 -0
  69. data/lib/lib/dialect/codegen/repack/functional/5.1.Element2ModElements.rb +90 -0
  70. data/lib/lib/dialect/codegen/repack/functional/5.2.Element2ModSend.rb +60 -0
  71. data/lib/lib/dialect/codegen/repack/functional/7.ElementChains.rb +88 -0
  72. data/lib/lib/dialect/codegen/run.rb +79 -0
  73. data/lib/lib/metamess/_run.rb +162 -0
  74. data/lib/lib/metamess/content/content_o-command_f.rb +100 -0
  75. data/lib/lib/metamess/content/content_o-media_f.rb +149 -0
  76. data/lib/lib/metamess/content/content_o-simple_f.rb +35 -0
  77. data/lib/lib/metamess/content/content_o.rb +245 -0
  78. data/lib/lib/metamess/event/notify_o-chatmember_f.rb +124 -0
  79. data/lib/lib/metamess/event/notify_o-chattitle_f.rb +34 -0
  80. data/lib/lib/metamess/event/notify_o-create_f.rb +42 -0
  81. data/lib/lib/metamess/event/notify_o-migrate_f.rb +34 -0
  82. data/lib/lib/metamess/event/notify_o-pinned_f.rb +34 -0
  83. data/lib/lib/metamess/event/notify_o.rb +28 -0
  84. data/lib/lib/metamess/event_c.rb +26 -0
  85. data/lib/lib/metamess/func.rb +220 -0
  86. data/lib/lib/metamess/service/service_o-callback_f.rb +33 -0
  87. data/lib/lib/metamess/service/service_o-inline_f.rb +55 -0
  88. data/lib/lib/metamess/service/service_o.rb +26 -0
  89. data/lib/lib/naming.rb +130 -0
  90. data/lib/lib/storage/redis/redisPubSub.rb +51 -0
  91. data/lib/lib/storage/redis/rediscached.rb +97 -0
  92. data/lib/lib/tdlib/auth.rb +141 -0
  93. data/lib/lib/tdlib/func.rb +34 -0
  94. data/lib/lib/tdlib/init.rb +39 -0
  95. data/lib/lib/telegram/botapi.rb +71 -0
  96. data/lib/lib/telegram/infra_info.rb +50 -0
  97. data/lib/lib/telegram/wrappers.rb +41 -0
  98. data/lib/lib/tooling/lang.rb +24 -0
  99. data/lib/lib/tooling/log.rb +54 -0
  100. data/lib/lib/tooling/ruby.rb +25 -0
  101. data/lib/version.rb +3 -0
  102. data/logo.png +0 -0
  103. metadata +305 -0
@@ -0,0 +1,59 @@
1
+ ######## ####### ######## ####### ######## ########
2
+ ## / / / / License \ \ \ \
3
+ ## Copyleft culture, Copyright (C) is prohibited here
4
+ ## This work is licensed under a CC BY-SA 4.0
5
+ ## Creative Commons Attribution-ShareAlike 4.0 License
6
+ ## Refer to the http://creativecommons.org/licenses/by-sa/4.0/
7
+ ######## ####### ######## ####### ######## ########
8
+ ## / / / / Code Climate \ \ \ \
9
+ ## Language = ruby
10
+ ## Indent = space; 2 chars;
11
+ ######## ####### ######## ####### ######## ########
12
+
13
+ module Dialog
14
+ module ElementSend
15
+ class << self
16
+
17
+
18
+ def kbForming(args, key)
19
+ if args[:smsg].has_key?(key)
20
+
21
+ args[:smsg][:reply_markup][key] = args[:smsg][key]
22
+ args[:smsg].delete(key)
23
+ end
24
+ end
25
+
26
+ def send_DialogElementSendReply_keyboardStatic(args)
27
+ args[:smsg][:reply_markup] = {}
28
+ kbForming(args, :one_time_keyboard)
29
+ kbForming(args, :selective)
30
+ kbForming(args, :resize_keyboard)
31
+ args[:smsg][:reply_markup][:keyboard] = Dialog::ModSend.makeKeyboard(
32
+ args,
33
+ :reply,
34
+ args[:x][:exec][:DialogElementSendReply_keyboardStatic][:DialogModElementReply_keyboardButton])
35
+ send_DialogElementSendBot_messageSend(args)
36
+ end
37
+
38
+ def send_DialogModSendReply_keyboard(args)
39
+ Telegram::Bot::Types::ForceReply.new(force_reply: true, selective: args[:x][:selective])
40
+ end
41
+
42
+ def send_DialogModSendForce_reply(args)
43
+ Telegram::Bot::Types::ReplyKeyboardRemove.new(remove_keyboard: true, selective:args[:x][:selective])
44
+ end
45
+
46
+ ###
47
+ def send_DialogElementSendInline_keyboardStatic(args)
48
+ args[:smsg][:reply_markup] = {
49
+ inline_keyboard: Dialog::ModSend.makeKeyboard(
50
+ args,
51
+ :inline,
52
+ args[:x][:exec][:DialogElementSendInline_keyboardStatic][:DialogModElementInline_keyboardButton])}
53
+ send_DialogElementSendBot_messageSend(args)
54
+ end
55
+
56
+ end
57
+ end
58
+ end
59
+ #
@@ -0,0 +1,51 @@
1
+ ######## ####### ######## ####### ######## ########
2
+ ## / / / / License \ \ \ \
3
+ ## Copyleft culture, Copyright (C) is prohibited here
4
+ ## This work is licensed under a CC BY-SA 4.0
5
+ ## Creative Commons Attribution-ShareAlike 4.0 License
6
+ ## Refer to the http://creativecommons.org/licenses/by-sa/4.0/
7
+ ######## ####### ######## ####### ######## ########
8
+ ## / / / / Code Climate \ \ \ \
9
+ ## Language = ruby
10
+ ## Indent = space; 2 chars;
11
+ ######## ####### ######## ####### ######## ########
12
+
13
+ module Dialog
14
+ module ElementSend
15
+ class << self
16
+
17
+
18
+ def send_DialogElementSendRecognizeCode(args)
19
+ name = "#{Dialog.config.path.render}/_tmpfiles/#{Dialog::Wrappers.downloadFile(args)}"
20
+ attrs, stderr_str, status = Open3.capture3('/usr/bin/zbarimg', "-q", name)
21
+
22
+ unless attrs == ""
23
+ Dialog.logger.debug "#### muxFqn #{attrs}"
24
+ response = attrs.split(':')
25
+ codeType = response[0]
26
+ response.shift
27
+ text = answer_DialogModSendRecognizeCommonAction_success(codeType, response.join)
28
+ else
29
+ text = answer_DialogModSendRecognizeCommonAction_fail
30
+ end
31
+ args[:smsg][:text] = text
32
+ args[:x][:dataRespRaw] = response
33
+ end
34
+
35
+ def answer_DialogModSendRecognizeCommonAction_success(codeType, response)
36
+ <<-HEREDOC
37
+ *Тип кода*: #{codeType}
38
+ *Содержание*: #{response}
39
+ HEREDOC
40
+ end
41
+
42
+ def answer_DialogModSendRecognizeCommonAction_fail
43
+ <<-HEREDOC
44
+ Изображение не содержит какой-либо код или сфотографировано не чётко.
45
+ HEREDOC
46
+ end
47
+
48
+ end
49
+ end
50
+ end
51
+ #
@@ -0,0 +1,42 @@
1
+ ######## ####### ######## ####### ######## ########
2
+ ## / / / / License \ \ \ \
3
+ ## Copyleft culture, Copyright (C) is prohibited here
4
+ ## This work is licensed under a CC BY-SA 4.0
5
+ ## Creative Commons Attribution-ShareAlike 4.0 License
6
+ ## Refer to the http://creativecommons.org/licenses/by-sa/4.0/
7
+ ######## ####### ######## ####### ######## ########
8
+ ## / / / / Code Climate \ \ \ \
9
+ ## Language = ruby
10
+ ## Indent = space; 2 chars;
11
+ ######## ####### ######## ####### ######## ########
12
+
13
+ module Dialog
14
+ module ElementSend
15
+ class << self
16
+
17
+ def send_DialogElementSendPermissionsLimit(args)
18
+ args[:api] = {:op => 'restrictChatMember'}
19
+ args[:smsg][:chat_id] = args[:mmsg][:fqndata][:o][:chat][:id]
20
+ args[:smsg][:until_date] = 0
21
+ args[:smsg][:can_send_messages] = false
22
+ args[:smsg][:can_send_media_messages] = false
23
+ args[:smsg][:can_send_other_messages] = false
24
+ args[:smsg][:can_add_web_page_previews] = false
25
+
26
+ return Dialog::BotApi.apiAction(args)
27
+ end
28
+
29
+ def send_DialogElementSendPermissionsNormal(args)
30
+ args[:api] = {:op => 'restrictChatMember'}
31
+ args[:smsg][:chat_id] = args[:mmsg][:fqndata][:o][:chat][:id]
32
+ args[:smsg][:can_send_messages] = true
33
+ args[:smsg][:can_send_media_messages] = true
34
+ args[:smsg][:can_send_other_messages] = true
35
+ args[:smsg][:can_add_web_page_previews] = true
36
+ return Dialog::BotApi.apiAction(args)
37
+ end
38
+
39
+ end
40
+ end
41
+ end
42
+ #
@@ -0,0 +1,33 @@
1
+ ######## ####### ######## ####### ######## ########
2
+ ## / / / / License \ \ \ \
3
+ ## Copyleft culture, Copyright (C) is prohibited here
4
+ ## This work is licensed under a CC BY-SA 4.0
5
+ ## Creative Commons Attribution-ShareAlike 4.0 License
6
+ ## Refer to the http://creativecommons.org/licenses/by-sa/4.0/
7
+ ######## ####### ######## ####### ######## ########
8
+ ## / / / / Code Climate \ \ \ \
9
+ ## Language = ruby
10
+ ## Indent = space; 2 chars;
11
+ ######## ####### ######## ####### ######## ########
12
+
13
+ module Dialog
14
+ module ElementSend
15
+ class << self
16
+
17
+ def send_DialogElementSendTdlib_chatCreate(args)
18
+ args[:smsg]['@type'] = 'createNewSupergroupChat'
19
+ args[:smsg]['title'] = 'test'
20
+ args[:smsg]['is_channel'] = false
21
+ args[:smsg]['description'] = 'description'
22
+ args[:tdlib][:cli].on_ready do |client|
23
+ group = client.broadcast_and_receive(args[:smsg])
24
+ Dialog.logger.debug "#### group created - #{group}"
25
+ end
26
+ ### CLEAN
27
+ Dialog.clear(args)
28
+ end
29
+
30
+ end
31
+ end
32
+ end
33
+ #
@@ -0,0 +1,38 @@
1
+ ######## ####### ######## ####### ######## ########
2
+ ## / / / / License \ \ \ \
3
+ ## Copyleft culture, Copyright (C) is prohibited here
4
+ ## This work is licensed under a CC BY-SA 4.0
5
+ ## Creative Commons Attribution-ShareAlike 4.0 License
6
+ ## Refer to the http://creativecommons.org/licenses/by-sa/4.0/
7
+ ######## ####### ######## ####### ######## ########
8
+ ## / / / / Code Climate \ \ \ \
9
+ ## Language = ruby
10
+ ## Indent = space; 2 chars;
11
+ ######## ####### ######## ####### ######## ########
12
+
13
+ module Dialog
14
+ module ElementSend
15
+ class << self
16
+
17
+ def send_DialogElementSendTdlib_messageSend(args)
18
+ args[:tdlib][:cli].on_ready do |client|
19
+ args[:smsg]['@type'] = 'sendMessage'
20
+
21
+ if args[:smsg][:chat_id] == args[:mmsg][:fqndata][:o][:from][:id]
22
+ client.fetch('@type' => 'createPrivateChat', 'user_id' => args[:smsg][:chat_id])
23
+ end
24
+
25
+ args[:smsg]['input_message_content'] = {"@type":"inputMessageText","text":{"text": args[:smsg][:text]}}
26
+ args[:smsg].delete('text')
27
+ Dialog.logger.catch "args[:smsg]::#{args[:smsg]}"
28
+ test = client.broadcast_and_receive(args[:smsg])
29
+ Dialog.logger.catch "test::#{test}"
30
+ end
31
+ ### CLEAN
32
+ Dialog.clear(args)
33
+ end
34
+
35
+ end
36
+ end
37
+ end
38
+ #
@@ -0,0 +1,38 @@
1
+ ######## ####### ######## ####### ######## ########
2
+ ## / / / / License \ \ \ \
3
+ ## Copyleft culture, Copyright (C) is prohibited here
4
+ ## This work is licensed under a CC BY-SA 4.0
5
+ ## Creative Commons Attribution-ShareAlike 4.0 License
6
+ ## Refer to the http://creativecommons.org/licenses/by-sa/4.0/
7
+ ######## ####### ######## ####### ######## ########
8
+ ## / / / / Code Climate \ \ \ \
9
+ ## Language = ruby
10
+ ## Indent = space; 2 chars;
11
+ ######## ####### ######## ####### ######## ########
12
+
13
+ module Dialog
14
+ module ModSend
15
+ class << self
16
+
17
+
18
+ def makeInline_query_resultArticle(args, props, viewId)
19
+ result = Array.new
20
+ props[:tProp].to_h.each do |row, hash_col|
21
+ Dialog.logger.debug "%%%%%%%% row - #{row}, hash_col - #{hash_col}"
22
+
23
+ hash_col.sort.each do |col, prop|
24
+ Dialog::ModSend.call_CompileElementFromAtoms(args, {fFqn: prop[:modSend][:fFqn], tFqn: prop[:modSend][:tFqn], tProp: prop[:modSend][:tProp][:value], add: true}, viewId)
25
+ base = args[:x][:send][args[:x][:muxFqn][4].to_sym][args[:x][:muxFqn][:g].to_sym]
26
+ result << {id: rand(1 .. 90000), type: "article", title: "#{prop[:tProp][:value]}", input_message_content: {message_text: prop[:modSend][:tProp][:value]}}
27
+ args[:x][:send][args[:x][:muxFqn][4].to_sym][args[:x][:muxFqn][:g].to_sym] = {}
28
+ end
29
+ end
30
+
31
+ Dialog.logger.debug "%%%%%%%%2 result - #{result}}"
32
+ return result
33
+ end
34
+
35
+ end
36
+ end
37
+ end
38
+ #
@@ -0,0 +1,40 @@
1
+ ######## ####### ######## ####### ######## ########
2
+ ## / / / / License \ \ \ \
3
+ ## Copyleft culture, Copyright (C) is prohibited here
4
+ ## This work is licensed under a CC BY-SA 4.0
5
+ ## Creative Commons Attribution-ShareAlike 4.0 License
6
+ ## Refer to the http://creativecommons.org/licenses/by-sa/4.0/
7
+ ######## ####### ######## ####### ######## ########
8
+ ## / / / / Code Climate \ \ \ \
9
+ ## Language = ruby
10
+ ## Indent = space; 2 chars;
11
+ ######## ####### ######## ####### ######## ########
12
+
13
+ module Dialog
14
+ module ModSend
15
+ class << self
16
+
17
+
18
+ def makeKeyboard(args, mode, keyboardButtons)
19
+ keyboard = Array.new
20
+ keyboardButtons.each do |row, hash_col|
21
+ # Dialog.logger.debug "%%%%%%%% row - #{row}, hash_col - #{hash_col}"
22
+ keyboard[row.to_i] ||= Array.new
23
+ hash_col.sort.each do |col, prop|
24
+ case mode
25
+ when :reply
26
+ keyboard[row.to_i] << {text: "#{prop[:tValue]}"}
27
+ when :inline
28
+ keyboard[row.to_i] << {text: "#{prop[:tValue]}", prop[:spec][:key] => "#{prop[:spec][:value]}"}
29
+ end
30
+ end
31
+ end
32
+
33
+ return keyboard.drop(1)
34
+ end
35
+
36
+
37
+ end
38
+ end
39
+ end
40
+ #
@@ -0,0 +1,98 @@
1
+ ######## ####### ######## ####### ######## ########
2
+ ## / / / / License \ \ \ \
3
+ ## Copyleft culture, Copyright (C) is prohibited here
4
+ ## This work is licensed under a CC BY-SA 4.0
5
+ ## Creative Commons Attribution-ShareAlike 4.0 License
6
+ ## Refer to the http://creativecommons.org/licenses/by-sa/4.0/
7
+ ######## ####### ######## ####### ######## ########
8
+ ## / / / / Code Climate \ \ \ \
9
+ ## Language = ruby
10
+ ## Indent = space; 2 chars;
11
+ ######## ####### ######## ####### ######## ########
12
+
13
+ module Dialog
14
+ module ModSend
15
+ class << self
16
+
17
+ def call_CompileElementFromAtoms(args, props, viewId)
18
+ args[:smsg] ||= {}
19
+
20
+ if props.has_key?(:add)
21
+ fFqn = props[:fFqn].to_sym
22
+ tFqn = props[:tFqn].to_sym
23
+ if args[:x][:exec].has_key?(fFqn)
24
+ args[:x][:exec][fFqn][tFqn] = props[:tProp]
25
+ end
26
+ atomMux(args, props, viewId, fFqn, tFqn)
27
+ else
28
+ fFqn = props[:tFqn].to_sym
29
+ args[:x][:exec][fFqn].each do |tFqn, prop|
30
+ # Dialog.logger.debug "@@@@@@@@@@@@@ 1 - fFqn::#{fFqn}, tFqn::#{tFqn}, props::#{props}"
31
+ atomMux(args, props, viewId, fFqn, tFqn)
32
+ end
33
+ end
34
+ end
35
+
36
+
37
+ def atomMux(args, props, viewId, fFqn, tFqn)
38
+ muxFqn = tFqn.to_s.split /(?=[A-Z])/
39
+ if muxFqn[0] == 'Dialog'
40
+ if muxFqn[1] == 'Mod' && muxFqn[2] == 'Send'
41
+ Dialog.logger.debug "#### muxFqn #{muxFqn}"
42
+ args[:x][:muxFqn] = {}
43
+ args[:x][:muxFqn][3] = "#{muxFqn[0]}#{muxFqn[1]}#{muxFqn[2]}"
44
+ args[:x][:muxFqn][4] = "#{muxFqn[0]}#{muxFqn[1]}#{muxFqn[2]}#{muxFqn[3]}"
45
+ args[:x][:muxFqn][5] = "#{muxFqn[0]}#{muxFqn[1]}#{muxFqn[2]}#{muxFqn[3]}#{muxFqn[4]}"
46
+ args[:x][:muxFqn][:g] = muxFqn[4]
47
+ run = "set_#{args[:x][:muxFqn][5]}"
48
+ Dialog.logger.debug " @@@ pre-atomMux sender #{run}"
49
+ begin
50
+ send(run.to_sym, args, fFqn, tFqn, props, viewId)
51
+ rescue NoMethodError => @e
52
+ step = @e.message.split('`')[1].split('\'')[0].split /(?=[A-Z])/
53
+ Dialog.logger.debug " @@@@@@@@@@@@@@@@@@@@ #{step.count} - #{@e.message}"
54
+
55
+ case step.count
56
+ when 6 #runner
57
+ begin
58
+ Dialog.logger.debug " @@@ pre-atomMux sender #{step.count} - #{tFqn}"
59
+ send("set_#{tFqn}".to_sym, args, fFqn, tFqn, props, viewId)
60
+ Dialog.logger.debug " @@@ atomMux sender #{step.count} - #{tFqn}"
61
+ rescue NoMethodError
62
+ setterDefault(args, fFqn, tFqn, muxFqn[5].downcase, step.count)
63
+ rescue => @e
64
+ raise
65
+ end
66
+ when 7 #setter
67
+ setterDefault(args, fFqn, tFqn, muxFqn[5].downcase, step.count)
68
+ end
69
+ rescue => @e
70
+ raise
71
+ end
72
+ end
73
+ end
74
+ end
75
+
76
+
77
+ def setter(args, fFqn, k, v)
78
+ Dialog.logger.debug "## SET to FQN #{fFqn} :: K:#{k}, V:#{v}"
79
+ case v
80
+ when 'True', 'true'
81
+ v = true
82
+ when 'False', 'false'
83
+ v = false
84
+ end
85
+
86
+ args[:smsg][k.to_sym] = v
87
+ end
88
+
89
+ def setterDefault(args, fFqn, tFqn, k, step)
90
+ Dialog.logger.debug " @@@ atomMux default pre-setter #{step} tFqn::#{tFqn} - #{k} :: #{args[:x][:exec][fFqn][tFqn]}"
91
+ setter(args, fFqn, k, args[:x][:exec][fFqn][tFqn][:value])
92
+ Dialog.logger.debug " @@@ atomMux default setter #{step} - #{k} :: #{args[:x][:exec][fFqn][tFqn][:value]}"
93
+ end
94
+
95
+ end
96
+ end
97
+ end
98
+ #
@@ -0,0 +1,27 @@
1
+ ######## ####### ######## ####### ######## ########
2
+ ## / / / / License \ \ \ \
3
+ ## Copyleft culture, Copyright (C) is prohibited here
4
+ ## This work is licensed under a CC BY-SA 4.0
5
+ ## Creative Commons Attribution-ShareAlike 4.0 License
6
+ ## Refer to the http://creativecommons.org/licenses/by-sa/4.0/
7
+ ######## ####### ######## ####### ######## ########
8
+ ## / / / / Code Climate \ \ \ \
9
+ ## Language = ruby
10
+ ## Indent = space; 2 chars;
11
+ ######## ####### ######## ####### ######## ########
12
+
13
+ module Dialog
14
+ module ModSend
15
+ class << self
16
+
17
+ ## Message
18
+ def set_DialogModSendGeneralMessage(args, fFqn, tFqn, props, viewId)
19
+ args[:api] = { op: 'sendMessage'}
20
+ send("set_#{tFqn}".to_sym, args, fFqn, tFqn, props, viewId)
21
+ end
22
+
23
+
24
+ end
25
+ end
26
+ end
27
+ #
@@ -0,0 +1,38 @@
1
+ ######## ####### ######## ####### ######## ########
2
+ ## / / / / License \ \ \ \
3
+ ## Copyleft culture, Copyright (C) is prohibited here
4
+ ## This work is licensed under a CC BY-SA 4.0
5
+ ## Creative Commons Attribution-ShareAlike 4.0 License
6
+ ## Refer to the http://creativecommons.org/licenses/by-sa/4.0/
7
+ ######## ####### ######## ####### ######## ########
8
+ ## / / / / Code Climate \ \ \ \
9
+ ## Language = ruby
10
+ ## Indent = space; 2 chars;
11
+ ######## ####### ######## ####### ######## ########
12
+
13
+ module Dialog
14
+ module ModSend
15
+ class << self
16
+
17
+
18
+ def set_DialogModSendGeneralChatId(args, fFqn, tFqn, props, viewId)
19
+
20
+ id = args[:x][:exec][fFqn][tFqn][:value]
21
+ case args[:x][:exec][fFqn][tFqn][:value]
22
+ when '{same}'
23
+ chat_id = args[:mmsg][:fqndata][:o][:chat][:id]
24
+ when '{user}'
25
+ chat_id = args[:mmsg][:fqndata][:o][:from][:id]
26
+ when /^[:fqndata]*/
27
+ id = "args[:mmsg]#{id}"
28
+ chat_id = binding.eval("#{id}")
29
+ else
30
+ chat_id = args[:x][:exec][fFqn][tFqn][:value]
31
+ end
32
+ setter(args, fFqn, 'chat_id', chat_id)
33
+ end
34
+
35
+ end
36
+ end
37
+ end
38
+ #