AHK Telegram MsgBox (Telegram_MsgBox)

Post your working scripts, libraries and tools
Spur
Posts: 1
Joined: 22 Jul 2014, 02:10

AHK Telegram MsgBox (Telegram_MsgBox)

25 Nov 2016, 04:33

Hi there
I was tired of sending me alerts via mail so I created a function to send me messages via telegram.
Telegram is a messenger like WhatsApp, but it has a API through you can send messages directly to your telegram and so to your phone.
Here is the code with two functions. One is the main function (Telegram_MsgBox) to send messages to telegram the other is just for the first setup. (an easy click-through to get the Bot Token and the Chat ID)

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus


I orientated the Telegram_MsgBox function on the AHK MsgBox function. But just in point of icons ;)
Telegram_MsgBox(Option, EmojiPosition, Text)
Option
Spoiler

EmojiPositon
Spoiler

Text
Spoiler


Hope you like this funcion and that it will help you. Here are some ideas for what telegram and ahk can be used:
Spoiler


I think telegram has a big potential and maybe sometime in the future we will have a lot of Telegram function. Because Telegram can do sooo much more :)
Sorry for my bad English.
Last edited by Spur on 25 Nov 2016, 11:46, edited 1 time in total.
SpecialG

Re: AHK Telegram MsgBox (Telegram_MsgBox)

25 Nov 2016, 10:30

Nice. Thanks for sharing. I'm testing it with an inputbox but can't send special characters yet.. lol
Feel free to share the image & video part too :beer:
I'm thinking of stuff i could detect locally or monitor on the web and forward to my mobile.
mustang
Posts: 5
Joined: 25 Apr 2017, 03:12

Re: AHK Telegram MsgBox (Telegram_MsgBox)

25 Apr 2017, 03:18

SUPER. Thanks you dear member for this script )))
I needed to post from AHK to telegram my monitoring system.
User avatar
moefr01
Posts: 56
Joined: 25 Nov 2015, 09:01
Location: Germany

Re: AHK Telegram MsgBox (Telegram_MsgBox)

05 May 2017, 09:56

nice code... spur thx :clap:

looking for a solution to send german letters in specified telegram-Messages so I decided to use StringReplace:

Code: [Select all] [Download] (Unbenannt.ahk)GeSHi © Codebox Plus

StringReplace, text, text, ä,       `%C3`%A4    , All
StringReplace, text, text, ö, `%C3`%B6 , All
StringReplace, text, text, ü, `%C3`%BC , All
StringReplace, text, text, Ä, `%C3`%84 , All
StringReplace, text, text, Ö, `%C3`%96 , All
StringReplace, text, text, Ü, `%C3`%9C , All
StringReplace, text, text, Space, `%20 , All
StringReplace, text, text, ß, `%C3`%9F , All
StringReplace, text, text, °, `%C2`%B0 , All

The variable %text% contents the basic text-string (with german letters) and afterwards the converted code for Telegram ... hope someone could do with it :dance:

happy coding... moefr01
mustang
Posts: 5
Joined: 25 Apr 2017, 03:12

Re: AHK Telegram MsgBox (Telegram_MsgBox)

17 Jun 2017, 06:10

Who now how send other emoji ? example this https://emojipedia.org/man-playing-handball/
how past code U+1F93E ?
User avatar
moefr01
Posts: 56
Joined: 25 Nov 2015, 09:01
Location: Germany

Re: AHK Telegram MsgBox (Telegram_MsgBox)

18 Jun 2017, 01:30

mustang, use this as own ico:

Telegram_MsgBox("%F0%9F%A4%BE",2,RandomVariable)

You can see the working html-code on your browser's statusline by pointing your mouse over the unicode U+1F93E at line Codepoints of your emojipedia.org site.
8-) other Emojis work too... give them a try!
;) moefr01
mustang
Posts: 5
Joined: 25 Apr 2017, 03:12

Re: AHK Telegram MsgBox (Telegram_MsgBox)

18 Jun 2017, 16:47

not worked :( only square. i tryed. work only old emoji

Image
User avatar
moefr01
Posts: 56
Joined: 25 Nov 2015, 09:01
Location: Germany

Re: AHK Telegram MsgBox (Telegram_MsgBox)

19 Jun 2017, 03:49

try it with
FileEncoding, UTF-8
at the beginning of your ahk-code
edwardlobo

Re: AHK Telegram MsgBox (Telegram_MsgBox)

24 Aug 2017, 09:19

If there is "&" in the message or variable the message in truncated
is there any way around it
User avatar
moefr01
Posts: 56
Joined: 25 Nov 2015, 09:01
Location: Germany

Re: AHK Telegram MsgBox (Telegram_MsgBox)

24 Aug 2017, 13:52

Append the following line into the StringReplace-block of my suggestion regarding german Umlauts (see above):

Code: [Select all] [Download] (Unbenannt.ahk)GeSHi © Codebox Plus

StringReplace, Infotext, Infotext, &, `%26, All

should work for any ampersand in your string. :wtf:

Return to “Scripts and Functions”

Who is online

Users browsing this forum: Delta Pythagorean and 12 guests