Giter Site home page Giter Site logo

butler-bot's People

Contributors

edisonchee avatar languantan avatar phaelar avatar shekyh avatar treychua avatar yuhong90 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

butler-bot's Issues

Json Key or Pem Key error

This is PEM error
listBookedEventsByRoom Error: Error: failed to obtain an authentication token, request failed with HTTP code 400: invalid_grant
listEmptySlotsInDay Error: Error: failed to obtain an authentication token, request failed with HTTP code 400: invalid_grant

Json Key error
listBookedEventsByRoom Error: Error: failed to sign JWT, the key is probably invalid
listEmptySlotsInDay Error: Error: failed to sign JWT, the key is probably invalid

Code here:
Settings.js

//require the Google API Json Key
const KEYFILE = '../data/xxxxxx-xxxxxxxxx.pem';
const SERVICE_ACCT_ID = [email protected]';
const CALENDAR_URL = 'https://calendar.google.com/calendar/embed?src=xxxxxxxxgmail.com&ctz=Asia%2FHong_Kong';
const CALENDAR_ID={"primary": "[email protected]","th":"[email protected]","ko":[email protected]","kc":"[email protected]","hl":"[email protected]","ml":"[email protected]","fg":"[email protected]","q1":[email protected]","q2":"[email protected]","qc":[email protected]","dr":[email protected]","bb":"[email protected]","tt":"[email protected]","mc":"[email protected]","ak":"[email protected]","sk":"[email protected]","zk":"[email protected]"
};
const TIMEZONE = 'UTC+08:00';

module.exports.calendarUrl = CALENDAR_URL;
module.exports.serviceAcctId = SERVICE_ACCT_ID;
module.exports.calendarId = CALENDAR_ID;
module.exports.keyFile = KEYFILE;
module.exports.timezone = TIMEZONE;

//To use, require the module in your application and pass in the necessary config file.
/const CONFIG = require('./config/settings.js');
const CalendarAPI = require('node-google-calendar');
let cal = new CalendarAPI(CONFIG);
/

export { CONFIG as default, ROOM_CONFIG, SESSION_LENGTH, BOOKING_DURATION_OPTIONS };
`

.env file:

TELEGRAM_BOT_TOKEN=xxxxxxxxxxxxxxxxxttl_xxxxxxxxxxxxxx [email protected] CALENDAR_ID={"primary": "[email protected]","th":"[email protected]","ko":[email protected]","kc":"[email protected]","hl":"[email protected]","ml":"[email protected]","fg":"[email protected]","q1":[email protected]","q2":"[email protected]","qc":[email protected]","dr":[email protected]","bb":"[email protected]","tt":"[email protected]","mc":"[email protected]","ak":"[email protected]","sk":"[email protected]","zk":"[email protected]" }; CALENDAR_URL=https://calendar.google.com/calendar/embed?src=xxxxx%40gmail.com&ctz=Asia%2FHong_Kong GOOGLE_KEYFILE_PATH=../data/xxxx-xxxx.pem

Please Help Thanks!!

Todo

  • Write unit tests

  • Set up CI (Travis) to:

  1. Build
  2. Run test suite
  3. Deploy to production server
  • Find a better way to store/share secrets

  • Manage user access list

  1. Stash repo for user list
  2. Bot to poll and reboot every time changes made to list
  • Fix bugs

Bot Randomly Warning People For Forwarded Messages

I have had people forward messages to my group for over a year now no issues, randomly I woke up and a few people have warns for forwarding messages. I don't have anything blocked for forwarding messages, idk if it's a bug or something? I checked config, and everything looked to be the same as always.

Room booking reminders

I think it would be useful to send reminders to the user 5 min before the time slot starts and some actions to acknowledge or cancel the booking.
Also, maybe reminders 5 min before it ends to wrap up the meeting soon.

There have been times where I've booked a room in advance and forgot to cancel the booking when the meeting has been postponed.

Unhandled rejection Error: Error promptTimeslotSelection:

device log:

Unhandled rejection Error: Error promptTimeslotSelection: {}
    at /home/ubuntu/butler-bot/build/modules/TelegramBot.js:387:11
0|build    |     at tryCatcher (/home/ubuntu/butler-bot/node_modules/bluebird/js/release/util.js:16:23)
0|build    |     at Promise._settlePromiseFromHandler (/home/ubuntu/butler-bot/node_modules/bluebird/js/release/promise.js:510:31)
0|build    |     at Promise._settlePromise (/home/ubuntu/butler-bot/node_modules/bluebird/js/release/promise.js:567:18)
0|build    |     at Promise._settlePromise0 (/home/ubuntu/butler-bot/node_modules/bluebird/js/release/promise.js:612:10)
0|build    |     at Promise._settlePromises (/home/ubuntu/butler-bot/node_modules/bluebird/js/release/promise.js:687:18)
0|build    |     at Async._drainQueue (/home/ubuntu/butler-bot/node_modules/bluebird/js/release/async.js:133:16)
0|build    |     at Async._drainQueues (/home/ubuntu/butler-bot/node_modules/bluebird/js/release/async.js:143:10)
0|build    |     at Immediate.Async.drainQueues (/home/ubuntu/butler-bot/node_modules/bluebird/js/release/async.js:17:14)
0|build    |     at runCallback (timers.js:651:20)
0|build    |     at tryOnImmediate (timers.js:624:5)
0|build    |     at processImmediate [as _immediateCallback] (timers.js:596:5)

Repro

  1. /book
  2. Any room
  3. Select date
  4. Select time
  5. Press Back
  6. Error pops up

[Critical] Unable to handle recurring events

  1. /booked & /delete command unable to display the latest upcoming booking for recurring bookings. (Recurring bookings are booked directly through google calendar)
  2. unable to detect new bookings' conflicts with recurring bookings.

To handle recurrences and calculate upcoming event in the series, with the start, end and recurrence resp from google.

[ { kind: 'calendar#event',
    etag: '"..."',
    id: '....',
    status: 'confirmed',
    htmlLink: '...',
    created: '2017-02-08T03:13:06.000Z',
    updated: '2017-02-08T06:23:06.853Z',
    summary: 'Meeting by ..',
    location: 'FGD',
    creator: { email: '...' },
    organizer: 
     { email: '[email protected]',
       displayName: 'FGD Calendar',
       self: true },
    start: 
     { dateTime: '2017-02-24T14:00:00+08:00',
       timeZone: 'Asia/Singapore' },
    end: 
     { dateTime: '2017-02-24T15:00:00+08:00',
       timeZone: 'Asia/Singapore' },
    recurrence: [ 'RRULE:FREQ=WEEKLY;UNTIL=20170331T060000Z;BYDAY=FR' ],
    ... } ]

How to Use This Package?

Excuse my stupidity, but I'm absolutely has no clue about how to use this package or how to install it. Do I just download it as a ZIP and then copy+paste it to my server (i'm using windows) or do I have to some serials of commands just like you shown here? And then where do I have to put it my webhook URL?

Thank you

LDAP integration

We can create a mapping between telegram usernames and LDAP entries and do even more cool stuff, like using the google cal API to send an event/invite to tech.gov.sg emails on bookings.

We can either:

  1. map it ourselves
  2. get users to auth with the bot before using to create the mapping on the backend (we've to write it ourselves)

Right now I'm trying to find out if we can have remote access to the LDAP server (sitting on a AWS VPC) from an ec2 instance...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.