Giter VIP home page Giter VIP logo

kewlbot's Introduction

kewlbot

Check the bot in here.

Supported commands:

  • /boop responds with a random dog picture or video
  • /carrot responds with a random horse picture
  • /tips responds with a random tip from /r/LifeProTips or /r/YouShouldKnow
  • /javi responds with a javi
  • /midge responds with a midge
  • /shrug responds with a ¯\_(ツ)_/¯
  • /imagegen send a prompt and a new image will be generated
    • Rate limit is stricter as this one will eventually cost money
  • /changelog responds with latest CHANGELOG.md

Adding photos/videos to a command

Additional photos or video can be added to commands by sending a photo or video and putting the command in the caption

Subreddit name auto-linking

If a subreddit name is detected in a message, the bot will respond with a link to the subreddit.

  • Only subreddit names in the /r/<subname> or r/<subname> format are recognized
  • Multiple subreddit names in a message are supported and will be sent as seperate links
  • Full reddit urls are ignored (IE. https://www.reddit.com/r/TelegramBots/)

Requirements

Steps

  1. Install dependancies
pip install -r requirements.txt
  1. Set the required environment variables
TELEGRAM_BOT_TOKEN
OPENAI_API_KEY
  1. Create a praw.ini

Example:

[DEFAULT]
# A boolean to indicate whether or not to check for package updates.
check_for_updates=True

# Object to kind mappings
comment_kind=t1
message_kind=t4
redditor_kind=t2
submission_kind=t3
subreddit_kind=t5
trophy_kind=t6

# The URL prefix for OAuth-related requests.
oauth_url=https://oauth.reddit.com

# The amount of seconds of ratelimit to sleep for upon encountering a specific type of 429 error.
ratelimit_seconds=5

# The URL prefix for regular requests.
reddit_url=https://www.reddit.com

# The URL prefix for short URLs.
short_url=https://redd.it

# The timeout for requests to Reddit in number of seconds
timeout=16

[telegrambot]
client_id=<client_id>
client_secret=<client_secret>
  1. Run the program.
python main.py
  1. (Optional) Compile using pyinstaller
pyinstaller .\main.spec
python -m PyInstaller .\main.spec

kewlbot's People

Contributors

dzakyputra avatar snargledorf avatar

Watchers

 avatar

kewlbot's Issues

Media directory should be configurable

Currently the media directory is hardcoded to be in the execution directory, but this causes issues.

If we have the application run using the default directory (main), then the media directory would be erased whenever changes are deployed. But by having the application run in another directory that means we need to copy other build artifact files into the execution directory (CHANGELOG.md) whenever they change.

If the media directory was configurable, then you could set the directory to wherever without effecting other files.

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.