Giter Club home page Giter Club logo

jojo-telegram-bot's Introduction

Telegram JoJo Bot

A bot to make JoJo references on Telegram! Try it (It might be offline)

Description

This repo contains files the JoJo bot uses to respond to messages. It is done entirely in Python3, using the requests module. Try the bot at this link, it will not reply if it's offline.

Features

  • Replies with JoJo dialogues. Use /help to see the list of supported commands and messages.
  • Can be used a JoJo soundboard! Tag the bot @oh_youre_approaching_me_bot in any chat and search for sounds.
  • /jmeme or /meme gives a random post from the r/ShitPostCrusaders subreddit. Add the bot to a group for more fun! (the bot cannot read any group messages unless you tag it or reply to it)

Requirements

These are the requirements to run the bot yourself, if you only want to interact with it use this link.

  • Python 3
  • See requirements.txt for other (python) requirements.
  • A Telegram Bot token. Learn more Telegram Bots here
  • (Optional: required for reddit memes support) A reddit dev app - note the client ID and secret there, it is needed to authenticate the bot. Refer this for creating a new reddit app.

Usage

Instructions to run the bot yourself, if you only want to interact with it use this link.

  • Create a .env file in the same directory.

  • Add your Bot Token to the .env file in this format

    TOKEN=<your bot token here>
    CLIENT_ID=<reddit api client ID here>
    CLIENT_SERVER=<reddit api client server here>
    USER_AGENT=<a custom user agent for your bot>
    
  • Run reply.py using python reply.py or python3 reply.py. This script runs infinitely and responds to messages.

reply.py

This script performs long-polling on the getUpdates method of the Telegram Bot API. As soon as a message is received, it looks for that message in message_responses dictionary and sends the corresponding response if it exists or sends a default message if it doesn't. The script also saves the last update ID it processed to a file, this update ID is sent to the API to get only new updates (this is to prevent duplicate responses).

jojo-telegram-bot's People

Contributors

dependabot[bot] avatar psiayn avatar samyak2 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

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.