Lanka Developers Community

    Lanka Developers

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Shop
    1. Home
    2. MrCentimetre
    • Profile
    • Following 7
    • Followers 3
    • Topics 5
    • Posts 37
    • Best 11
    • Controversial 0
    • Groups 7

    Mr Centimetre

    @MrCentimetre

    We are Analog beings in Digital World 🙂

    25
    Reputation
    331
    Profile views
    37
    Posts
    3
    Followers
    7
    Following
    Joined Last Online

    MrCentimetre Unfollow Follow
    Telegram Bot Development Ethical Hacking & Pen-Testing Node.js Web Development Game Development Linux Help Google API

    Best posts made by MrCentimetre

    • Build Your Telegram Python Bot ( Sinhala Tutorial )

      පලවෙනියටම ස්තූතිවන්ත වෙන්න ඕනි Sayumi Amarasinghe අක්කට මේ වගේම Telegram Bot කෙනෙක් JSON වලින් හදන හැටි කියලා දුන්නට :)

      අද මම කියලා දෙන්න යන්නේ ඒ වගේම Telegram Bot කෙනෙක් Python වලින් හදන හැටි 🙃
      අපි පිලිවෙලට මුල ඉදන් වැඩේ කරමු. හොදේ :)

      1. මුලින්ම මේ වැඩේට ඉතිං ඔයා Telegram ඇප් එක ඩවුන්ලෝඩ් කරන් ඉන්නෝනි. ඒක මෙන්න මේ ලිංක් එකෙන් කරගන්න පුලුවනි.

      2. Account එකක් හදන වැඩේ නම් මම කියලා දෙන්නේ නෑ.ඒක ඉතිං ඔයා තනියම කරගන්න.තනියම කරගන්නත් එකක් තියෙන්න එපැයි 😜

      3. දැන් ඔයාට උඩින්ම පේන්න තියෙනවා නේද Search Bar එකක්.ඔව් ඔව් ඒක තමයි. අන්න එතන @BotFather ටයිප් කරන්න.

      0_1564143238721_5742435f-3950-40a4-8d7f-87c4e575c51d-image.png

      1. දැන් Start කියන එක Click කරන්න.

      විශේෂයෙන්ම මතක් කරන්න ඕනි මේක Python හා සම්බන්ධ වැඩක් නිසා මම බලාපොරොත්තු වෙනවා ඔයාලත් Telegram Desktop ඇප් එක use කරනවා ඇති කියලා. මොකද ඒ හා සම්බන්ධ පිංතූරයි මම දාන්නේ. කොහොමත් Android App එකේ කියලත් වෙනසක් නැහැ. Desktop නොවුනත් මේ පිලිවෙලටම කරන්න.

      0_1564143741746_624b62e9-2434-4ac2-8959-6eeac7b25952-image.png

      1. ඊටපස්සේ /newbot කියන command එක දීලා අලුතෙන් ඔයාගෙම බොටෙක් හදාගන්න ඕනි. එකේදි මුලින්ම ඔයා ඔයාගේ Bot ට නමක් දෙන්න.

      0_1564143969099_c584c825-a362-4d72-bf0f-8a9c586916d7-image.png

      1. දැන් අපේ බොටාට username එකක් දෙන්න ඕනි. එකේදි අවසානෙට bot කියන කොටස එකතු කරන්න. උදාහරණයක් විදිහට ඔයාට ඕනි නම් ඔයාගේ නම දාලා bot කෙනෙක් හදන්න ඒ හදන බොටාට nimsarabot හෝ nimsara_bot වගේ username එකක් දෙන්න පුලුවනි.

      0_1564144193580_ad59e6b5-957f-46d8-b449-1577cebf6a65-image.png

      1. හරි ඔන්න දැන් ඔයාට එයාලගෙන් message එකක් එයි ඔයාගෙ බොටාගේ API Token එකත් එක්කම.මේක තමා අපිට වැදගත්ම කොටස.ඒක කාටවත් දෙන්නවත් නැති කරගන්නවත් එපා හොදේ.
        ආහ් අනිත් එක.මේ token එක try කරන්නත් එපා.මොකද මම ඒක revoke කරලා තියෙන්නේ. :p

      0_1564144374777_64888b39-51fa-4575-a665-86e6ca1b3c00-image.png

      1. දැන් අපි coding වැඩ ටික පටන් ගමූ.මේකට ඕනා Python. අලුත් version එක තියෙනවනම් තවත් හොදයි. කොහොමත් ඒක install කරගන්න එක ඔයාගේ වැඩක්. ඒක Google කරලා හොයලා බලන්න. දැන් ඔයා cmd එක open කරගන්න. cmd කිව්වේ මොකක්ද කියලා නම් අහන්න එපා :p

        දැන් cmd එකේ මෙන්න මෙහෙම ටයිප් කරලා enter ඔබන්න. 👇

                                         pip3 install python-telegram-bot
      

      Install වීම Success නම් වඩේ ගොඩ :) නැත්තම් පහලින් කමෙන්ට් එකක් දාන්න.

      1. මම සම්පූර්ණ code එකම පහලින් දාන්නම්. ඒක python අලුත් file එහෙකට copy කරගන්න. ඒ code එකේ imoprt කරපු libraries ගැන වගේම තව දේවල් ගැන එකින් එක විස්තර කරගන්න ඕනිනම් මේ ලිංක් එකෙන් බලන්න.
      from telegram.ext import Updater, InlineQueryHandler, CommandHandler
      import requests
      import re
      
      def get_url():
          contents = requests.get('https://random.dog/woof.json').json()    
          url = contents['url']
          return url
      
      def bop(bot, update):
          url = get_url()
          chat_id = update.message.chat_id
          bot.send_photo(chat_id=chat_id, photo=url)
      
      def main():
          updater = Updater('YOUR_TOKEN')
          dp = updater.dispatcher
          dp.add_handler(CommandHandler('bop',bop))
          updater.start_polling()
          updater.idle()
      
      if __name__ == '__main__':
          main()
      
      1. ඔන්න ඕකේ තියේ නේද YOUR_TOKEN කියලා කොටසක්.අන්න එතනට ඔයාගේ අර හදාගත්තු බොටාගේ TOKEN එක දාන්න.

      11.හරි දැන් වැඩේ හරි වගේ තමා.දැන් python file එක run කරන්න. මතක් කරලා save කරන්න. නැත්තම් run කරන්න බෑ. 😁

      1. ඕක run වෙලා තියෙද්දිම අර ඔයාට ආපු මැසේජ් එකේ මේ ලිංක් එක ක්ලික් කරලා බොටාව start කරන්න.

      0_1564145447476_335e4054-2ee1-4ddc-8815-6c40d726cfa6-image.png

      1. start කලාට මදි , දැන් එයාට /bop කියලා ටයිප් කරලා මැසේජ් එකක් යවන්න.

      0_1564145598971_68f34649-b6e9-4667-a165-127bb6aeb75e-image.png

      1. දැන් ඔයාට මෙන්න මේ වගේ අගනා බව්වෙක්ගේ ෆොටෝ එකක් එයි. ඔය command එක යවන යවන සැරේට එක එක බව්වන්ගේ ෆොටෝ ගන්න පුලුවන් :p

      0_1564145709404_b87fd920-2157-41f3-9c7e-8c5140a44157-image.png

      එහෙනම් වැඩේ ඉවරයි. ඔයත් මේ වගේ කෙනෙක් හැදුවනම් පහලින් එයාගේ username එක දාන්න. මගේ බව්වෝ බලන්න මේ ලිංක් එකෙන් යන්න :)

      ඔයත් ටෙලිග්‍රෑම් ඉන්නෝ නම් අපේ Channel එකත් එක්ක මේ ලිංක් එකෙන් එකතු වෙන්න 😊

      ඒනම් සුභ දවසක්. මොකක්ම හරි ප්‍රශ්නයක් උනොත් comment එකක් දාන්න. වැඩේ හොද නම් Quote එක Up කරන්න 😉

      posted in AI Programming
      MrCentimetre
      MrCentimetre
    • Mora UXplore 1.0 - University of Moratuwa IEEE Student Branch

      c516f658-5c2a-4806-aac1-71297db5b0fe-WhatsApp Image 2023-04-12 at 11.06.15.jpg

      " Even the greatest was once a beginner. Don't be afraid to take that first step "
      - Muhammad Ali

      Mora UXplore 1.0 is a UI/UX designing competition for undergraduates from any university. It aims to offer a platform for them to explore, learn, and enhance their skills in this field. 🤩✨

      🔴 REGISTRATION IS NOW OPEN 🔴

      Click the link below and take the first step to be the best👇
      https://morauxplore.lk

      For more info join with our Facebook Event:
      https://fb.me/e/2AyV3rg8Q

      Caption by- D.M.M. Shehan
      Design by- Dilina Raveen

      -Inspired by PASSION to Transform beyond EXCELLENCE-

      #MoraUXplore1.0
      #IEEESBUOM
      #TERM22/23

      posted in Events ( Free & Paid )
      MrCentimetre
      MrCentimetre
    • RE: Android සිංහලෙන් Video Series

      සිංහලෙන් තියෙන එක නම් වටිනවා <3 මං හිතන්නේ ඔයාගේ අදහස්වලට සමාන අදහස් ටිකක් මේ ලිංක් එකේ තියෙනවා.
      https://e-apilk.com/about-us/

      දිගටම කරගෙන් යන්න. හදවතින්ම සුබ පතනවා 😍

      posted in Android Development
      MrCentimetre
      MrCentimetre
    • RE: මොනවද මේ RANSOMWARE?

      @Kalana මේ ක්‍රමේ තමා දැනට ලෝකේ තියෙන එකම ක්‍රමේ මේකෙන් හොදටම බේරෙන්න. ඒත් 100% ක්ම recover වෙනවා කියලා නම් හිතන්න අමාරුයි. හොදම දේ මේකෙන් ආරක්ෂා වෙන්න පූර්වෝපායන් ගන්න එක තමා ;)

      posted in Blogs
      MrCentimetre
      MrCentimetre
    • Telegram Bot සම්බන්ධව

      Telegram සමාජ ජාලය කියන්නේ විශේෂයෙන්ම Developers ලට වැදගත් වෙන Platform එකක්. ඉතිං මේකේ තියෙන Bot ලා Develope කරන්න ඕනෙම කෙනෙක්ට පුලුවන්. ඒ සම්බන්ධව Tutorial ටිකක් කාටහරි පෝස්ට් කරන්න පුලුවන්නම් ගොඩක් වටිනවා 🙂

      posted in AI Programming
      MrCentimetre
      MrCentimetre
    • RE: ශ්‍රී ලංකාවට Google Crowdsource!

      Google Translate එක ගැන කතා කරනවනම් මමත් විනෝදාංශයක් විදිහට මේ Translate Community එකට උදව් කරනවා සිංහල භාෂාව නිවැරදිව translate කරලා දෙන්න.ඉතිං මේ ලිංක් එකෙන් ගියොතින් ඔයාටත් පුලුවන් මේකට ෆුල් සප් එක දෙන්න.

      අපි පොඩ්ඩ පොඩ්ඩ වෙනස් කරමු.එතකොට දන්නෙම නැතුව ගොඩක් දේවල් වෙනස් වෙයි ;)

      posted in Blogs
      MrCentimetre
      MrCentimetre
    • RE: Telegram bot එකක් අපිම හදාගන්නෙ මෙහෙමයි

      Wade niyamai :) python eken programm kran hati kiyala denna puluwannam watinawa.mokada hugak ayata familiar ekane.goo job :*

      posted in AI Programming
      MrCentimetre
      MrCentimetre
    • RE: COVID19 Virtual Assistant Sri Lanka ...

      adoo patta ekah.voice chatbot ehema 😍

      posted in Announcements
      MrCentimetre
      MrCentimetre
    • RE: HTML5 සිංහල පරිවර්තනය

      Cool bro :)

      posted in Front-End Development
      MrCentimetre
      MrCentimetre
    • RE: how to insert data to a txt file from a c++ program

      Good job bro :)

      posted in Programming
      MrCentimetre
      MrCentimetre

    Latest posts made by MrCentimetre

    • Mora UXplore 1.0 - University of Moratuwa IEEE Student Branch

      c516f658-5c2a-4806-aac1-71297db5b0fe-WhatsApp Image 2023-04-12 at 11.06.15.jpg

      " Even the greatest was once a beginner. Don't be afraid to take that first step "
      - Muhammad Ali

      Mora UXplore 1.0 is a UI/UX designing competition for undergraduates from any university. It aims to offer a platform for them to explore, learn, and enhance their skills in this field. 🤩✨

      🔴 REGISTRATION IS NOW OPEN 🔴

      Click the link below and take the first step to be the best👇
      https://morauxplore.lk

      For more info join with our Facebook Event:
      https://fb.me/e/2AyV3rg8Q

      Caption by- D.M.M. Shehan
      Design by- Dilina Raveen

      -Inspired by PASSION to Transform beyond EXCELLENCE-

      #MoraUXplore1.0
      #IEEESBUOM
      #TERM22/23

      posted in Events ( Free & Paid )
      MrCentimetre
      MrCentimetre
    • RE: Join the Festivities! Win a Free T-Shirt by Becoming a Part of Lanka Developers Community this New Year!

      Done!

      #NewYearGiveaway
      #WinWithLankaDevelopers
      #JoinOurCommunity
      #FreeTShirts
      #ContributeToWin

      posted in Announcements
      MrCentimetre
      MrCentimetre
    • RE: We wish you all Happy New Year 2021

      Same to you bro

      posted in Announcements
      MrCentimetre
      MrCentimetre
    • RE: Udemy Free Courses (8 H remaining) Enroll past

      Thanks bro

      posted in Announcements
      MrCentimetre
      MrCentimetre
    • RE: Programming මුල සිට සරලව සිංහලෙන් (Including OOP) ✅

      Clear & Great post :) Thanks bro <3

      posted in Programming
      MrCentimetre
      MrCentimetre
    • RE: Premium Giveaway එකක් promotion දෙයක් එක්ක එකට එකතු කරලා දෙන්නේ.

      Ada 25 :| adane dakke meka ithn

      posted in Announcements
      MrCentimetre
      MrCentimetre
    • RE: Share your knowledge and experience and win a t-shirt

      @cody aluthin gahanawada?

      posted in Announcements
      MrCentimetre
      MrCentimetre
    • RE: Programming මුල සිට සරලව සිංහලෙන් (Including OOP) ✅

      great bro. keep it up <3

      posted in Programming
      MrCentimetre
      MrCentimetre
    • RE: Learn Adobe XD part #1 ❤️

      superb bro. thank you.

      posted in UI / UX
      MrCentimetre
      MrCentimetre
    • RE: Useful Udemy Coursers

      @Dee Thanks bro <3

      posted in General Discussion
      MrCentimetre
      MrCentimetre