Gangsta: A Telegram Chatbot with Python from scratch

Поделиться
HTML-код
  • Опубликовано: 16 сен 2024

Комментарии • 221

  • @SouravJohar
    @SouravJohar  6 лет назад +33

    Check the description for the code and all links mentioned!

    • @yar13singh57
      @yar13singh57 6 лет назад +1

      You Got my attention. Good Job

    • @mindfulpurpose6586
      @mindfulpurpose6586 5 лет назад +1

      I would like you to build me an automated telegram engagement group bot. We have hundreds of accounts that want to participate an a likes/comments engagement group. Probably a Dx5 or Dx10 group. I want the bot to automatically check for leechers, warn people and ban people. I also want to be able to post in the group without having to meet the same requirements to like/comment everyone else in my group has too. If you would like to talk more look me up on Instagram and DM me. @igbrandbuilder

    • @mariiarogina6546
      @mariiarogina6546 4 года назад +1

      Hello! I have the KeyError where updates=updates['result']. Please help! Otherwise throws no errors.
      I am upset, it worked nicely at first
      Earlier I had an error at line 8, in __init__
      self.token = self.read_token_from_config_file(config)
      TypeError: read_token_from_config_file() takes 1 positional argument but 2 were given
      BUT: pylinting helped to eliminate the error.
      As well as there was an error at , line 3, in
      bot=telegram_chatbot("config.cfg")
      Py-linting also helped

    • @abhinavsharma3819
      @abhinavsharma3819 4 года назад

      I have created a Telegram not for news
      Please check
      levelup.gitconnected.com/create-a-telegram-news-bot-in-less-than-10-minutes-e558e3fd1db6

    • @lbdev4978
      @lbdev4978 4 года назад

      @@mindfulpurpose6586 Hey if you are still intrested in it i can build one for you.

  • @anonanon9634
    @anonanon9634 3 года назад +10

    "What should we make our chatbot do?"
    "Speak Gangsta, of course"
    I've subscribed

  • @KartikayBhutani
    @KartikayBhutani 5 лет назад +6

    Amazing work man! You explained the backend of what other packages do!

  • @prithabhattacharya8629
    @prithabhattacharya8629 4 года назад +4

    That is a really nice video to begin with. Thank you so much for this :D

  • @paul9659
    @paul9659 5 лет назад +10

    really helpful , specially for me that i've just started learning

  • @emanuelecapone242
    @emanuelecapone242 4 года назад +5

    YOU SAVED ME ANOTHER TIME I LOVE YOU

  • @saddamshah5964
    @saddamshah5964 4 года назад +7

    Amazing Job Man really like your way of explaining the things. I understood every thing Thanks a lot :)

  • @TalAlon
    @TalAlon 2 года назад

    Sourav, this was a comprehensive, and to-the-point tutorial. This is how a tutorial should be made. well done.

  • @therealogcrypto8765
    @therealogcrypto8765 3 года назад +1

    Good video man 👏 I do like the "Gangsta talk"
    .
    Hey Dawwwg! sup Yo
    I be goin ta chill
    .
    😂😂😂

  • @alexalbon8274
    @alexalbon8274 3 года назад +3

    The Man, The Myth, The Legend

  • @Vishal-sk4oh
    @Vishal-sk4oh 4 года назад +1

    wow! just what i was looking for to get started. great explanation man!

  • @sthefanocarvalho2823
    @sthefanocarvalho2823 3 года назад

    That was exactly what I needed. Very efficient. Thank you.

  • @bobman6966
    @bobman6966 3 года назад

    Nice one from you Sourav. It really helped me.

  • @jbg9001
    @jbg9001 3 года назад

    Simple and to the point ! Great tutorial

  • @govindkatyura7485
    @govindkatyura7485 5 лет назад +3

    Great work brother 👍👍

  • @ishanpand3y
    @ishanpand3y 4 года назад

    Well done really its a great helping video for beginners like me. Instantly subscribed. And keep posting such amazing content.

  • @yamatouchiha1245
    @yamatouchiha1245 5 лет назад +1

    Cool dude, now i clearly can see what i imagine is not a dream after all. thanks
    Additionally for the telegram bot did you have to purchase a domain?

  • @Rama-xw9mx
    @Rama-xw9mx 3 года назад

    Really thanks from my side
    And I am Sue from Cave Story

  • @DavidRajM
    @DavidRajM 5 лет назад

    Awesome yaar...Great knowledge you have..thanks for sharing..

  • @EnglishRain
    @EnglishRain 4 года назад

    Fantastic tutorial man, massive respek!

  • @zahidahmed5151
    @zahidahmed5151 5 лет назад

    Amazing Video Dude! Great Explanation

  • @ILJaLeiko
    @ILJaLeiko 6 лет назад

    Nice work, man ;) Thanks for sharing

  • @0m4n1
    @0m4n1 4 года назад

    a very well explained .. thank you.

    • @abhinavsharma3819
      @abhinavsharma3819 4 года назад

      I've created a Telegram not for news
      Please check
      levelup.gitconnected.com/create-a-telegram-news-bot-in-less-than-10-minutes-e558e3fd1db6

  • @thewhistler121
    @thewhistler121 5 лет назад

    Very nice tutorial ! Greatly Explained. Helped me a lot

  • @temurergashev
    @temurergashev 4 года назад +1

    Loved it man

  • @TahaCodes
    @TahaCodes 5 лет назад

    Hey friend, It was an absolutely great tutorial. Thanks

  • @paddy6953
    @paddy6953 4 года назад

    Best video ..keep uploading!

  • @mohammadrezakarimi2400
    @mohammadrezakarimi2400 4 года назад

    thanks a lot, I write my first bot with your tutorials

  • @fasikagh6192
    @fasikagh6192 3 года назад

    Pure genius

  • @sanjaybhatikar
    @sanjaybhatikar 4 года назад

    Nice video, very clearly explained, thanks 🙏

  • @staciharrison3268
    @staciharrison3268 4 года назад

    You're Awesome Dude!! My dream is to be able to code like you do....

  • @shailsingh4762
    @shailsingh4762 6 лет назад

    Good explanation and best way to make bot

  • @shubhamthakare295
    @shubhamthakare295 5 лет назад +1

    you should try writing blogs as well in the side so programmers who re following you will refer to it without missing any instrution or we guys can crosschecck

  • @zevarbordachyova3097
    @zevarbordachyova3097 4 года назад

    Amazing! Thanks a lot!

  • @amirmasoudlanjan6714
    @amirmasoudlanjan6714 4 года назад

    It was more than useful, thank you

  • @rohitjakhar9284
    @rohitjakhar9284 4 года назад +1

    Good work

  • @arjunpatidar6332
    @arjunpatidar6332 5 лет назад +2

    Traceback (most recent call last):
    File "C:/Users/thispc/PycharmProjects/telegrambot/server.py", line 16, in
    updates = updates["result"]
    KeyError: 'result'
    what changes i do this ???

    • @thomasshaw4855
      @thomasshaw4855 4 года назад

      I got the same ERROR. Any fixes?

    • @fagallardo
      @fagallardo 4 года назад +2

      def get_updates(self, offset=None):
      url = self.base + "getUpdates?timeout=100"

  • @programmertangguh1257
    @programmertangguh1257 4 года назад

    Really really helpful!

  • @nyanRETARD
    @nyanRETARD 5 лет назад +2

    in server.py. why do you refer to telegram_bot as just 'bot' ? the class name is telegram_chatbot in bot.py file

    • @collinswanyeki
      @collinswanyeki 4 года назад +2

      add this line before the "make_reply" function -->
      bot = telegram_chatbot("config.cfg")

    • @shivam9982
      @shivam9982 4 года назад

      Yes, he wrote 'bot', someone explain me please!

  • @VenomRaiders
    @VenomRaiders 5 лет назад +2

    indians are creative

  • @Geolimber
    @Geolimber 5 лет назад

    Great tutorial, thanks!

  • @bendingreality8176
    @bendingreality8176 3 года назад

    Please make some videos for linux beginner specially kali... Plz bro... Ur explanation is too good

  • @kirmada5115
    @kirmada5115 4 года назад +1

    not working bro shows :
    updates = updates["result"]
    TypeError: 'NoneType' object is not subscriptable

    • @mariiarogina6546
      @mariiarogina6546 4 года назад

      did you find the solution?

    • @mariiarogina6546
      @mariiarogina6546 4 года назад

      u know, my husband came home from work and helped me out. If you wrote the code by the video there are a couple of mistakes:
      You should remove slashes in these lines: 'getUpdates?timeout=100'
      and
      'sendMessage?chat_id={}&text={}'
      because the slash is already present here.
      "api.telegram.org/bot{}/"
      BUT the source code goes without slashes. if it raises errors it may be some temporary problems with config. Yesterday teacher's code also threw errors (without slashes), today it works well

    • @kirmada5115
      @kirmada5115 4 года назад

      @@mariiarogina6546 No, I didn't find any solution, and thanks for helping I'll surely try . Thank you very much!

    • @melihsaitkarabulut7948
      @melihsaitkarabulut7948 3 года назад

      @@mariiarogina6546 thanks a lot. it worked :)

  • @Anmolg
    @Anmolg 6 лет назад

    Awesome.

  • @deepsharma5412
    @deepsharma5412 4 года назад

    wow
    great boss

  • @joeltovarramos2250
    @joeltovarramos2250 3 года назад

    you are amazing

  • @mihirsidhdhapurasensei
    @mihirsidhdhapurasensei 4 года назад

    great man. i really like it.

  • @jibinkoshy9804
    @jibinkoshy9804 3 года назад +1

    Traceback (most recent call last):
    File "server.py", line 24, in
    from_ = item["message"]["from"]["id"]
    KeyError: 'message'
    I'm getting this error when I run "server.py"

    • @yudaohe8324
      @yudaohe8324 3 года назад

      @@the_wardaddy i believe if a previous text message is edited, u will get this error message

  • @Sagar_Tachtode_777
    @Sagar_Tachtode_777 4 года назад

    great stuff. thanks for the detailed video.
    can't we use the .ipynb file instead .py file?

  • @TheBombsquadGame
    @TheBombsquadGame 4 года назад

    Thank you... it worked.

  • @pratikpakhale3681
    @pratikpakhale3681 4 года назад

    excellent!!!

  • @mahmoudabdelsattar8860
    @mahmoudabdelsattar8860 4 года назад

    big thanks from Egypt to you , THANKS A LOT,
    any telegram related to images and videos?

  • @sekudha
    @sekudha 4 года назад

    You goood dawg!

    • @abhinavsharma3819
      @abhinavsharma3819 4 года назад

      I've created a Telegram not for news
      Please check
      levelup.gitconnected.com/create-a-telegram-news-bot-in-less-than-10-minutes-e558e3fd1db6

  • @arpansingh2116
    @arpansingh2116 3 года назад

    so cool

  • @onderyilmz_
    @onderyilmz_ 4 года назад

    Good job :) Thanks

  • @BIJINICB
    @BIJINICB 5 лет назад +1

    Hi, my bot reply is not working.need to update the JSON file each time. What to do to make an automatic reply to the user? How to make this bot intelligent? Need help on this plzz..

  • @SwapravaNath
    @SwapravaNath 4 года назад

    that was amazing

  • @_Kanad_Patil_TE_IT
    @_Kanad_Patil_TE_IT 4 года назад

    You are just AweSome ! men

  • @zoaldick1
    @zoaldick1 5 лет назад +1

    Found an issue:
    File "server.py", line 3, in
    bot = telegram_chatbot("config.cfg")
    File "C:\Users\Wesley\Desktop\bot project\bot.py", line 8, in __init__
    self.token = self.read_token_from_config_file(config)
    TypeError: read_token_from_config_file() takes 1 positional argument but 2 were given

    • @hvsebas
      @hvsebas 4 года назад

      I had the very same issue. How did you fixed it?

    • @epaphras9083
      @epaphras9083 4 года назад

      @@hvsebas include self in the read token method in bot.py
      def read_token_from_config_file(self, config):
      ...

  • @srabonx
    @srabonx 3 года назад

    So you don't need webhooks for these functions.

  • @amanojha924
    @amanojha924 4 года назад

    What are you using to program this bot.. I mean like are you using some application like visual studio or something?

  • @Fowrli
    @Fowrli 3 года назад

    awesome bro! I was learning from every second of that god damn tutorial. thanks a lot

  • @weare4126
    @weare4126 3 года назад +1

    Which app u use for running api

  • @dragobytes
    @dragobytes 5 лет назад +1

    i am got issue, can you help?
    Traceback (most recent call last):
    File "server.py", line 17, in
    updates = updates["result"]
    KeyError: 'result

    • @madhuripalanivelu8061
      @madhuripalanivelu8061 5 лет назад +2

      Hey! I faced a similar issue. I found that it was because of an extra '/' in the get_updates method. In the base URL, he has already added a '/' at the end. At 6:56, he's added another one. I removed that and it worked. Check out his GitHub code, as it's corrected there!

    • @tonkotsu_noodles
      @tonkotsu_noodles 3 года назад

      @@madhuripalanivelu8061 Someone should pin your comment. Good observation. Thanks

  • @NonDomForever
    @NonDomForever 3 года назад +1

    Which theme are you using and which font?

    • @AJ1234949
      @AJ1234949 3 года назад

      good question have you perhaps found an answer ?

  • @priyanshusingh4459
    @priyanshusingh4459 3 года назад

    I was following your steps while making the bot but the screen that comes in my browser of type that is at 2.54 in your video , how to convert in way you have done in json ??

  • @zeroxhunter826
    @zeroxhunter826 3 года назад

    Hey, what software did you use for presentation? Please let me know

  • @PritishMishra
    @PritishMishra 4 года назад +1

    Its not working in my case
    It does not send any message

  • @ankitasharma4872
    @ankitasharma4872 5 лет назад

    Hi Sourav.... nice video... Could you make something to get messages from a social group like bitcoin in telegram via this bot API

  • @jayeshsuryawanshi213
    @jayeshsuryawanshi213 3 года назад

    Please teach python! Your videos are great 👍

  • @jagannathgirisaballa
    @jagannathgirisaballa 4 года назад

    Hi....I am getting the following error when i try to run the code in python anywhere. Can you please help?
    Traceback (most recent call last):
    File "/home/gjagan/TelegramChatbot/server.py", line 25, in
    reply = make_reply(message)
    File "/home/gjagan/TelegramChatbot/server.py", line 10, in make_reply
    reply = gizoogle.text(msg)
    File "./gizoogle.py", line 15, in text
    giz_text = giz[39].strip("
    ") # Hacky, but consistent.
    IndexError: list index out of range

  • @ngrobin
    @ngrobin 4 года назад

    Sorry, what is the editor you used for creating the codes? & the part about dependencies, where to download or install it please?

    • @katie6400
      @katie6400 4 года назад +1

      Python I assume
      Just google spyder download (fyi, spyder=python), it is free

  • @ratanakpanhaduong1749
    @ratanakpanhaduong1749 3 года назад

    what is the extension u used to read json file on google chrome bro?

  • @stewiegriffin8384
    @stewiegriffin8384 4 года назад +1

    what browser do you use?

  • @Cristiano_3_6_9
    @Cristiano_3_6_9 3 года назад

    How to send react msg on any msg using python

  • @sajzadhasan7537
    @sajzadhasan7537 4 года назад

    Great video, can you please tell what to be done for sending images?

  • @elhai1992
    @elhai1992 2 года назад

    hello my friend..
    i was copy your codes and i notices that you have a diffrent code and it appear on 8:05 on the video.
    i copied it and the Teminal says me that "takes 1 positional argument but 2 were given"
    by writing "bot = telegram_chatbot(config.cfg)
    and def read_from_the_config_file..
    how i can solve it?

  • @srabonx
    @srabonx 3 года назад

    Where did you host your python files?

  • @fergiejohnson633
    @fergiejohnson633 4 года назад +1

    nothing works, i did not change anything, installed all requests , but nothing works

    • @tusharbaheti1648
      @tusharbaheti1648 4 года назад

      Telegram made some changes so this tutorial needs to be updated

    • @erasernox2611
      @erasernox2611 4 года назад

      change to giz_text = giz[37].strip("
      ") in gizoogle.py

  • @hima1397
    @hima1397 4 года назад

    File "server.py", line 25, in
    reply = make_reply(message)
    File "server.py", line 10, in make_reply
    reply = gizoogle.text(msg)
    File "/home/Himafreaky12/TelegramChatBot/gizoogle.py", line 15, in text
    giz_text = giz[39].strip("
    ") # Hacky, but consistent.
    IndexError: list index out of range
    HOw to resolve this error? THis is from the console?

  • @mohdfaizsanip9610
    @mohdfaizsanip9610 3 года назад

    Hey did u know how to create our own robot saying welcome to our new group member?

  • @SwapravaNath
    @SwapravaNath 4 года назад

    strangely the server.py code is running, but the bot is not responding.

  • @ankit-bhankharia
    @ankit-bhankharia 3 года назад

    Now it will not work coz its showing you cannot access outer websites from free account

  • @hassanarabi1987
    @hassanarabi1987 3 года назад

    Thank sir can you do a video how to forward message from telegram channel to another channel with python please

  • @amanojha924
    @amanojha924 4 года назад

    How did you connected the chat bot with gizoogle.. Its wasn't in the vedio

  • @rajvikothari9457
    @rajvikothari9457 4 года назад

    Is there any option to covert it into normal replies rather than gangsta replies

  • @yar13singh57
    @yar13singh57 6 лет назад +1

    Super Cool

  • @puahlh1802
    @puahlh1802 4 года назад

    Hi, is it possible for me to add in a code that calculates the inputs and returns the answer?

  • @vaibhavbansal6947
    @vaibhavbansal6947 3 года назад

    hi buddy i am getting below mentioned error can you help me out on this
    from bot import telegram_chatbot
    ImportError: cannot import name 'telegram_chatbot'

  • @shaunhill2466
    @shaunhill2466 3 года назад

    First, type this code....
    Where is this code? It's not in the description.

  • @viveks.
    @viveks. 5 лет назад

    Bro can u make tut on making userbot who can send animated text messages and some other animations who can also do text to speech and some other cool commands

  • @edumart8743
    @edumart8743 4 года назад

    Hi how can we create API for CRM to use Telegram with bot or without bot. Can we send first msg to any telegram user using API

  • @priyabratsinha7539
    @priyabratsinha7539 3 года назад

    Can I turn my Main I'd Into a AI conversational ID with auto reply and auto send message in Any ID

  • @vishalchauhan9843
    @vishalchauhan9843 4 года назад

    Can I integrate a bot with my account also like when I am offline and someone texts me then it should message a predefined message like "my owner is busy. Don't spam and wait for him to come online".

  • @New_Video_Games
    @New_Video_Games 3 года назад

    Hi bro,i have a little qeustion,may i ask???

  • @thrishulalathanda2470
    @thrishulalathanda2470 4 года назад

    i'm getting something like this when i run server.py
    Traceback (most recent call last):
    File "/home/zed/TelegramChatBot/server.py", line 25, in
    reply = make_reply(message)
    File "/home/zed/TelegramChatBot/server.py", line 10, in make_reply
    reply = gizoogle.text(msg)
    File "./gizoogle.py", line 15, in text
    giz_text = giz[39].strip("
    ") # Hacky, but consistent.
    IndexError: list index out of range

  • @akhilamudala5229
    @akhilamudala5229 5 лет назад +1

    dude i am getting index out of range error .....

  • @m.r6870
    @m.r6870 3 года назад

    How i can connect the phyton on telegram bot?

  • @NickyTuan
    @NickyTuan 4 года назад

    what the of micro web framework app ?

  • @abhisharma2341
    @abhisharma2341 4 года назад

    I need help,tell me how to auto forward other's channels post on my channel...