Code Monkey home page Code Monkey logo

Comments (7)

vysheng avatar vysheng commented on May 21, 2024

Client now supports lua callbacks. You can ring terminal bell in callback function.

from tg.

dannluciano avatar dannluciano commented on May 21, 2024

@vysheng exists any sample of how do this?

from tg.

vysheng avatar vysheng commented on May 21, 2024

You can use test.lua as a sample. To use it you should compile source with lua support (it is compiled with it by default) and start with '-s test.lua' param.

from tg.

cippaciong avatar cippaciong commented on May 21, 2024

This is not working for me. I can't see any change in my WM when I receive a message.
Maybe I misinterpreted how this is supposed to work.

from tg.

vysheng avatar vysheng commented on May 21, 2024

You can write something like that:
bell.lua:
1 started = 0
2 our_id = 0
3
4
5 function on_msg_receive (msg)
6 if started == 0 then
7 return
8 end
9 if msg.out then
10 return
11 end
12 print ("\a")
13 end
14
15 function on_our_id (id)
16 our_id = id
17 end
18
19 function on_secret_chat_created (peer)
20 end
21
22 function on_user_update (user)
23 end
24
25 function on_chat_update (user)
26 end
27
28 function on_get_difference_end ()
29 started = 1
30 end
31
32 function on_binlog_replay_end ()
33 end

Then start app with param '-s bell.lua'
This code should print message '\a' (bell symbol) on every incomming message.

from tg.

cippaciong avatar cippaciong commented on May 21, 2024

Yay, that's working!
Thank you so much =)

from tg.

dannluciano avatar dannluciano commented on May 21, 2024

Very Nice, guys!

from tg.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.