Giter VIP home page Giter VIP logo

ducky-bot's Introduction

Heroku Deployment Repository ๐Ÿš€

Duck4u ๐Ÿฆ†

A Discord bot that fetches Reddit posts from subreddits and can run various custom commands for fun.

Tools ๐Ÿ› ๏ธ

Setup and Deploy โš™๏ธ

  • Setup virtual environment and activate it
$ python -m venv venv
$ cd venv/Scripts
$ activate.bat
$ cd ..
$ cd ..
  • Get Reddit Developer API constants
App Type: script
URL/URI: http://localhost:8080/
  • Setting up discord.py

    • create application
    • create a bot
    • get OAuth link
    • open the above link and add bot to a server
    • copy api-key from bot page to code
  • Running bot locally

$ py bot.py
  • Running on Heroku
  1. Create and populate: Procfile, runtime.txt, requirements.txt and place in root of the bot folder alongwith bot.py
$ pip freeze > requirements.txt
  1. Push to GitHub, create a new app in Heroku and attach to GitHub repository for CI (all via UI)
  2. Check build logs in Deploy -> More -> View logs
  3. Goto Resources, specify run command as py bot.py and start a dyno. Check logs to make sure its running. Once the bot is ready to accept commands it will output Bot ready! on Heroku log console.

Features ๐Ÿ’ก

  1. Fetch: a random post from specified subreddit, optional [hot] argument fetches a random but "hot" post (w/ NSFW Filter).
  2. Custom fun commands: toss a coin, show a gif on named commands.
  3. Other: memeLoop, stats system, responds with a custom message on @mention, activity status.

Bot Commands ๐Ÿค–

hello
help
stats

toss

meme [hot]
puppy
art [hot]
wallpaper [hot]
whoa [hot]
itemshop
comic [hot]

quote
showerthot [hot]
scary [hot]

other hardcoded named commands under `# secret commands`

Technical Aspects ๐Ÿ‘จโ€๐Ÿ’ป

  • Uses embeds for better look and feel
  • Custom Loggging: logs await success or failure in India Standard Time (GMT+5:30) pytz
  • memeLoop: Sends a random hot meme to a specified channel every 30mins (w/ NSFW Filter) random
  • Stats System: TBI OOP

References ๐Ÿ“š

Flask App for Testing โš ๏ธ

Flask installation and app file app.py is available to test PRAW. Better use Quart because of better async functionality than Flask.

$ py app.py

ducky-bot's People

Contributors

abhishekarya1 avatar

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.