Code Monkey home page Code Monkey logo

spotify_telegram_bio_updater's Introduction

spotify_telegram_bio_updater

This userbot updates the biography of a telegram user according to their current spotify playback. If no playback is active, the bot changes the bio back to the original one from the user.

Setup

If you follow this steps, you can use this project easily for yourself.

  1. Ensure you have python 3.6+ installed and then install telethon and request via pip: pip install telethon requests
  2. Get your spotify client_id and your client_secret from https://developer.spotify.com/dashboard/. If you need more help, have a look here.
  3. Get your telegram app api_id and api_hash from https://my.telegram.org/. If you need more help, have a look here.
  4. Open the following link (change CLIENT_ID to you client_id): https://accounts.spotify.com/authorize?client_id=CLIENT_ID&response_type=code&redirect_uri=https%3A%2F%2Fexample.com%2Fcallback&scope=user-read-playback-state%20user-read-currently-playing
  5. After you grant permission, you get redirected to https://example.com/callback?code=_. Copy everything after the code, this is you initial token.
  6. Paste all these values in their respective variables at constants.py. While you are at it, you can also paste an initial biography there. Just take your current one. This is highly recommended. If you don't do this and have a currently playing track, the bot has at its first start no idea what your original biography is. Just do it, please.
  7. If you want to have a log channel or group or so, paste its invite link or id in the LOG variable. If you leave it at "me", you will see those in your saved chat. Only if errors occur ofc ;)
  8. Now you can run generate.py. This will generate a json file named database.
  9. You are almost done. If you now run bot.py, all you need to do is log into your telegram account. Follow the instructions on screen.
  10. Now you are really done.

Important Information

You can shut the bot down if you want/need to. Write //stop anywhere you want. If you want to change the command, edit SHUTDOWN_COMMAND in the constants.

Warning

This bot uses the emoji ๐ŸŽถ to determine if the current bio is an active spotify biography or not. This means you mustn't use this emoji on your original biographies or the bot will probably break. Don't do it, thanks.

But I want to

Great news. Just change the KEY variable in constants file. Don't ever use your new KEY in your biographies though!

Issues? Need help? Want to tell me something?

Well, just create an issue here. You can also ping me on telegram.

spotify_telegram_bio_updater's People

Watchers

 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.