DEV Community

Alan Paradis
Alan Paradis

Posted on

StackOverBot, a Discord bot for searching StackOverflow questions

SOME FEATURES ARE STILL WIP

Before we get started, I just want to give few words on my relationship with python 😄 (Jump straight to the bot)


Relationship with Python

Python Logo

I've used Python since almost 10 years but I have never deep dive into it, I use it sparingly when I just need to make quick tools like sorting files, handle data, need a quick QT interface for a tool. Even though I've made many small projects thought the years I consider myself a beginner in Python.

Why a StackOverflow Bot ?

Making a Discord bot was a little challenge because many of my friends have already done it. I choose StackOverflow because the StackExchange/StackOverflow API is basically just playing with URL variable and making web request that sends back JSON.


The bot itself

The bot is made using Python 3.9 and Pycord
Github of the project

Question send by the bot
Question send by the bot

Command to search questions
Command to search questions

The bot can currently accept 4 inputs

  • search : the terms of your search
  • tags: tags for the search separated by semicolon
  • sort: sort method for the search (votes, relevance, creation, activity)
  • min: it's used depend on the sorting method, for now this only can be used in votes sort.

By reacting with ⏭, the bot show you the next question !
You can see up to 5 questions

TODO :

  • Add a max option
  • Add the possibility to write a date in min and max so you can use it in creation or activity

Containerize my bot 🐋

My bot can be easily build and deploy using the Docker with the Dockerfile in the Github repo. That's how I usually run my bot on my server.


Thank for reading ! Don't hesitate to share your opinion about the bot and ask for features 😁

Discussion (0)