A-21 Individual

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 66

A Project Report

On
STRATEGIC ENHANCEMENT AI-POWERED SCHEDULING
ASSISTANT BOT
A report Submitted in partial fulfilment of recruitment for
the
Award of the Degree of

BACHELOR OF TECHNOLOGY
IN
CSE (ARTIFICIAL INTELLIGENCE & MACHINE LEARNING)

BY
MURUGULA PREETHAM RAJNESH 20BK1A6643

UNDER THE ESTEEMED GUIDANCE


OF
Ms. M. ARSHA REDDY
B.Tech, M.Tech
ASSISTANT PROFESSOR & HOD, DEPARTMENT OF CSE(AI&ML)

DEPARTMENT OF
CSE (ARTIFICIAL INTELLIGENCE & MACHINE LEARNING)
St. Peter’s Engineering College (UGC Autonomous)
Approved by AICTE, New Delhi, Accredited by NBA and NAAC with ‘A’ Grade,
Affiliated to JNTU, Hyderabad, Telangana
2020-2024
2023-24
CERTIFICATE

This is to certify that MAJOR PROJECT work entitled “STRATEGIC ENHANCEMENT


AI-POWERED SCHEDULING ASSISTANT BOT” is carried out by MURUGULA
PREETHAM RAJNESH bearing Reg No: 20BK1A6643 in partial fulfilment for the award
of the degree of Bachelor of Technology in CSE (ARTIFICIAL INTELLIGENCE &
MACHINE LEARNING) is a record of bonafide work done by them under my supervision
during the academic year “2023 – 2024”.

INTERNAL GUIDE HEAD OF THE DEPARTMENT


Ms.M. Arsha Reddy Ms. M. Arsha Reddy
Assistant Professor, HOD Assistant Professor, HOD
Department of CSE (AI&ML) Department of CSE (AI&ML)
St. Peter’s Engineering College, St. Peter’s Engineering College,
Hyderabad. Hyderabad.

PROJECT COORDINATOR EXTERNAL EXAMINER


Dr. P. Deepan
Associate Professor, HOD
Department of CSE (AI&ML)
St. Peter’s Engineering College,
Hyderabad.
ACKNOWLEDGEMENT

I sincerely express our deep sense of gratitude to Ms. M. Arsha Reddy, for her valuable
guidance, encouragement and cooperation during all phases of the project.

I am greatly indebted to our Project Coordinator Dr. P. Deepan, for providing his
valuable advice, constructive suggestions and encouragement without whom it would not
been possible to complete this project.

I extend my heartfelt gratitude to the esteemed review committee, comprising


Ms. M. Arsha Reddy and Dr. P. Deepan, for their invaluable insights, constructive
feedback, and unwavering support throughout the project. Their guidance and
encouragement played a pivotal role in our successful execution. I am truly appreciative
of their contributions and dedication.

It is a great opportunity to render my sincere thanks to Ms. M. Arsha Reddy, Head of the
Department, CSE (Artificial Intelligence & Machine Learning) for her timely guidance
and highly interactive attitude which helped me a lot in successful execution of the
Project.

I am extremely thankful to our Principal Dr. K. Sree Latha, who stood as an inspiration
behind this project and heartfelt for her endorsement and valuable suggestions.

I respect and thank our secretary, Sri. T. V. Reddy, for providing me an opportunity to do
the project work at St. PETER’S ENGINEERING COLLEGE and I am extremely
thankful to him for providing such a nice support and guidance which made me to
complete the project.

I also acknowledge with a deep sense of reverence, my gratitude towards my parents, who
have always supported me morally as well as economically. I also express gratitude to all
my friends who have directly or indirectly helped me to complete this project work.

BY
MURUGULA PREETHAM RAJNESH (20BK1A6643)
CONTENTS

Title of the Chapter Page No:


Cover Page i
Certificate ii
Acknowledgements iii
Abstract 1
Chapter 1 – Introduction 2
1.1 Motivation 2
1.2 Problem Definition 3
1.3 Objective 3
1.4 Limitations 3
1.5 Dataset Description 3
Chapter 2 – LITERATURE SURVEY 4
2.1 Introduction 4
2.2 Existing System 4
2.3 Disadvantages of Existing System 5
2.4 Proposed System 5
2.5 Advantages of Proposed System 6
Chapter 3 – ANALYSIS 7
3.1 Introduction 7
3.2 Software Requirement Specification 7
3.2.1 User Requirements 7
3.2.2 Software Requirements 8
3.2.3 Hardware Requirements 11
Chapter 4 – DESIGN 14
4.1 Introduction 14
4.2 UML Diagrams 14
4.2.1 Goals 14
4.2.2 Class Diagram 15
4.2.3 Sequence Diagram 16
4.2.4 Use Case Diagram 17
4.3 Module Design and Organization 18
Chapter 5 – IMPLEMENTATION AND RESULTS 19
5.1 Introduction 19
5.2 Explanation of Key Functions 19
5.3 Method of Implementation 20
5.3.1 Forms 22
5.3.2 Output Screens 23
Chapter 6 – TESTING & VALIDATION 28
6.1 Introduction 28
6.2 Types of Testing 28
6.3 Test Cases & Scenarios 28
6.4 Validation 30
Chapter 7 -CONCLUSION 31
7.1 Project Conclusion 31
7.2 Future Enhancement 32
References 33
Appendix A: Source Code 35
Appendix B: Project Working Snap Shots 50
LIST OF FIGURES

DESCRIPTION PAGE NO.


System Architecture 11
Flow Diagram 13
Class Diagram 15
Sequence Diagram 16
Use Case Diagram 17
LIST OF SCREENS

DESCRIPTION PAGE NO.


Example-1 12
Example-2 22
Sync Google Calendar 23
Sign-In With G-mail 24
Quick Message 24
Scheduling Meeting 25
Details of Meeting 25
Re-scheduling Meeting 26
Google Calendar 27
LIST OF ABBREVATIONS

ABBREVATION DEFINATION

API Application Programming Interface

AI Artificial Intelligence

NLP Natural Language Processing

RTM Real Time Messaging

DFD Data Flow Diagram

UML Unified Modeling Language


St. Peter’s Engineering College (Autonomous) Department of CSE(AI&ML)

ABSTRACT

This project proposes the development of a Slack scheduler empowered by artificial intelligence (AI) to
facilitate easy and efficient organization of events, tasks, and other activities within the platform. The
key components of this AI assistant are the Real Time Messaging (RTM) API, API.AI, and Google
Calendar API, which collectively enable a smart and effective scheduling system for users. By
integrating these APIs into Slack channels, the project establishes instant collaboration and
communication between the bot and Slack users in real-time, leveraging the capabilities of the RTM
API

Through the use of AI and Natural Language Processing (NLP), the bot is able to understand
user input and interact with users in a natural conversational manner, accommodating dynamic schedule
change requests seamlessly. The Google Calendar API serves as the backbone for managing scheduled
events, providing a robust framework for handling upcoming activities.

Moreover, the AI assistant utilizes machine learning techniques to continuously enhance its
understanding of user interests and behaviors, enabling it to make personalized scheduling
recommendations over time. As the development progresses, the system iteratively improves its
planning efficiency by refining its approach modeling, learning from user interactions, and becoming
increasingly sophisticated.

Autism spectrum disorder ASD is a complex neurodevelopmental disorder that manifests in a variety of
ways. The daily lives of children diagnosed with ASD and their parents can be significantly improved
through early diagnosis and appropriate medical intervention. The applicability of static features
extracted from facial photographs of autistic children as a biomarker to distinguish them from typically
developing children was investigated in this paper.

In summary, this project aims to create a versatile Slack scheduler that leverages AI and
advanced APIs to streamline scheduling processes, facilitate real-time collaboration, and provide
personalized assistance to users, ultimately enhancing productivity and efficiency in organizational
tasks.

STRATEGIC ENHANCEMENT AI-POWERED SCHEDULING ASSISTANT BOT


Page 1
St. Peter’s Engineering College (Autonomous) Department of CSE(AI&ML)

CHAPTER 1
1. INTRODUCTION
The modern workplace, with all its reacting nature of time and adjustable communicative path
for better produce have presented this belief; the need to ease workload considerations in a speedy
fashion is always here. In order to work with the well-known Slack collaboration platform, this paper
presents an AI Scheduler Bot that is extremely innovative and could only be integrated via some
platforms. This unique bot utilizes three main APIs: Real—Time Messaging (RTM), API.AI, and
Google Calendar to choreograph a harmony of automation and cunning that sweep the air when it
comes about scheduling. The Real-Time Messaging (RTM) API strikes a balance between a bot and
Slack, allowing the latter to get instant feedback from the former in an active environment.

This allows real-time scheduling tasks while minimizing the delays in user experience and to
integrate time through efficient communication. Introduction of RTM API serves as a groundwork for
the creation of an assistant that is responsive and intelligent enough to react on ones’ demand that fast
up with scheduling requirement. Complementing the real-time responsiveness, api.AI high powered
language technology is incorporated in Scheduler Bot that can learn and act on human speech This API
empowers the bot with natural language understanding to become a chatty dispatch assistant. Users can
communicate with the bot as if talking to a human CSA; therefore, its end-user friendliness is an
intuitive. The digital assistant found in API.AI provides a human component to the program, allowing
one to circumvent typical boundaries of machine interaction. Indeed, the latter has ties with Google
Calendar API.

Therefore, the machine learning augmentation guarantees that Scheduler Bot turns into a
practical tool for scheduling; however, not only it, but also becomes personal and intelligent assistant
who will adjust to separate user’s needs. Breaking down the intricacies in AI, APIs and machine
learning to discover how humans’ bots are influenced while observing the role they play for our society
this paper will explore the mysteries of our Scheduler Bot to reveal a new twist towards balancing
equipment against productivity. Come with us on a path to discover the revolutionary capacity of this
reported AI Scheduler Bot.

1.1 MOTIVATION

The motivation behind this project abstract stems from the recognition of the challenges
individuals and teams face when organizing events, tasks, and schedules within the Slack platform.
Traditional methods of scheduling often require manual input, coordination, and may lack the
adaptability to accommodate real-time changes efficiently. By introducing an AI-powered Slack
scheduler, the project aims to address these challenges and provide users with a seamless and intelligent
solution.

STRATEGIC ENHANCEMENT AI-POWERED SCHEDULING ASSISTANT BOT


Page 2
St. Peter’s Engineering College (Autonomous) Department of CSE(AI&ML)

1.2 PROBLEM DEFINITION


The project aims to revolutionize scheduling within Slack by developing an AI-powered
scheduler. Traditional methods are inefficient and prone to errors, lacking adaptability and personalized
recommendations. Leveraging APIs like RTM, API.AI, and Google Calendar, the proposed solution
offers dynamic, responsive scheduling directly within Slack. It streamlines processes, enhances
collaboration, and boosts productivity by adapting to real-time changes and providing personalized
recommendations. By integrating scheduling functionalities into Slack, the solution improves efficiency,
reduces errors, and enhances user satisfaction, ultimately transforming how individuals and teams
manage schedules and tasks within the platform.

1.3 OBJECTIVE

Evaluate The project aims to develop an AI-powered Slack scheduler to revolutionize event and
task management within the platform. By integrating RTM API, API.AI, and Google Calendar API, the
scheduler will offer seamless communication and collaboration. Using AI and NLP, users can interact
naturally, while real-time updates ensure adaptability to changes. Machine learning will enable
personalized recommendations, enhancing efficiency and productivity in scheduling tasks within Slack.

1.4 LIMITATIONS

The project's limitations include reliance on third-party APIs like RTM, API.AI, and Google
Calendar, which may have availability issues. Understanding user input and real-time updates could be
challenging, while privacy concerns arise from data handling. Personalized recommendations' accuracy
may vary, and user adoption might fluctuate, impacting effectiveness. Compatibility issues with Slack
setups and complexity in maintaining AI features are also potential drawbacks.

1.5 DATASET DESCRIPTION

The dataset used to train and validate the AI-driven Slack scheduler encompasses various
essential components. It includes records of user interactions, capturing scheduling tasks, queries, and
feedback to refine the bot's responsiveness. Additionally, scheduling data provides details of events,
tasks, and deadlines managed within Slack, while integration with the Google Calendar API enriches it
with users' existing schedules. Training data for the natural language understanding model aids in
comprehending diverse conversational scenarios. Lastly, feedback and evaluation data gathered during
testing phases offer insights to improve scheduling accuracy and user experience. Through these
datasets, the AI-powered scheduler continuously learns and evolves to better assist users in organizing
their activities efficiently within the Slack platform.

STRATEGIC ENHANCEMENT AI-POWERED SCHEDULING ASSISTANT BOT


Page 3
St. Peter’s Engineering College (Autonomous) Department of CSE(AI&ML)

CHAPTER-2
2. LITERATURE SURVEY
2.1 INTRODUCTION

Autism In [1], This investigate gives a diagram of the applications of AI-powered planning
frameworks. It investigates how these frameworks use fake insights to upgrade effectiveness in different
spaces. The ponder digs into challenges confronted in execution and proposes methodologies for key
upgrades.

An Artificial In paper [2], this paper explores the part of AI-powered Planning associates in
progressing efficiency and administration. It investigates highlights that contribute to vital upgrades and
talks about client criticism and acknowledgement. this investigate analyzes how organizations
deliberately coordinated AI-powered planning associates into their operations. It analyzes the effect on
workflow proficiency and representative fulfillment, giving bits of knowledge into effective executions.

The research article [3] This article investigates the part of normal dialect handling (NLP) in AI-
powered planning associates. It evaluates the effect of NLP on client intelligent, understanding setting,
and making planning proposals. The paper highlights openings for key advancements in NLP
calculations. how machine learning calculations contribute to the improvement of AI-powered planning
collaborator bots. It addresses challenges in client adjustment and proposes procedures for progressing
in general fulfillment.

Predicting The paper [4] This investigate presents a system for deliberately optimizing planning
choices utilizing AI. It talks about how calculations can adjust to energetic situations, considering
components such as asset allotment, need settings, and real-time alterations. It talks about security
concerns, inclination in decision-making, and proposes moral rules for vital improvements.

2.2 EXISTING SYSTEM

The existing system for scheduling within Slack relies mainly on manual input from users, with
limited automation and intelligence. Users may also use external calendar applications or integrations,
lacking real-time adaptability and natural language interaction. Communication around scheduling
typically occurs through traditional messaging channels, without sophisticated AI capabilities to provide
personalized recommendations or insights. Overall, the existing system lacks the advanced features
proposed by the AI-powered Slack scheduler, making scheduling processes less efficient and intuitive
for users.

STRATEGIC ENHANCEMENT AI-POWERED SCHEDULING ASSISTANT BOT


Page 4
St. Peter’s Engineering College (Autonomous) Department of CSE(AI&ML)

2.3 DISADVANTAGES OF EXISTING SYSTEM


Lack of Intelligence:
Current systems often lack artificial intelligence capabilities, making them unable to
understand natural language inputs or adapt to users' preferences and behaviors.
Manual Input:
Users may need to manually input event details and schedules, which can be time-
consuming and error-prone, especially for complex scheduling tasks.
Limited Integration:
Some systems may have limited integration with external calendars or applications,
restricting users' ability to sync and manage their schedules across different platforms seamlessly.
Inflexibility:
Existing systems may lack flexibility in accommodating dynamic schedule changes or
complex scheduling scenarios, leading to inefficiencies and frustrations for users.
Minimal Personalization:
Without advanced AI capabilities, existing systems may struggle to provide personalized
scheduling recommendations or adapt to individual users' preferences over time

2.4 PROPOSED SYSTEM

The proposed system aims to introduce an AI-powered Slack scheduler that revolutionizes
scheduling processes within the platform. By leveraging Real Time Messaging (RTM) API, API.AI,
and Google Calendar API, the scheduler will offer seamless communication and collaboration, enabling
users to interact naturally and receive real-time updates. Through advanced AI and Natural Language
Processing (NLP) capabilities, the scheduler will understand user input, adapt to preferences, and
provide personalized scheduling recommendations. Machine learning techniques will continuously
enhance the scheduler's understanding of user behavior, further refining its recommendations over time.
With these advancements, the proposed system seeks to streamline scheduling processes, improve
efficiency, and enhance user experience within Slack.

STRATEGIC ENHANCEMENT AI-POWERED SCHEDULING ASSISTANT BOT


Page 5
St. Peter’s Engineering College (Autonomous) Department of CSE(AI&ML)

2.5 ADVANTAGES OF PROPOSED SYSTEM

The proposed system for autism spectrum disorder (ASD) diagnosis offers several advantages:
Seamless Integration:
The system seamlessly integrates Real Time Messaging (RTM) API, API.AI, and Google
Calendar API within Slack, providing a unified platform for scheduling and communication,
eliminating the need for users to switch between multiple applications.

Enhanced Communication and Collaboration:


By integrating these APIs, the system fosters smoother communication and collaboration
among users within Slack channels, facilitating efficient coordination of tasks and events.

Advanced AI and NLP Capabilities:


The system's advanced artificial intelligence and Natural Language Processing (NLP)
capabilities enable intuitive interaction with users, allowing them to communicate and schedule
tasks in a natural conversational manner.

Real-time Updates:
Real-time updates ensure that scheduled events and tasks are accurately reflected within
Slack channels, providing users with up-to-date information and minimizing scheduling
conflicts.

Improved User Experience:


The proposed system significantly enhances the user experience within Slack by offering
a smart, intuitive, and personalized scheduling assistant. Users can easily manage their
schedules, collaborate with team members, and receive proactive recommendations, thereby
streamlining organizational tasks and enhancing overall satisfaction.

STRATEGIC ENHANCEMENT AI-POWERED SCHEDULING ASSISTANT BOT


Page 6
St. Peter’s Engineering College (Autonomous) Department of CSE(AI&ML)

CHAPTER-3
3. ANALYSIS
3.1 INTRODUCTION

The analysis presented herein examines the proposed AI-powered Slack scheduler, which
integrates Real Time Messaging (RTM) API, API.AI, and Google Calendar API to enhance scheduling
efficiency and user experience within the Slack platform. This analysis explores the system's key
components, functionality, advantages, and potential impact on organizational productivity and
collaboration. By delving into the intricacies of the proposed system, this analysis aims to provide
insights into its capabilities, strengths, and potential areas for improvement. Through a comprehensive
examination, stakeholders can gain a deeper understanding of how the AI-powered Slack scheduler can
revolutionize scheduling processes, streamline communication, and optimize task management within
Slack channels.

3.2 SOFTWARE REQUIREMENT SPECIFICATION

The software requirements specification (SRS) outlines the key features of the proposed AI-
powered Slack scheduler. It integrates Real Time Messaging (RTM) API, API.AI, and Google Calendar
API to streamline scheduling within Slack. Users interact through natural language, allowing easy
scheduling of events. Real-time communication ensures instant updates, while NLP enables accurate
interpretation of user queries. Integration with Google Calendar syncs existing schedules. Machine
learning provides personalized scheduling recommendations. Non-functional requirements include
performance, security, usability, and reliability. Constraints and dependencies on external APIs are
considered. Overall, the SRS guides the development of an efficient and user-friendly scheduler within
Slack.

3.2.1 USER REQUIREMENTS


The user requirements for the AI-Powered Slack Scheduler are centered around ease of use, real-
time communication, accurate scheduling, integration with Google Calendar, personalized
recommendations, reliability, security, customization options, feedback mechanisms, and
compatibility/accessibility. Users seek an intuitive interface enabling effortless scheduling within Slack,
with the bot adeptly interpreting natural language inputs and providing timely updates. Integration with
Google Calendar is crucial for seamless synchronization of existing schedules. Personalized
recommendations enhance productivity, while reliability, security, and performance are essential for
uninterrupted scheduling. Customization options allow users to tailor the bot to their preferences, with
feedback mechanisms ensuring continuous improvement. Compatibility and accessibility across devices
and platforms are also key considerations. These user requirements guide the development of a user-
centric Slack scheduler, ensuring it effectively meets the needs of its diverse user base.

STRATEGIC ENHANCEMENT AI-POWERED SCHEDULING ASSISTANT BOT


Page 7
St. Peter’s Engineering College (Autonomous) Department of CSE(AI&ML)

3.2.2 SOFTWARE REQUIREMENTS

 Slack App
 Coding Language: Java Script
 RTM API
 Cloud Platform
 AI.API
 Google Calendar API

Technologies:

JavaScript:

JavaScript, a high-level programming language, is renowned for its pivotal role in creating dynamic
and interactive content on websites. Initially conceived by Brendan Eich while working at Netscape
Communications Corporation in 1995, JavaScript was envisioned as a lightweight language to add
functionality to web pages. Its creation was prompted by the need for a scripting language that could
be executed directly within web browsers, allowing for client-side interactions without relying solely
on server requests. As the web evolved and the demand for more engaging user experiences grew,
JavaScript emerged as an indispensable tool for web developers. Its versatility and ease of use enabled
developers to enhance websites with dynamic features such as form validation, interactive maps,
animated elements, and responsive interfaces.

One significant milestone in JavaScript's journey was its standardization under the name ECMAScript.
The ECMAScript specification defines the syntax, semantics, and behavior of the language, providing
a common standard for JavaScript implementations across different browsers and environments. This
standardization ensured consistency and interoperability, making JavaScript a ubiquitous language for
web development. JavaScript's capabilities extend far beyond its original scope. While it remains a
cornerstone of frontend web development, its reach has expanded to encompass various domains. With
the advent of Node.js, JavaScript found its way into server-side programming, allowing developers to
build scalable and efficient backend.

In addition to its role in web development, JavaScript has found applications in mobile app
development, game development, desktop applications, and even in emerging technologies such as IoT
and machine learning. Its adaptability and cross-platform compatibility have made it a versatile
language capable of powering a wide range of software projects.

STRATEGIC ENHANCEMENT AI-POWERED SCHEDULING ASSISTANT BOT


Page 8
St. Peter’s Engineering College (Autonomous) Department of CSE(AI&ML)

NATURAL LANGUAGE PROCESSING

Using Natural Language Processing (NLP) as an API for an AI assistant designed for scheduling
meetings can greatly enhance the user experience and efficiency of the scheduling process. Here's how
NLP can be utilized as an API for such an AI assistant:

User Input Parsing: The AI assistant can utilize NLP to parse incoming messages or voice commands
from users regarding meeting scheduling. NLP algorithms can extract key information such as meeting
date, time, duration, location, attendees and agenda from natural language input.

Intent Recognition: NLP helps the AI assistant recognize the user's intent behind their messages
related to scheduling meetings. By understanding the intent, the assistant can take appropriate actions,
such as creating, rescheduling, or canceling meetings, as per the user's request.

Smart Suggestions: Using NLP, the AI assistant can provide smart suggestions or recommendations to
users when scheduling meetings. It can analyze the user's preferences, schedule availability, and
previous interactions to propose suitable meeting times and locations, thereby streamlining the
scheduling process.

Conflict Resolution: NLP algorithms can detect potential scheduling conflicts by analyzing the user's
calendar and existing meeting appointments. If a proposed meeting time conflicts with other
commitments, the AI assistant can notify the user and suggest alternative time slots.

Natural Language Interaction: With NLP as the API, the AI assistant can engage in natural language
interactions with users during the scheduling process. Users can communicate with the assistant in a
conversational manner, making requests, asking questions, and providing clarifications using natural
language.

MONGODB:

MongoDB offers a robust foundation for developing an AI assistant application tailored for scheduling
meetings. With its flexible document-based data model, MongoDB accommodates diverse meeting
details such as date, time, location, attendees, and agendas within its collections. Its scalability ensures
seamless handling of increasing data volumes and user interactions, guaranteeing responsiveness as
the application grows. MongoDB's real-time data access enables swift retrieval and updates to meeting
information, facilitating dynamic scheduling interactions. Additionally, its powerful querying
capabilities allow for efficient searches for available slots and identification of scheduling conflicts.
MongoDB's integration with AI technologies enhances the application's capabilities, enabling
personalized meeting suggestions and predictive scheduling. With MongoDB's security features
ensuring data protection, developers can confidently build a scalable, efficient, and secure AI assistant
for meeting scheduling. MongoDB offers a robust foundation for developing an AI assistant
application tailored for scheduling meetings. With its flexible document-based data model, MongoDB
accommodates diverse meeting details such as date, time, location, attendees, and agendas

STRATEGIC ENHANCEMENT AI-POWERED SCHEDULING ASSISTANT BOT


Page 9
St. Peter’s Engineering College (Autonomous) Department of CSE(AI&ML)

CLOUD PLATFORM

Utilizing the cloud for an AI assistant application designed for scheduling meetings offers a plethora
of advantages. Cloud computing platforms provide unparalleled scalability, allowing the application to
effortlessly handle fluctuations in user demand without compromising performance. Additionally, by
hosting the application in the cloud, users gain accessibility from any location with internet
connectivity, ensuring convenience and seamless interaction. The cloud's robust infrastructure
guarantees reliability, minimizing downtime and ensuring uninterrupted access to scheduling
functionalities. Moreover, cloud environments offer flexibility, enabling developers to rapidly deploy
updates and new features to meet evolving user needs. Overall, leveraging the cloud empowers
organizations to deliver a highly scalable, accessible, reliable, and flexible AI assistant for meeting
scheduling, enhancing productivity and user satisfaction.

SLACK API’S

Integrating Slack APIs to build an app within the Slack platform for an AI assistant designed for
scheduling meetings can enhance collaboration and streamline communication among team members.
By leveraging Slack APIs, the AI assistant can interact with users directly within Slack channels or
through direct messages, making it convenient for users to schedule meetings without leaving the
Slack environment. The app can utilize Slack's messaging and bot APIs to receive scheduling requests,
provide meeting suggestions, and confirm appointments in real-time. Additionally, Slack's interactive
message features allow the AI assistant to present meeting options, gather feedback, and finalize
meeting details seamlessly within Slack conversations. Moreover, by integrating with Slack's event
API, the AI assistant can automatically update team members' calendars, send meeting reminders, and
handle scheduling conflicts without manual intervention. Overall, leveraging Slack APIs enables the
AI assistant to become an integral part of the team's workflow, enhancing productivity and
collaboration in scheduling meetings.

GOOGLE CALENDAR API’S

Integrating Google APIs, such as Google Calendar, into an AI assistant application designed for
scheduling meetings can greatly enhance its functionality and user experience. By leveraging Google
Calendar API, the AI assistant can seamlessly access users' calendars, retrieve scheduling preferences,
and create or modify events directly within their Google Calendar accounts. This integration allows
the AI assistant to offer personalized meeting suggestions based on users' availability, avoid
scheduling conflicts, and automatically update calendars with newly scheduled meetings. Additionally,
Google Calendar API provides features like reminders and notifications, enabling the AI assistant to
send timely alerts to users about upcoming meetings and ensure they stay organized and punctual.
Overall, integrating Google Calendar API empowers the AI assistant to streamline the meeting
scheduling process and provide a more efficient and convenient scheduling experience for users.

STRATEGIC ENHANCEMENT AI-POWERED SCHEDULING ASSISTANT BOT


Page 10
St. Peter’s Engineering College (Autonomous) Department of CSE(AI&ML)

3.2.3 HARDWARE REQUIREMENTS

The hardware requirement specifies each interface of the software elements and the hardware
elements of the system. These hardware requirements include configuration characteristics.

 Processor : Intel Core i5 or above.


 Ram : 8 GB
 Storage : 256 GB SSD
 Graphics Card : Integrated graphics

3.3 CONTENT DIAGRAM OF PROJECT:


The system architecture for the AI-powered Slack scheduler comprises a User Interface for interaction,
Real Time Messaging (RTM) API for communication, and API.AI for natural language processing. Additionally,
the Google Calendar API facilitates calendar integration, ensuring seamless scheduling functionality within
Slack.

Figure 3.1 System Architecture

STRATEGIC ENHANCEMENT AI-POWERED SCHEDULING ASSISTANT BOT


Page 11
St. Peter’s Engineering College (Autonomous) Department of CSE(AI&ML)

3.4 ALGORITHMS AND FLOWCHARTS

Natural Language Processing (NLP):


NLP algorithms are used to parse and understand user inputs in natural language.
Techniques such as tokenization, part-of-speech tagging, and named entity recognition are
employed to extract relevant information from user queries and commands.

Machine Learning (ML):


Machine learning algorithms are utilized for various purposes within the scheduler,
including personalized scheduling recommendations and user behavior analysis. Supervised
learning algorithms may be employed to train models that predict user preferences based on
historical data, while unsupervised learning algorithms could be used for clustering similar
scheduling patterns.

Text Classification:
Text classification algorithms may be used to categorize user queries into different
intents or categories, allowing the system to understand the user's intent and take appropriate
actions accordingly.

Example-1

STRATEGIC ENHANCEMENT AI-POWERED SCHEDULING ASSISTANT BOT


Page 12
St. Peter’s Engineering College (Autonomous) Department of CSE(AI&ML)

Flow diagram:

3.5 Flow Diagram

STRATEGIC ENHANCEMENT AI-POWERED SCHEDULING ASSISTANT BOT


Page 13
St. Peter’s Engineering College (Autonomous) Department of CSE(AI&ML)

CHAPTER-4
4. DESIGN
4.1 INTRODUCTION
The input design for the AI-powered Slack scheduler involves designing user interfaces and mechanisms
through which users can provide input to the system. This includes various forms of input such as text commands,
natural language queries, and graphical user interfaces (GUIs). For text-based input, users can interact with the
scheduler by typing commands directly into the Slack chat interface, specifying actions such as creating, editing,
or deleting events, or requesting scheduling recommendations. Natural language processing (NLP) techniques are
employed to interpret and extract meaningful information from these textual inputs, enabling the system to
understand user intentions accurately. Additionally, graphical user interfaces (GUIs) may be provided to facilitate
more intuitive interaction, allowing users to select options, input data through forms, or interact with visual
elements to perform scheduling tasks. Overall, the input design aims to provide users with multiple channels for
interacting with the system, ensuring flexibility, ease of use, and seamless integration within the Slack platform.

4.2 UML DIAGRAMS


Unified Modeling Language (UML) diagrams serve as a universal language for visualizing, constructing,
and documenting software systems. They provide a standardized way to depict various aspects of a system's
structure, behavior, and interactions. In essence, UML diagrams offer a graphical representation that aids in
understanding, communicating, and designing complex systems across different stages of software development.
These diagrams encapsulate diverse perspectives, ranging from high-level structural views like class
diagrams to dynamic behavior representations such as sequence and activity diagrams. Overall, UML diagrams
play a pivotal role in fostering clear communication, facilitating design decisions, and ensuring cohesion among
stakeholders throughout the software development lifecycle.

4.2.1 GOALS

The Primary goals in the design of the UML are as follows:


 Provide users a ready-to-use, expressive visual modeling Language so that they can develop and
exchange meaningful models.
 Provide extendibility and specialization mechanisms to extend the core concepts.
 Be independent of particular programming languages and development process.
 Provide a formal basis for understanding the modeling language.
 Encourage the growth of tools market.
 Support higher level development concepts such as collaborations, frameworks, patterns and
components.
 Integrate best practices.

STRATEGIC ENHANCEMENT AI-POWERED SCHEDULING ASSISTANT BOT


Page 14
St. Peter’s Engineering College (Autonomous) Department of CSE(AI&ML)

4.2.2 CLASS DIAGRAM

In software engineering, a class diagram in the Unified Modeling Language (UML) is a


type of static structure diagram that describes the structure of a system by showing the system's
classes, their attributes, operations (or methods), and the relationships among the classes. It
explains which class contains information.

Figure 4.1 Class Diagram

STRATEGIC ENHANCEMENT AI-POWERED SCHEDULING ASSISTANT BOT


Page 15
St. Peter’s Engineering College (Autonomous) Department of CSE(AI&ML)

4.2.3 SEQUENCE DIAGRAM:

A sequence diagram in Unified Modeling Language (UML) is a kind of interaction

diagram that shows how processes operate with one another and in what order. It is a construct
of a Message Sequence Chart. Sequence diagrams are sometimes called event diagrams, event
scenarios, and timing diagrams.

Figure 4.2 Sequence Diagram

STRATEGIC ENHANCEMENT AI-POWERED SCHEDULING ASSISTANT BOT


Page 16
St. Peter’s Engineering College (Autonomous) Department of CSE(AI&ML)

4.2.4 USE CASE DIAGRAM

A use case diagram in the Unified Modeling Language (UML) is a type of behavioral
diagram defined by and created from a Use-case analysis. Its purpose is to present a graphical

overview of the functionality provided by a system in terms of actors, their goals (represented as
use cases), and any dependencies between those use cases. The main purpose of a use case
diagram is to show what system functions are performed for which actor. Roles of the actors in
the system can be depicted.

Figure 4.3 Use Case Diagram

STRATEGIC ENHANCEMENT AI-POWERED SCHEDULING ASSISTANT BOT


Page 17
St. Peter’s Engineering College (Autonomous) Department of CSE(AI&ML)

4.3 MODULE DESIGN AND ORGANIZATION

The AI-powered Slack scheduler system is organized into several interconnected modules, each
responsible for specific functionalities and components of the system. The User Management module
handles user authentication, registration, and profile management, ensuring secure access to the system.
The Scheduling module orchestrates the creation, modification, and deletion of events and tasks within
the Slack environment, integrating with external calendar services and providing real-time updates. The
Natural Language Processing (NLP) module processes user inputs, interprets commands, and extracts
relevant information using advanced linguistic analysis techniques. The Machine Learning module
employs algorithms to analyze user behavior, preferences, and historical data, enabling the system to
generate personalized scheduling recommendations and insights. The Integration module facilitates
seamless communication and data exchange between the Slack platform and external APIs, such as Real
Time Messaging (RTM) API and Google Calendar API, ensuring smooth integration and
interoperability. The Monitoring and Logging module tracks system performance, user interactions, and
error logs, providing valuable insights for system optimization and troubleshooting. These modules
work together synergistically to deliver a comprehensive and intelligent scheduling solution within the
Slack ecosystem, enhancing productivity and user experience.

In addition to the aforementioned modules, the AI-powered Slack scheduler system may also
incorporate modules for Security, Analytics, and Administration. The Security module is responsible for
implementing robust security measures to protect user data, including encryption, access control, and
threat detection mechanisms, ensuring the confidentiality, integrity, and availability of information
within the system. The Analytics module collects and analyzes user data, scheduling patterns, and
system usage metrics to derive valuable insights into user behavior, system performance, and
scheduling trends. These insights can inform decision-making processes, identify areas for
improvement, and enhance the overall effectiveness of the scheduling system. The Administration
module provides administrative tools and functionalities for system administrators to manage user
accounts, configure system settings, and perform maintenance tasks. This module enables
administrators to oversee the system's operation, enforce policies, and ensure smooth operation and
adhere.

STRATEGIC ENHANCEMENT AI-POWERED SCHEDULING ASSISTANT BOT


Page 18
St. Peter’s Engineering College (Autonomous) Department of CSE(AI&ML)

CHAPTER-5
5. IMPLEMENTATION & RESULTS

5.1 INTRODUCTION
The implementation of the AI-Powered Slack Scheduler involves integrating Real Time Messaging
(RTM) API, API.AI, and Google Calendar API within the Slack platform. This process enables natural language
understanding, real-time communication, and synchronization with Google Calendar for seamless scheduling.
Additionally, machine learning techniques are employed to provide personalized recommendations. The
implementation aims to create a user-friendly and efficient scheduling assistant within Slack channels, enhancing
productivity and collaboration.

5.2 EXPLANATION OF KEY FUNCTIONS

The key functions of the AI-Powered Slack Scheduler encompass various aspects of scheduling,
communication, and interaction within the Slack platform. Here's an explanation of each function:

 Natural Language Understanding (NLU):


This function enables the scheduler bot to interpret and understand natural language inputs from
users. It involves processing user queries, extracting relevant information, and identifying the
user's intent or desired action.

 Real-Time Communication:
The real-time communication function ensures that users receive instant updates, notifications,
and reminders for scheduled events and tasks within Slack channels. It leverages the Real Time
Messaging (RTM) API to facilitate seamless communication between the bot and users.

 Scheduling and Event Management:


This function allows users to schedule, update, and manage events, tasks, and appointments
directly within Slack channels. Users can specify event details such as event name, date, time,
location, and participants, and the scheduler bot handles the scheduling process accordingly.

 Integration with Google Calendar:


The integration with Google Calendar allows users to synchronize their existing schedules and
events with the Slack scheduler. Users can view, update, and manage their Google Calendar
events directly within Slack, ensuring seamless coordination between the two platforms.

STRATEGIC ENHANCEMENT AI-POWERED SCHEDULING ASSISTANT BOT


Page 19
St. Peter’s Engineering College (Autonomous) Department of CSE(AI&ML)

 Personalized Recommendations:
This function provides users with personalized scheduling recommendations based on their
preferences, behaviors, and past interactions. It leverages machine learning algorithms to
analyze user data and suggest relevant events, tasks, or scheduling options tailored to individual
users.
 Feedback Mechanism:
The feedback mechanism allows users to provide input on the scheduler bot's performance,
suggest improvements, and report any issues or errors encountered during scheduling. This
function helps the development team gather valuable insights and continuously improve the bot's
functionality and user experience.

 Security and Privacy:


The security and privacy function ensures that users' scheduling data, including calendar events
and personal information, is securely stored and protected from unauthorized access. It includes
measures such as data encryption, authentication mechanisms, and compliance with data
protection regulations.

 Feedback and Improvement Mechanisms:


The security and privacy function ensures that users' scheduling data, including calendar events
and personal information, is securely stored and protected from unauthorized access. It includes
measures such as data encryption, authentication mechanisms, and compliance with data
protection regulations.

5.3 Method Of Implementation

 Requirement Analysis:
Begin by thoroughly understanding the requirements outlined in the software requirements
specification (SRS). Identify the functional and non-functional requirements, constraints, and
dependencies of the system.

 API Integration:
Integrate the Real Time Messaging (RTM) API, API.AI, and Google Calendar API into the
Slack platform. Follow the documentation and guidelines provided by each API to establish
communication and data exchange between Slack and external services.

STRATEGIC ENHANCEMENT AI-POWERED SCHEDULING ASSISTANT BOT


Page 20
St. Peter’s Engineering College (Autonomous) Department of CSE(AI&ML)

 Natural Language Processing (NLP):


For Implement NLP techniques to parse and understand natural language inputs from users.
Use libraries or frameworks such as NLTK (Natural Language Toolkit) or spaCy to tokenize, tag,
and extract relevant information from user queries.

 Machine Learning (ML):


Develop machine learning models to provide personalized scheduling recommendations and
analyze user behavior. Collect and preprocess training data, train the models using algorithms such
as supervised learning or reinforcement learning, and evaluate their performance.

 Event Management and Scheduling:


Implement functionalities for users to schedule, update, and manage events, tasks, and
appointments within Slack channels. Develop user interfaces and interaction flows to facilitate
seamless scheduling processes.

 Google Calendar Integration:


Integrate with the Google Calendar API to synchronize users' existing schedules and events.
Implement functionalities for users to view, update, and manage their Google Calendar events
directly within Slack.

Finally, By following these implementation methodologies, the AI-Powered Slack Scheduler


can be developed and deployed effectively, providing users with a seamless and efficient scheduling
experience within the Slack platform.

STRATEGIC ENHANCEMENT AI-POWERED SCHEDULING ASSISTANT BOT


Page 21
St. Peter’s Engineering College (Autonomous) Department of CSE(AI&ML)

5.3.1 Forms

1. User Registration Form:

For new users or team members joining the Slack workspace, a user registration form may be used
to collect basic information such as name, email address, and role within the organization. It
streamlines the onboarding process and ensures accurate user identification within the scheduling
system.

2. Event Scheduling Form:

This form allows users to input details such as event name, date, time, location, description, and
participants when scheduling new events or appointments within Slack. It facilitates structured data
entry for accurate event creation.

3. Feedback Form:

The feedback form enables users to provide input on the scheduler bot's performance, suggest
improvements, and report any issues or errors encountered during scheduling. It may include fields
for rating the bot's effectiveness, providing comments, and specifying the nature of the feedback.

Example-2

STRATEGIC ENHANCEMENT AI-POWERED SCHEDULING ASSISTANT BOT


Page 22
St. Peter’s Engineering College (Autonomous) Department of CSE(AI&ML)

5.3.2 Output Screens

In above screen click on ‘Sync Google Calendar’

STRATEGIC ENHANCEMENT AI-POWERED SCHEDULING ASSISTANT BOT


Page 23
St. Peter’s Engineering College (Autonomous) Department of CSE(AI&ML)

Figure 5.1 Syncing Google Calendar

STRATEGIC ENHANCEMENT AI-POWERED SCHEDULING ASSISTANT BOT


Page 24
St. Peter’s Engineering College (Autonomous) Department of CSE(AI&ML)

In the below screen sign in with gmail

STRATEGIC ENHANCEMENT AI-POWERED SCHEDULING ASSISTANT BOT


Page 25
St. Peter’s Engineering College (Autonomous) Department of CSE(AI&ML)

Figure 5.2 Sign In With Gmail

In the below screen message with the AI Scheduling Bot

STRATEGIC ENHANCEMENT AI-POWERED SCHEDULING ASSISTANT BOT


Page 26
St. Peter’s Engineering College (Autonomous) Department of CSE(AI&ML)

Figure 5.3 Quick Messaging

STRATEGIC ENHANCEMENT AI-POWERED SCHEDULING ASSISTANT BOT


Page 27
St. Peter’s Engineering College (Autonomous) Department of CSE(AI&ML)

In the below screen AI Assistant will schedule meeting with the person you want

STRATEGIC ENHANCEMENT AI-POWERED SCHEDULING ASSISTANT BOT


Page 28
St. Peter’s Engineering College (Autonomous) Department of CSE(AI&ML)

Figure 5.4 Scheduling Meeting Through Bot

In the below screen user can have a view of the details

Figure 5.5 Details of the Meeting

STRATEGIC ENHANCEMENT AI-POWERED SCHEDULING ASSISTANT BOT


Page 29
St. Peter’s Engineering College (Autonomous) Department of CSE(AI&ML)

In the below screen we can accept meeting or rescheduling meeting if your not available at that slot

Figure 5.6 Reschedule Meeting

STRATEGIC ENHANCEMENT AI-POWERED SCHEDULING ASSISTANT BOT


Page 30
St. Peter’s Engineering College (Autonomous) Department of CSE(AI&ML)

In the above screen scheduled meeting will be giving reminder from google calendar

Figure 5.7 Remainder In Google Calendar

STRATEGIC ENHANCEMENT AI-POWERED SCHEDULING ASSISTANT BOT


Page 31
St. Peter’s Engineering College (Autonomous) Department of CSE(AI&ML)

CHAPTER-6
6. TESTING & VALIDATION
6.1 INTRODUCTION
Testing and validation are pivotal phases in the development lifecycle of the AI-powered Slack
scheduler. These processes play a crucial role in ensuring the system's reliability, functionality, and user
satisfaction. Testing involves meticulously assessing the system's functionalities, features, and
performance against predefined criteria and use cases. Validation, on the other hand, is focused on
verifying that the system effectively addresses user needs and expectations, particularly in streamlining
scheduling challenges within the Slack platform. These phases are iterative and collaborative, engaging
stakeholders, developers, and users alike to ensure comprehensive coverage and effectiveness. This
document delineates the testing and validation strategies, methodologies, and approaches utilized to
meticulously verify the functionality, usability, reliability, and performance of the AI-powered Slack
scheduler. Ultimately, these efforts are geared towards facilitating the seamless deployment and
widespread adoption of the scheduling assistant, enhancing productivity and user satisfaction within the
Slack ecosystem.

6.2 TYPES OF TESTS


Unit testing:
Unit testing involves the design of test cases that validate that the internal program logic
is functioning properly, and that program inputs produce valid outputs. All decision branches
and internal code flow should be validated. It is the testing of individual software units of the
application .it is done after the completion of an individual unit before integration. This is a
structural testing, that relies on knowledge of its construction and is invasive. Unit tests perform
basic tests at component level and test a specific business process, application, and/or system
configuration.
Integration testing:
In the context of the AI-powered Slack scheduler, integration testing focuses on verifying
the interactions between different modules, such as the user interface, scheduling logic, natural
language processing (NLP) engine, and external APIs. Test cases are designed to validate
communication protocols, data flow, and behavior between these components, ensuring that they
seamlessly interact and exchange information to perform scheduling tasks accurately and
efficiently. Integration testing may involve testing individual components in isolation and then
gradually combining them to assess their interoperability and compatibility. Additionally, mock
objects or stubs may be used to simulate the behavior of external dependencies, , such as the
Google Calendar API or the Slack RTM API, allowing testers to control and manipulate inputs
and outputs during testing. By conducting integration testing, developers can identify and
resolve issues related to interface mismatches, data inconsistencies, and communication errors,
ensuring that the AI-powered Slack scheduler operates smoothly and reliably across its entire
architecture.

STRATEGIC ENHANCEMENT AI-POWERED SCHEDULING ASSISTANT BOT


Page 32
St. Peter’s Engineering College (Autonomous) Department of CSE(AI&ML)

White box testing:

White box testing, also known as structural testing or glass box testing, is a software
testing technique that examines the internal structure and implementation details of a system. In
the context of the AI-powered Slack scheduler, white box testing involves analyzing the
system's source code, algorithms, and design to develop test cases that target specific paths,
conditions, and functionalities within the codebase. Testers utilize knowledge of the system's
internal logic and structure to design tests that exercise various code paths, branches, and
statements, aiming to uncover errors, vulnerabilities, and inefficiencies in the implementation.
White box testing techniques include statement coverage, branch coverage, path coverage, and
condition coverage, which assess the extent to which different parts of the codebase are executed
and evaluated during testing.

Black box testing:


Black box testing, also known as functional testing, is a software testing technique
focused on evaluating the functionality of a system without examining its internal structure or
implementation details. In the context of the AI-powered Slack scheduler, black box testing
involves testing the system's functionality from an end-user perspective, without knowledge of
the underlying algorithms or codebase. Test cases are designed based on the system's
specifications, requirements, and expected behavior, with the goal of verifying that the scheduler
performs as intended and meets user needs. Testers interact with the system through its user
interface or application programming interfaces (APIs), inputting various commands, messages,
and scenarios to assess how the scheduler responds. Test cases cover a range of scenarios,
including creating, editing, and deleting events, receiving scheduling recommendations,
handling conflicts, and interacting with the AI assistant. Through black box testing, potential
defects, errors, and inconsistencies in the system's functionality can be identified and addressed,
ensuring that the AI-powered Slack scheduler delivers a reliable and user-friendly scheduling
experience.

System testing:
System testing ensures that the entire integrated software system meets requirements. It
tests a configuration to ensure known and predictable results System testing is based on process
descriptions and flows, emphasizing pre-driven process links and integration points.

Acceptance testing:
User Acceptance Testing is a critical phase of any project and requires significant
participation by the end user. It also ensures that the system meets the functional requirements.

STRATEGIC ENHANCEMENT AI-POWERED SCHEDULING ASSISTANT BOT


Page 33
St. Peter’s Engineering College (Autonomous) Department of CSE(AI&ML)

STRATEGIC ENHANCEMENT AI-POWERED SCHEDULING ASSISTANT BOT


Page 34
St. Peter’s Engineering College (Autonomous) Department of CSE(AI&ML)

System testing:
System testing ensures that the entire integrated software system meets requirements. It
tests a configuration to ensure known and predictable results System testing is based on process
descriptions and flows, emphasizing pre-driven process links and integration points.

Acceptance testing:
User Acceptance Testing is a critical phase of any project and requires significant
participation by the end user. It also ensures that the system meets the functional requirements.

6.3 TEST CASES AND SCENARIOS


Test cases and scenarios form the backbone of a structured testing process, outlining specific
conditions and actions to verify the functionality and quality of a system or application. These
documents serve as a blueprint for testing activities, ensuring comprehensive coverage of various
scenarios. Test cases are detailed instructions specifying inputs, actions, and expected outcomes for
individual functionalities, while test scenarios represent broader situations or paths through the
application.

6.4 VALIDATION

Validation for the AI-powered Slack scheduler involves verifying that the system meets user
requirements and effectively addresses scheduling challenges within the Slack platform. This validation
process encompasses several key aspects, including functionality, usability, reliability, and
performance. Functionality validation ensures that the scheduler performs essential tasks such as
creating, editing, and deleting events, generating scheduling recommendations, and interacting with
users through natural language processing (NLP) commands accurately and efficiently.AI-powered
Slack scheduler meets their expectations, addresses their scheduling needs effectively, and delivers a
seamless scheduling experience within the Slack platform.

STRATEGIC ENHANCEMENT AI-POWERED SCHEDULING ASSISTANT BOT


Page 35
St. Peter’s Engineering College (Autonomous) Department of CSE(AI&ML)

CHAPTER-7
7. CONCLUSION

7.1 PROJECT CONCLUSION:

The development of a Slack scheduler powered by artificial intelligence holds great promise for
enhancing the productivity and efficiency of users within the Slack platform. By integrating advanced
technologies such as AI, NLP, and machine learning, the system offers several key advantages.
Firstly, the use of Real Time Messaging (RTM) API enables instant collaboration and
communication between users and the AI assistant. This real-time connectivity ensures that users can
interact with the scheduler seamlessly, receiving immediate responses and updates.
Secondly, the incorporation of AI and NLP capabilities allows for a natural conversational
interface. Users can interact with the scheduler in a way that feels intuitive and human-like, making it
easier to communicate scheduling preferences and make changes on the fly. This natural language
understanding also enables the scheduler to accommodate users who speak different languages, further
enhancing its accessibility and usability.
Furthermore, the integration of the Google Calendar API provides robust functionality for
managing events and schedules. Users can easily add, modify, and view events directly from within
Slack, streamlining the scheduling process and ensuring that all relevant information is readily
accessible.
Moreover, the application of machine learning techniques enables the AI assistant to
continuously improve its understanding of user preferences and behaviors. By analyzing past
interactions and feedback, the scheduler can make personalized recommendations and anticipate users'
scheduling needs, leading to a more tailored and efficient experience over time.
As the development of the Slack scheduler progresses, the system's planning efficiency will
continue to evolve. Through ongoing refinement of approach modeling and learning from user behavior,
the scheduler will become increasingly adept at optimizing schedules and accommodating users' diverse
needs and preferences.

In conclusion, the Slack scheduler represents a sophisticated and user-friendly solution for
organizing events and managing schedules within the Slack platform. By leveraging the latest
advancements in artificial intelligence and leveraging the power of real-time communication and
collaboration, the scheduler empowers users to streamline their workflow and enhance productivity.

STRATEGIC ENHANCEMENT AI-POWERED SCHEDULING ASSISTANT BOT


Page 36
St. Peter’s Engineering College (Autonomous) Department of CSE(AI&ML)

7.2 FUTURE ENHANCEMENT:

In Natural Language Generation (NLG): One avenue for improvement involves implementing
NLG capabilities within the Slack scheduler. NLG allows the system to generate natural language
responses and summaries based on scheduling events. By incorporating NLG, the scheduler can provide
users with more informative and personalized feedback, enhancing the conversational experience and
improving user engagement.

Intelligent Scheduling Algorithms Developing advanced scheduling algorithms can optimize


meeting times, resource allocation, and conflict resolution. These algorithms can consider factors such
as user availability, preferences, and priority levels to generate optimal schedules. By leveraging
intelligent scheduling algorithms, the Slack scheduler can streamline the scheduling process and
improve overall efficiency.

Smart Notifications Enhancing notification capabilities with smart notifications can provide users
with timely reminders, updates, and suggestions tailored to their context and preferences. Smart
notifications can include proactive reminders for upcoming events, suggested meeting times based on
availability, and real-time updates on schedule changes. By delivering relevant information at the right
time, smart notifications can improve user productivity and responsiveness.

Integration with Virtual Assistants Integrating the Slack scheduler with virtual assistants like Siri,
Cortana, or Bixby enables users to schedule meetings and manage calendars through voice commands.
This hands-free approach enhances accessibility and convenience, allowing users to interact with the
scheduler seamlessly while multitasking or on the go.

Predictive analytics techniques can enable the Slack scheduler to anticipate users' scheduling
needs and preferences. By analyzing historical data and patterns, the scheduler can proactively suggest
meeting times, recommend relevant resources, and predict future scheduling trends. Predictive analytics
empowers users to make informed decisions and plan their schedules more effectively.

Cross-Platform Compatibility Ensuring seamless integration and compatibility with other


platforms and communication tools enhances the versatility and usability of the Slack scheduler.
Integration with email clients, project management software, and collaboration platforms facilitates
cross-platform communication and scheduling, enabling users to manage their schedules more
efficiently across different platforms.

STRATEGIC ENHANCEMENT AI-POWERED SCHEDULING ASSISTANT BOT


Page 37
St. Peter’s Engineering College (Autonomous) Department of CSE(AI&ML)

REFERENCES

[1] Ahuja, Priyanka. "Al Planning Assistant for Scheduling Daily Activities." (2018).
https://csuepress.columbusstate.edu/theses_dissertations/355
[2] Berry, Pauline M., et al. "Evaluating User-AdaptiveSystems: Lessons from Experiences with a
Personalized Meeting Scheduling Assistant." IAAI. Vol. 9. 2009.
https://aaai.org/
[3] Beer, A., Gartner, J., Musliu, N., Schafhauser, W., &Slany, W. (2010). An AI-based break-
scheduling system for supervisory personnel. IEEE IntelligentSystems, 25(2),60-73.
https://doi.org/10.1109/MIS.2010.40
[4] Chowdhary, Anand. "Email-based Intelligent VirtualAssistant for scheduling (EIVA)." Bachelor's
thesis,University of Twente, 2020.
https://purl.utwente.nl/essays/81424
[5] Gardan Dinesh, Tanya, et al. "Ai bot for academic schedules using rasa." 2021 International
Conference on Innovative Computing, Intelligent Communication and Smart Electrical Systems
(ICSES). IEEE, 2021.
https://doi.org/10.1109/ICSES52305.2021.9633799
[6] Doshi, A., Shah, R., Bhimani, D., Patel, B., & Mali, S.(2017). Donna-A web based AI Personal
Assistant. International Journal of Computer
[7] Myers, Karen, Pauline Berry, Jim Blythe, Ken Conley,Melinda Gervasio, Deborah L. McGuinness,
David Morley, Avi Pfeffer, Martha Pollack, and Milind Tambe. "An intelligent personal assistant
for task and time management." AI Magazine 28, no. 2 (2007): 47- 47.
https://doi.org/10.1609/aimag.v28i2.2039
[8] Cranefield, J., Winikoff, M., Chiu, Y. T., Li, Y., Doyle,C., & Richter, A. (2023). Partnering with
AI: The case of digital productivity assistants. Journal of the Royal Society of New Zealand, 53(1),
95-118.
https://doi.org/10.1080/03036758.2022.2114507
[9] T., Huang, L., Song, R. J., Huang, H. F., Jiao, F.,& Ma, W. G. (2023). An improved deep
reinforcement learning approach: A case study foroptimization of berth and yard
scheduling for bulk cargo terminal. Advances in Production Engineering & Management,
18(3).10.14743/apem2023.3.474
[10] Li, N., et al. "Usability Evaluation and Enhancement of the AI-Powered Smart-Campus
Framework: A user- Centred Approach." Journal of Information SystemsEngineering and
Management 8.4 (2023): 23373. https://doi.org/10.55267/iadt.07.14046
[11] Epstein, M., Arakelian, E., Tucker, P. and Dahlgren,A., 2023. Managing Sustainable Working
Hours within Participatory Working Time Scheduling for Nurses and Assistant Nurses: A
Qualitative Interview Study with Managers and Staffing Assistants. Journal of Nursing
Management, 2023.
https://doi.org/10.1155/2023/8096034
[12] Rane N. Integrating Building Information Modelling (BIM) and Artificial Intelligence (AI) for Smart
Construction Schedule, Cost, Quality, and Safety Management: Challenges and Opportunities. Cost,
Quality, and Safety Management: Challenges and Opportunities (September 16, 2023). 2023 Sep 16.
https://dx.doi.org/10.2139/ssrn.4616055Thabtah, Fadi. "Machine learning in autistic spectrum
disorder behavioral research: A review and ways forward. (2018) "Informatics for Health and
Social Care: 1-20.

STRATEGIC ENHANCEMENT AI-POWERED SCHEDULING ASSISTANT BOT


Page 38
St. Peter’s Engineering College (Autonomous) Department of CSE(AI&ML)

[13] Ren, Shan, et al. "A comprehensive review of big dataanalytics throughout product lifecycle to
support sustainable smart manufacturing: A framework, challenges and future research
directions." Journal of cleaner production 210 (2019):1343-
1365.https://doi.org/10.1016/j.jclepro.2018.11.025Global prevalence of autism: A systematic
review update. Zeidan J et al. Autism Research 2022 March.
[14] Lee, Don Hee, and Seong No Yoon. "Application ofartificial intelligence-based technologies in the
healthcare industry: Opportunities and challenges." International Journal of Environmental
Research and Public Health 18, no.1(2021):271. https://doi.org/10.3390/ijerph18010271

LINKS

[1] https://csuepress.columbusstate.edu/theses_dissertations/355
[2] https://aaai.org/
[3] https://doi.org/10.1109/MIS.2010.40
[4] https://purl.utwente.nl/essays/81424
[5] https://doi.org/10.1109/ICSES52305.2021.9633799
[6] https://doi.org/10.1609/aimag.v28i2.2039

STRATEGIC ENHANCEMENT AI-POWERED SCHEDULING ASSISTANT BOT


Page 39
St. Peter’s Engineering College (Autonomous) Department of CSE(AI&ML)

APPENDIX A: SOURCE CODE


var logger = require('morgan');
var google = require('googleapis');
var {User, Reminder, Meeting} = require('./models')
var OAuth2 = google.auth.OAuth2;
var mongoose = require('mongoose');
var _ = require('underscore');
var models = require('./models');
var googleAuth = require('google-auth-library');
var fs = require('fs');
var slackID;
var url;
var {rtm, web} = require('./rtm-client')

mongoose.connect(process.env.MONGODB_URI);
mongoose.Promise = global.Promise;
// var googleAuth = require('google-auth-library');
var express = require('express');
require('./rtm-client');
var app = express();
var bodyParser = require('body-parser');
app.use(logger('dev'));
app.use(bodyParser.urlencoded({extended: false}));
app.use(bodyParser.json());
// var app = express();
var {RtmClient, WebClient, CLIENT_EVENTS, RTM_EVENTS} = require('@slack/client');
var CLIENT_ID = process.env.CLIENT_ID;
var CLIENT_SECRET = process.env.CLIENT_SECRET;
const PORT=3000;
app.get('/oauth', function(req, res){
oauth2Client = new OAuth2(
process.env.GOOGLE_CLIENT_ID,
process.env.GOOGLE_CLIENT_SECRET,
process.env.DOMAIN + '/connect/callback'
)
url = oauth2Client.generateAuthUrl({
access_type: 'offline',
prompt: 'consent',
scope: [
'https://www.googleapis.com/auth/userinfo.profile',
'email',
'https://www.googleapis.com/auth/calendar'
],
state: encodeURIComponent(JSON.stringify({
auth_id: req.query.auth_id
}))
});
slackID = req.query.auth_id
res.redirect(url);
})

STRATEGIC ENHANCEMENT AI-POWERED SCHEDULING ASSISTANT BOT


Page 40
St. Peter’s Engineering College (Autonomous) Department of CSE(AI&ML)

// app.get(
// '/connectcallback', async function(req,res) {
// var tokens = await getToken(req.query.code)
// var mongoUser = await User.findById(wejf)
// }
// )

app.get('/connect/callback', function(req, res) {


const code = req.query.code;
oauth2Client = new OAuth2(
process.env.GOOGLE_CLIENT_ID,
process.env.GOOGLE_CLIENT_SECRET,
process.env.DOMAIN + '/connect/callback'
)
console.log("this is oauth", oauth2Client);
oauth2Client.getToken(code, function (err, tokens) {
if(err) {
console.log(err)
} else {
//set credentials. not entirely sure what this does but necessary for google plus
//when a person gives access to their google calendar, we also make a request to google plus
//with their oauth2client in order to get their email address which is then saved in the user object
//in mongodb.
oauth2Client.setCredentials(tokens);
console.log("this is tokens", tokens);
var plus = google.plus('v1');
plus.people.get({auth: oauth2Client, userId: 'me'}, function(err, person){
if(err){
console.log(err)
} else {
//when a person
console.log("this is googleplus person object", person);
var tempEmail = person.emails[0].value;
let auth_id = JSON.parse(decodeURIComponent(req.query.state));
var newUser = new User({
token: tokens,
slackID: slackID, //TODO: ALSO store slackname so that you can easily add your own
meetings to your calendars too
auth_id: auth_id.auth_id,
email: tempEmail,
pendingInvites: []
});
newUser.save()
.then( () => res.status(200).send("Your account was successfuly authenticated"))
.catch((err) => {
console.log('error in newuser save of connectcallback');
res.status(400).json({error:err});
})
}
});
}
});
})
STRATEGIC ENHANCEMENT AI-POWERED SCHEDULING ASSISTANT BOT
Page 41
St. Peter’s Engineering College (Autonomous) Department of CSE(AI&ML)

// This route handles GET requests to our root ngrok address and responds with the same "Ngrok is
working message" we used before
app.get('/', function(req, res) {
res.send('Ngrok is working! Path Hit: ' + req.url);
});
// Route the endpoint that our slash command will point to and send back a simple response to indicate
that ngrok is working
app.post('/command', function(req, res) {
res.send('Your ngrok tunnel is up and running!');
});

app.post('/slack/interactive', function(req,res){
var payload = JSON.parse(req.body.payload);
console.log('PAYLOAD ACTIONS', payload);
//if the user selects confirm button
if(payload.actions[0].value !== 'false') {
// else if(payload.actions[0].type === "button" && payload.actions[0].value !== 'false') {
slackID = payload.user.id;
User.findOne({slackID: slackID}).exec(function(err, user){
if(err || !user){
console.log(err);
res.send('an error occured');
} else if (user){

var payloadArr = payload.original_message.attachments;

if(payload.original_message.text === "Would you like me to create a reminder for "){


//it was a reminder
console.log('reminder message payload', payload.original_message.attachments[0]);
var reminderSubject = payload.original_message.attachments[0].fields[0].value;
var reminderDate = Date.parse(payload.original_message.attachments[0].fields[1].value);
console.log('rEMINDER DATE IS ', reminderDate,
payload.original_message.attachments[0].fields[1].value);
}
else{
var meetingDuration = 30; //default meeting duration is 1 hour
console.log('meeting duration after some stuff idk what its doing ', meetingDuration);
var meetingSubject = payload.original_message.attachments[0].fields[0].value;
var meetingInvitees = payload.original_message.attachments[0].fields[1].value.split(",");
if(payload.actions[0].type === "select"){ //meeting with conflicts with select list
var newSplit = payload.actions[0].selected_options[0].value.split('T')
var converted = new Date(newSplit[0] + 'T' +
newSplit[1].substring(0,newSplit[1].length-1)+ "+07:00").toISOString();
var meetingTime = converted.slice(11,19);
var meetingDate = converted.slice(0,10)
if(payloadArr[0].fields[2]) {
console.log('meeting duration field was ', payloadArr[0].fields[2]);
//the duration field was provided
let durArr = payloadArr[0].fields[2].value.split(" ");
if(durArr[1] === "h") {
meetingDuration = durArr[0] * 60;
} else {
meetingDuration = durArr[0]
STRATEGIC ENHANCEMENT AI-POWERED SCHEDULING ASSISTANT BOT
Page 42
St. Peter’s Engineering College (Autonomous) Department of CSE(AI&ML)

}
}
}
else { //it was a meeting that had no conflicts
var meetingDate = payload.original_message.attachments[0].fields[2].value;
var meetingTime = payload.original_message.attachments[0].fields[3].value;
if(payloadArr[0].fields[4]) {
console.log('meeting duration field was ', payloadArr[0].fields[4]);
//the duration field was provided
let durArr = payloadArr[0].fields[4].value.split(" ");
if(durArr[1] === "h") {
meetingDuration = durArr[0] * 60;
} else {
meetingDuration = durArr[0]
}
}
}
}

oauth2Client = new OAuth2(


process.env.GOOGLE_CLIENT_ID,
process.env.GOOGLE_CLIENT_SECRET,
process.env.DOMAIN + '/connect/callback'
)
oauth2Client.setCredentials({
refresh_token: user.token.refresh_token
});
oauth2Client.refreshAccessToken(function(err, tokens) {
user.token = tokens;
user.save()
.then((user)=>{
if(payload.original_message.text === "Would you like me to create a reminder for "){
//it was a reminder
var newReminder = new Reminder({
userID: user._id,
channelID: payload.channel.id,
subject: reminderSubject,
date: reminderDate,
})
newReminder.save(function(err){
if (err){
res.status(400).json({error:err});
}else{
reminderDate = new Date(reminderDate);
createCalendarReminder(reminderDate.toISOString().substring(0, 10),
reminderSubject, user.token);
res.send('Reminder Confirmed');
}
})
} else {
//it was a meeting
var newMeeting = new Meeting({
userID: user._id,
STRATEGIC ENHANCEMENT AI-POWERED SCHEDULING ASSISTANT BOT
Page 43
St. Peter’s Engineering College (Autonomous) Department of CSE(AI&ML)

channelID: payload.channel.id,
subject: meetingSubject,
date: meetingDate,
time: meetingTime,
invitees: meetingInvitees,
duration: meetingDuration,
})
newMeeting.save(function(err, meeting){
if (err){
res.send('Error saving meeting');
}else{
//TODO: instead of first finding the requestors slackname, correctly save it in
their mongo object so u dont need to do find (since inside find email function you need the user not just
the name, so pretty uncesssary to do a find name here)
//meetingInvitees.concat([user.slackName])
let requester = rtm.dataStore.getUserById(user._id);
if(requester) {

findAndReturnEmails(meetingInvitees.concat([requester.name]), meetingDate,
meetingSubject, user.token, meetingTime, meeting.duration);
} else { //if for some reason we cant retrieve the infromation about the requestor
console.log('couldnt get information about the user requesting the meeting');
findAndReturnEmails(meetingInvitees, meetingDate, meetingSubject,
user.token, meetingTime, meeting.duration);
}
res.send('Meeting confirmed');
}
})
}
})
});
}
})
} else {
res.send('Cancelled');
}
})
app.listen(process.env.PORT || 3000);

function createCalendarReminder(date, subject, tokens, invitees, time, duration){


if(!invitees){
let dateTime = date + "T" + time + "-07:00"
var event = {
'summary': subject,
'start': {
'date': date,//Time,
},
'end': {
'date': date,//Time
}
};
} else {
let attendeesArr = [];
STRATEGIC ENHANCEMENT AI-POWERED SCHEDULING ASSISTANT BOT
Page 44
St. Peter’s Engineering College (Autonomous) Department of CSE(AI&ML)

invitees.forEach((invited) => {
attendeesArr.push({
'email' : invited
})
})
let dateTime = date + "T" + time + "-07:00"

var endTime = new Date(dateTime);


endTime.setMinutes(endTime.getMinutes() + parseInt(duration))
let finalDate = new Date(Date.parse(endTime))

var event = {
'summary': subject,
'start': {
'dateTime': dateTime
},
'end': {
'dateTime': finalDate,
},
'attendees': attendeesArr,
};
}

oauth2Client = new OAuth2(


process.env.GOOGLE_CLIENT_ID,
process.env.GOOGLE_CLIENT_SECRET,
process.env.DOMAIN + '/connect/callback'
)
oauth2Client.setCredentials(tokens);
var calendar = google.calendar('v3');
calendar.events.insert({
auth: oauth2Client,
calendarId: 'primary',
resource: event,
}, function(err, event) {
if(err){
console.log("There was an error adding the calendar", err);
return
}else {
console.log('event created')
}
})
}

function findAndReturnEmails (users, date, subject, tokens, time, duration) {

var slackIdArray = [];

users.forEach((username) => {
let userObj = rtm.dataStore.getUserByName(username);
slackIdArray.push(userObj.id);
})
STRATEGIC ENHANCEMENT AI-POWERED SCHEDULING ASSISTANT BOT
Page 45
St. Peter’s Engineering College (Autonomous) Department of CSE(AI&ML)

var emailArray = [];


var promisArray = [];

slackIdArray.forEach((slackId) => {
promisArray.push(User.findOne({slackID: slackId}).exec()
.then((user) => user.email))
})

Promise.all(promisArray).then((arr) => {
if(arr) {
createCalendarReminder(date, subject, tokens, arr, time, duration);
} else {
//idk when this happened but it did once
console.log('in find and return emails, invitees came to be falsy so not calling
createCalendarReminder', arr);
}
})
}

//
// function checkConflicts(meeting, rtm){
// var busySlots = [];
// var count = 0;
// var conflictExists = false;
// var counterGoal = meeting.invitees.length;
// var invitee, user,sevenBusinessDays, meetingDate;
// return new Promise((resolve, reject) => {
// meeting.invitees.forEach( function(invitee) {
// invitee = invitee;
// var inviteeuser = rtm.dataStore.getUserByName(invitee); //given the invitee slack name, find
their slack user object
// var inviteeSlackID = inviteeuser.id; //get slack id from slack user
// //find a user in our DB with that slack username
// User.findOne({slackID: inviteeSlackID}).exec()
// .then((user) =>{
// if(user) {
// user = user;
// //save user tokens
// var tokens = user.token;
// oauth2Client = new OAuth2(
// process.env.GOOGLE_CLIENT_ID,
// process.env.GOOGLE_CLIENT_SECRET,
// process.env.DOMAIN + '/connect/callback'
// )
// oauth2Client.setCredentials(tokens);
// var calendar = google.calendar('v3');
// //AT THIS POINT YOU ARE AUTHENTICATED TO SEE THE INVITEE GOOGLE
calendar
// meetingDate = new Date(meeting.date + ' ' + meeting.time + "-07:00");
// var meetingEnd = new Date(meeting.date + ' ' + meeting.time + "-07:00");
// meetingEnd.setMinutes(meetingEnd.getMinutes() + 30);
// var n = 7;
STRATEGIC ENHANCEMENT AI-POWERED SCHEDULING ASSISTANT BOT
Page 46
St. Peter’s Engineering College (Autonomous) Department of CSE(AI&ML)

// while (workingDaysBetweenDates(meetingDate, new Date(Date.parse(meetingEnd) +


n*24*60*60*1000)) < 7){
// n++;
// }
// sevenBusinessDays = new Date(Date.parse(meetingEnd) + n*24*60*60*1000)
// return new Promise((resolve, reject) => {
// calendar.freebusy.query({
// auth: oauth2Client,
// headers: { "content-type" : "application/json" },
// resource:{
// items: [{id: 'primary', busy: 'Active'}],
// timeMin: meetingDate.toISOString(),
// timeMax: sevenBusinessDays.toISOString() //first # controls # of days to check for
conflicting events
// }
// }, function(err, schedule) {
// // console.log(typeof schedule);
// if(schedule){
// console.log('returning schedule to next then');
// resolve(schedule)
// } else {
// console.log('INSIDE ELSE');
// reject(err);
// // console.log("There was an error getting invitee calendar", err);
// // throw new Error('couldnt find scheduke for user');
// }
// }
// )
// })
// } else {
// throw new Error('couldnt find user');
// }
// })
// .then((schedule) => {
// // console.log('scheudle was retunred', schedule);
// if(false && !schedule){
// console.log("schedule wasnt returned");
// throw new Error('no schedule returns');
// }else {
// // console.log('schedule is ', schedule);
// var busyList = schedule.calendars.primary.busy;
// busySlots = busySlots.concat(busyList);
// console.log(invitee);
// busyList.forEach((time) => {
// var meetingStartTime = new Date(meeting.date + ' ' + meeting.time + "-07:00");;
// meetingStartTime.setDate(meetingStartTime.getDate());
// var meetingEndTime = new Date(meeting.date + ' ' + meeting.time + "-07:00");
// meetingEndTime.setDate(meetingEndTime.getDate());
// meetingEndTime.setMinutes(meetingEndTime.getMinutes() + 30);
// var conflictStartTime = new Date(time.start);
// // conflictStartTime.setDate(conflictStartTime.getDate());
// var conflictEndTime = new Date(time.end);
// // conflictEndTime.setDate(conflictEndTime.getDate());
STRATEGIC ENHANCEMENT AI-POWERED SCHEDULING ASSISTANT BOT
Page 47
St. Peter’s Engineering College (Autonomous) Department of CSE(AI&ML)

// var convertedMeetingStartTime = new Date(meetingStartTime.toDateString() + ' ' +


meetingStartTime.toTimeString() + "+07:00").toLocaleString();
// var convertedMeetingEndTime = new Date(meetingEndTime.toDateString() + ' ' +
meetingEndTime.toTimeString() + "+07:00").toLocaleString();
// var convertedConflictStartTime = new Date(conflictStartTime.toDateString() + ' ' +
conflictStartTime.toTimeString() + "+07:00").toLocaleString();
// var convertedConflictEndTime = new Date(conflictEndTime.toDateString() + ' ' +
conflictEndTime.toTimeString() + "+07:00").toLocaleString();
// if((meetingStartTime <= conflictStartTime && meetingEndTime > conflictStartTime) ||
(meetingStartTime >= conflictStartTime && meetingStartTime <= conflictEndTime)){
// console.log('BUSY: The meeting time \n', convertedMeetingStartTime, ' - ',
convertedMeetingEndTime, '\n conflicts with user event at \n', convertedConflictStartTime, ' - ',
convertedConflictEndTime, '\n');
// conflictExists = true;
// } else {
// console.log(meetingEndTime >= conflictStartTime && meetingEndTime <=
conflictEndTime);
// console.log('FREE: No overlap between meeting at \n',convertedMeetingStartTime, ' -
', convertedMeetingEndTime, '\n and the users event at \n', convertedConflictStartTime, ' - ',
convertedConflictEndTime, '\n');
// }
// })
// }
// return;
// })
// .then( () => {
// count+=1
// if(count === counterGoal){
// var freetimelist = findFreeTimes(busySlots, meetingDate.toISOString(),
sevenBusinessDays.toISOString());
// // console.log('freetimelist', freetimelist);
// if(conflictExists) {
// console.log('conflcit exists reutrning free times list');
// resolve(freetimelist);
// } else {
// console.log('no conflcit exists not returning ');
// resolve([]);
// }
// // return freetimelist;
// }
// })
// .catch((err) => {
// counterGoal -= 1; //if you cant get a user, subtract from counter goal so your not waiting on a
users info that will never come
// reject(err);
// })
// })
// }) //end of for each
// }
//
// function workingDaysBetweenDates(startDate, endDate) {
// // Validate input
// if (endDate < startDate)
STRATEGIC ENHANCEMENT AI-POWERED SCHEDULING ASSISTANT BOT
Page 48
St. Peter’s Engineering College (Autonomous) Department of CSE(AI&ML)

// return 0;
//
// // Calculate days between dates
// var millisecondsPerDay = 86400 * 1000; // Day in milliseconds
// startDate.setHours(0,0,0,1); // Start just after midnight
// endDate.setHours(23,59,59,999); // End just before midnight
// var diff = endDate - startDate; // Milliseconds between datetime objects
// var days = Math.ceil(diff / millisecondsPerDay);
//
// // Subtract two weekend days for every week in between
// var weeks = Math.floor(days / 7);
// days = days - (weeks * 2);
//
// // Handle special cases
// var startDay = startDate.getDay();
// var endDay = endDate.getDay();
//
// // Remove weekend not previously removed.
// if (startDay - endDay > 1)
// days = days - 2;
//
// // Remove start day if span starts on Sunday but ends before Saturday
// if (startDay == 0 && endDay != 6)
// days = days - 1
//
// // Remove end day if span ends on Saturday but starts after Sunday
// if (endDay == 6 && startDay != 0)
// days = days - 1
//
// return days;
// }
//
// function reduceTimeIntervals(busyArray){
// var intervalStack = [];
// //sort the intervals based on increasing order of starting time
// var sortedIntervals = _.sortBy(busyArray, 'start');
// intervalStack.push(sortedIntervals[0]); //push the first interval on stack
// sortedIntervals.forEach( (interval) => {
// var stackTop = intervalStack[intervalStack.length - 1];
// //If the current interval overlaps with stack top and ending
// // time of current interval is more than that of stack top,
// // update stack top with the ending time of current interval.
// if((Date.parse(interval.start) <= Date.parse(stackTop.start)&& Date.parse(interval.end) >
Date.parse(stackTop.start)) || (Date.parse(interval.start) >= Date.parse(stackTop.start) &&
Date.parse(interval.start) <= Date.parse(stackTop.end))){
// if(Date.parse(interval.end) > Date.parse(stackTop.end)){
// var modifiedStackTop = Object.assign({}, intervalStack.pop(), {end: interval.end})
// intervalStack.push(modifiedStackTop);
// }
// } else {
// //if for some reason the busy interval has same start and end time, dont add it
// if(Date.parse(interval.start) !== Date.parse(interval.end)){
// intervalStack.push(interval);
STRATEGIC ENHANCEMENT AI-POWERED SCHEDULING ASSISTANT BOT
Page 49
St. Peter’s Engineering College (Autonomous) Department of CSE(AI&ML)

// }
//
// }
// })
// return intervalStack;
// }
//
// function findFreeTimes(busyArray, meetingStartDate, sevenBusinessDays){
// //meetingStartDate and sevenBusinessDays must be in format '2017-07-22T23:59:59Z'
// var intervals = reduceTimeIntervals(busyArray);
// var freeStart = meetingStartDate.slice(0,11)+'00:00:00Z'
// var freeEnd = sevenBusinessDays.slice(0,11)+'23:59:59Z'
// var freeStack = []
// intervals.forEach((interval) => {
// freeStack.push({start: freeStart, end: interval.start})
// freeStart = interval.end;
// })
// freeStack.push({start: freeStart, end: freeEnd})
// return freeStack;
// }

function sendInvitations(meeting, user){

//// old and redundant code


//// get the invitor's userObj from dataStore
//// var sender = rtm.dataStore.getUserById(meeting.userID)
//// find the user by his slackId in the mongodb
//// User.findOne({slackID: }).exec()
//// .then((user) => user.pendingInvites = meeting.invitees)

// 1. add invitees to invitor's pending invites array


//user that created event and is sending invitations's object gets passed into this function
user.pendingInvites = meeting.invitees;
console.log("this is updated pendingInvites", user.pendingInvites);
user.save()
.then( () => res.status(200).send("pendingInvites array updated"))
.catch((err) => {
console.log('error in saving pendinginvites array to mlabs');
res.status(400).json({error:err});
})

// 2. get UserId and DM ID from the slack usernames in meeting.invitees =>


// check link pam sent in general
let tempArr = [];
user.pendingInvites.forEach((invitee) => {
let xyz = rtm.dataStore.UserByName(invitee)
console.log("this is UserByName", xyz)
})

// var abc = rtm.dataStore.getDMByUserId()


// tempArr.push(abc);
STRATEGIC ENHANCEMENT AI-POWERED SCHEDULING ASSISTANT BOT
Page 50
St. Peter’s Engineering College (Autonomous) Department of CSE(AI&ML)

// 3. for each invitee send web.chat.postmessage invitation message

// findAndReturnEmails(meeting.invitees, meeting.date, meeting.subject, tokens, meeting.time);

//4,5,6 for other function...


//when slack user confirms, write new route in /slack/interactive to receive that payload with the
information in it
//when they accept, remove their name from the pendingInvites array and check the array's length
//if the array's length is 0, then call create the calendar event

//TODO: how to handle invites who decline. just remove them from pending invites array, and send
slack messages
//saying "usernameX declined to attend the meeting", then check array lenght and book calender event
with those remaining

// If modifying these scopes, delete your previously saved credentials


// at ~/.credentials/calendar-nodejs-quickstart.json
var SCOPES = ['https://www.googleapis.com/auth/calendar'];
var TOKEN_DIR = (process.env.HOME || process.env.HOMEPATH ||
process.env.USERPROFILE) + '/.credentials/';
var TOKEN_PATH = TOKEN_DIR + 'calendar-nodejs-quickstart.json';

// var google = require('googleapis');


// var googleAuth = require('google-auth-library');

// Load client secrets from a local file.


fs.readFile('client_secret.json', function processClientSecrets(err, content) {
if (err) {
console.log('Error loading client secret file: ' + err);
return;
}
// Authorize a client with the loaded credentials, then call the
// Google Calendar API.
authorize(JSON.parse(content), listEvents);
});

/**
* Create an OAuth2 client with the given credentials, and then execute the
* given callback function.
*
* @param {Object} credentials The authorization client credentials.
* @param {function} callback The callback to call with the authorized client.
*/
function authorize(credentials, callback) {
var clientSecret = credentials.installed.client_secret;
var clientId = credentials.installed.client_id;
var redirectUrl = credentials.installed.redirect_uris[0];
var auth = new googleAuth();
var oauth2Client = new auth.OAuth2(clientId, clientSecret, redirectUrl);

STRATEGIC ENHANCEMENT AI-POWERED SCHEDULING ASSISTANT BOT


Page 51
St. Peter’s Engineering College (Autonomous) Department of CSE(AI&ML)

// Check if we have previously stored a token.


fs.readFile(TOKEN_PATH, function(err, token) {
if (err) {
getNewToken(oauth2Client, callback);
} else {
oauth2Client.credentials = JSON.parse(token);
callback(oauth2Client);
}
});
}

/**
* Get and store new token after prompting for user authorization, and then
* execute the given callback with the authorized OAuth2 client.
*
* @param {google.auth.OAuth2} oauth2Client The OAuth2 client to get token for.
* @param {getEventsCallback} callback The callback to call with the authorized
* client.
*/
function getNewToken(oauth2Client, callback) {
var authUrl = oauth2Client.generateAuthUrl({
access_type: 'offline',
scope: SCOPES
});
console.log('Authorize this app by visiting this url: ', authUrl);
var rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});
rl.question('Enter the code from that page here: ', function(code) {
rl.close();
oauth2Client.getToken(code, function(err, token) {
if (err) {
console.log('Error while trying to retrieve access token', err);
return;
}
oauth2Client.credentials = token;
storeToken(token);
callback(oauth2Client);
});
});
}

/**
* Store token to disk be used in later program executions.
*
* @param {Object} token The token to store to disk.
*/
function storeToken(token) {
try {
fs.mkdirSync(TOKEN_DIR);
} catch (err) {
if (err.code != 'EEXIST') {
STRATEGIC ENHANCEMENT AI-POWERED SCHEDULING ASSISTANT BOT
Page 52
St. Peter’s Engineering College (Autonomous) Department of CSE(AI&ML)

throw err;
}
}
fs.writeFile(TOKEN_PATH, JSON.stringify(token));
console.log('Token stored to ' + TOKEN_PATH);
}

/**
* Lists the next 10 events on the user's primary calendar.
*
* @param {google.auth.OAuth2} auth An authorized OAuth2 client.
*/
function listEvents(auth) {
var calendar = google.calendar('v3');
calendar.events.list({
auth: auth,
calendarId: 'primary',
timeMin: (new Date()).toISOString(),
maxResults: 10,
singleEvents: true,
orderBy: 'startTime'
}, function(err, response) {
if (err) {
console.log('The API returned an error: ' + err);
return;
}
var events = response.items;
if (events.length == 0) {
console.log('No upcoming events found.');
} else {
console.log('Upcoming 10 events:');
for (var i = 0; i < events.length; i++) {
var event = events[i];
var start = event.start.dateTime || event.start.date;
console.log('%s - %s', start, event.summary);
}
}
});
}

var mongoose = require('mongoose');


var Schema = mongoose.Schema;

var userSchema = new Schema({


slackID: String,
auth_id: String,
token: Object,
email: String,
pendingInvites: []
})
var reminderSchema = new Schema({
userID: {
type: mongoose.Schema.Types.ObjectId,
STRATEGIC ENHANCEMENT AI-POWERED SCHEDULING ASSISTANT BOT
Page 53
St. Peter’s Engineering College (Autonomous) Department of CSE(AI&ML)

ref: 'User'
},
subject: String,
channelID: String,
date: Number
})

var meetingSchema = new Schema({


userID: {
type: mongoose.Schema.Types.ObjectId,
ref: 'User'
},
subject: String,
channelID: String,
date: String,
invitees: Array,
time: String,
duration: {
type: Number,
default: 30
}
})

var Meeting = mongoose.model('Meeting', meetingSchema);


var User = mongoose.model('User', userSchema);
var Reminder = mongoose.model('Reminder', reminderSchema);
module.exports = {
User: User,
Reminder: Reminder,
Meeting: Meeting,
};

STRATEGIC ENHANCEMENT AI-POWERED SCHEDULING ASSISTANT BOT


Page 54
St. Peter’s Engineering College (Autonomous) Department of CSE(AI&ML)

APPENDIX B: PROJECT WORKING SNAP SHOTS

In the below screen click ‘Sync Google Calendar’

Figure 7.1 Step-1

In the below screen ‘Sign In With Gmail’

Figure 7.2 Step-2

STRATEGIC ENHANCEMENT AI-POWERED SCHEDULING ASSISTANT BOT


Page 55
St. Peter’s Engineering College (Autonomous) Department of CSE(AI&ML)

In

the below screen message with ‘AI Scheduling Bot’

Figure 7.3 Step-3

In the below screen AI Assistant will schedule meeting with a person you want

Figure 7.4 Step-4

STRATEGIC ENHANCEMENT AI-POWERED SCHEDULING ASSISTANT BOT


Page 56
St. Peter’s Engineering College (Autonomous) Department of CSE(AI&ML)

In

the below screen user can have a view of the details


Figure 7.5 Step-5

In the below screen we


can accept meeting or
reschedule if your not available
at that slot

Figure 7.6 Step-6

STRATEGIC ENHANCEMENT AI-POWERED SCHEDULING ASSISTANT BOT


Page 57
St. Peter’s Engineering College (Autonomous) Department of CSE(AI&ML)

In the below screen scheduled meeting will be giving reminder from google calendar

Figure 7.7 Step-7

STRATEGIC ENHANCEMENT AI-POWERED SCHEDULING ASSISTANT BOT


Page 58

You might also like