Giter Site home page Giter Site logo

murali's Introduction

Murali

Murali is a discord bot built by and for amFOSS-2023 members. Primarily, it automates the extremely tedious procdeure of opening google sheets to add an entry that marks your attendance. This is instead achieved through a simple discord command that takes in your seat number, time you entered and the time you intend to leave.

Prerequisities

Before running the bot, ensure you have the following set up:

  • Rust: Make sure you have Rust installed on your system. You can install Rust by following the instructions on rustup.rs.

    • For deployment and local runs, you will also require an account on shuttle.rs.
  • Google API Credentials: Required to perform actions on behalf of a service account. Create a project in the Google Cloud Console, enable the Google Sheets API, create a service account and download the JSON credentials file. Place this in a directory called secrets at the root of the project.

  • Discord Bot Token: Required to run the bot account on Discord. Create a Discord bot on the Discord Developer Portal, and add the token to your Secrets.toml as "DISCORD_TOKEN".

  • Spreadsheet ID: The ID of the spreadsheet used for attendance. You can get the ID from the spreadsheet's URL. Add the ID to Secrets.toml as "SPREADSHEET_ID".

  • Template ID: The ID for the template sheet. Again, available from the URL. This is the sheet that will be duplicated if the bot does not find a sheet made for the day (sheets are named after the day they correspond to). Add the ID to Secrets.toml as "TEMPLATE_ID".

The final Secrets.toml file should resemble:

DISCORD_TOKEN="placeholdertoken"
SPREADSHEET_ID="placeholdertoken"
TEMPLATE_ID="placeholdertoken"

Running

  • Run cargo shuttle login first to login with your API KEY, found from Shuttle.rs Console's Profile overview page.

  • Use cargo shuttle run to locally run the bot. This is useful to check whether everything has been setup properly before starting development or before committing changes.

  • Use cargo shuttle project start --idle-minutes 0 to initialize a project on shuttle.

  • Then run cargo shuttle project deploy to deploy the project.

Discord Commands

As of the 8th of February, the only command is att.

Syntax: /att [seat_number] [time_in] [time_out] Where square brackets imply optional arguments.

Defaults:

  • seat_number = ""
  • time_in = "17:30"
  • time_out = isMale ? "22:00" : "21:00"

License

This project is licensed under the MIT License - see the LICENSE file for details.

murali's People

Contributors

govindkrishna03 avatar ivinjabraham avatar viserion-7 avatar

Watchers

 avatar

murali's Issues

Command does not work if the sheet has not been created.

If there is no sheet ID matching today's date, the command fails and someone has to manually go create a sheet, thus destroying the entire purpose of the bot.

Proposed solution: Make a new function that creates a sheet for the day and integrate it with the current flow.

Reply's formatting is not user-friendly.

The current reply looks like this:
Appended data:
Serial Number: 6 Name: Hemanth Krishnakumar Roll Number: AM.EN.U4CSE22227
Seat Number: 23 Time In: 17:54 Time Out: 23:00

Use embeds to make this beautiful.

Serial Number Stuck at 6 in Attendance Automation

Issue Title: Serial Number Stuck at 6 in Attendance Automation

Description:

The Discord bot, used for automating attendance sheets, consistently sets the serial number to 6 after reaching this value. Each appended data entry displays a serial number of 6 instead of incrementing sequentially.

Steps to Reproduce:

  1. Use the Discord bot command for attendance automation.
  2. Observe that the serial number remains stuck at 6 in the appended data.

Expected Behavior:

Serial numbers should increment sequentially for each attendance entry, ensuring uniqueness.

Actual Behavior:

The serial number consistently appears as 6 for each appended data entry after reaching this value.

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.