Coder Social home page Coder Social logo

duedatebot's Introduction

duedatebot

a due date reminder bot for discord Create new Due-Dates, sort them by Course, and add what files you need to hand in!

Installing

Link to add to your server!

Contributing:

Dependancies:

You will need to install the following packages via pip:

  • discord
  • pymongo
  • dotenv

Setting up the Environment

After making sure you have the proper python packages, clone the repo. In the same directory as the codebase, create a file called .env, with the following content:

# .env
DISCORD_TOKEN=<Your discord bot token>
DB_PASS=<Your mongodb token>

For developing, you should create your own discord bot and test server to run it in. create your own cluster with MongoDB as well for testing.

What to do?

  • Writing Documentation (ESPECIALLY doctstrings)
  • Screenshots of commands in action (so we can put them on this page!)
  • Writing better help messages
  • Writing more interesting reply messaages
  • Coming up with ideas for commands
  • Adding command Aliases

Check out Issues for stuff you can help out with!

duedatebot's People

Contributors

harris-ferguson avatar ozancaglar avatar

Watchers

 avatar

Forkers

rowdyrogue

duedatebot's Issues

Store Posts in Chronological Order

We should store posts in chronological order, and possibly implement a sorter. This will help us do things like

  • List posts in chronological order
  • Get the next item due

New Command: Days Till Due

Command will print the days until a specified assignment is due. It would be nice if we could invoke this with the name and title of the assignment but we might have to resort to using the assignment id.

Testing

We need a testing suite! pytest would be easy enough to get rolling. With my limited time and this projects small userbase (the use of this app is primarily 1 small school discord server), my priority is in building out features we need, but setting up testing is gunna be invaluable.

Modularize the bot

We should take the time to modularize the bot into some Classes using the Cog framework that discord.py provides.

Let reminders have a time to remind option

Currently reminders just trigger at a certain number of seconds after the user invoked the command, meaning entering 2 days at 11 will mean you get reminded 2 days later at 11. We should let the command invocation include a "time to remind at" field.

Discord Slash Command Preview

Discords new update has a new Slash Command feature. We should support this feature so people can have an easier time navigating our commands. We need to register these slash commands with an HTTP request, see the above link.

Automate removal of past due assignments

Since we have an event loop running for reminders, we could use the same event loop to check for anything in the assignments database that is past due. We could tie it to a boolean that the user can optionally set, just in case there is a desire to keep assignments for some time after they are due.

New Command: Get Assignment

Get an assignment by its ID and print it out to the guild. This is also needed for some other setter/getter functions so we can immediately display any changes made.

New Command: Due This Week

We need a command that checks for everything due in a given week. Dates are stored as datetimes from the Python datetime module, so we can use the features of that to check if something is happening within the current week.

Timed Reminders

Timed Reminders

Daily, Weekly, or Monthly Reminders of important upcoming dates!

Features

Set a reminder to go off at a specific daily time
Set a reminder to go off once every set amount of days
Ping users for important upcoming dates if they have a role matching the class title
Ping @here in a channel matching the course ID

Abstract Date Parsing behaviour

We should abstract the behaviour of parsing a datetime to a helper method. Said method should be set up to use Regex and match multiple different formats of datetime to allow for easier usage.

Ensure proper types are stored in the database

We need to check that the proper types are stored in the database. Most of what we store are just strings, however we particularly want to ensure that we are storing python datetime objects instead of a string. Assignment IDs should also be integers instead of strings.

Bulk Add From CSV

Bulk Add

Bulk Add an entire schedule from a csv file.

Details

Ensure everything adding conforms with the type we store in the db. We could either invoke the existing adddate command to add everything or make use of pymongos insert_many command to do it all at once.

New Command: Delete Item

We need a command that deletes an item. We should also write a function we can call that deletes anything that is past due.

Let the user enter more time options for reminders

currently reminders only accept Days and Second (for testing), however we should also allow the user to enter Weeks and Months (and maybe years but im not sure who would use that).

This would involve expanding the following section of code:

duedatebot/duedates.py

Lines 204 to 208 in afb3270

if "Days" in arg2 or "days" in arg2 or "day" in arg2 or "Day" in arg2:
quantity_multiplier = 86400
#seconds is here for testing
if "Seconds" in arg2 or "seconds" in arg2:
quantity_multiplier = 1

to include more quantity multipliers. The quantity multiplier should convert a number of given units of time to seconds, so that the event loop function which checks all the reminders against the Epoch can check if the given date is in the past.

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.