fossasia / labyrinth

FOSSASIA Labyrinth
GNU Affero General Public License v3.0
1.52k stars 147 forks source link

Feature Requests : Enhance the bot #913

Open YashKumarVerma opened 5 years ago

YashKumarVerma commented 5 years ago

Expected Behavior

Current Behavior

Possible Solution

pythongiant commented 5 years ago

I love this telegram bot and I use it regularly. Maybe we can use some code from here? https://github.com/ArionMiles/Triton

pythongiant commented 5 years ago

The github library on pip(python) is really helpful.

iamareebjamal commented 5 years ago

Take a look at https://probot.github.io/

YashKumarVerma commented 5 years ago

Take a look at https://probot.github.io/

@iamareebjamal @pythongiant we cannot use web hooks. Even i as a maintainer (with write access) do not have the permission to add new / edit web hooks.

iamareebjamal commented 5 years ago

I do

YashKumarVerma commented 5 years ago

I do

I do?

iamareebjamal commented 5 years ago

Even i as a maintainer (with write access) do not have the permission to add new / edit web hooks.

I have the permission

YashKumarVerma commented 5 years ago

Even i as a maintainer (with write access) do not have the permission to add new / edit web hooks.

I have the permission

Then we really need your help 😀.

iamareebjamal commented 5 years ago

You guys can create a probot app, and I'll add it to the repository

YashKumarVerma commented 5 years ago

You guys can create a probot app, and I'll add it to the repository

@pythongiant

pythongiant commented 5 years ago

alright SGTM. My exams are starting in a bit. So development might be a bit slow but I will try my best to at least get basic functionalities of the bot up and running in 2 days. @YashKumarVerma will that be fine?

pythongiant commented 5 years ago

https://probot.github.io/apps/wip/ https://probot.github.io/apps/reminders/ For now, i really like these

YashKumarVerma commented 5 years ago

@pythongiant Take your time. there's no hurry. feel free to ask if you face any issues / or you have some other library you've worked before, use that.

pythongiant commented 5 years ago

Can I be assigned to this?

YashKumarVerma commented 5 years ago

Can I be assigned to this?

Don't worry. send a pr.

pythongiant commented 5 years ago

@iamareebjamal checkout the PR

pythongiant commented 5 years ago

@iamareebjamal https://github.com/pythongiant/Gitter-Laby-Bot/issues/7 https://github.com/apps/gitter-laby-bot/ https://gitter-laby-bot.herokuapp.com/probot

pythongiant commented 5 years ago

You can close this issue now @YashKumarVerma. I did it!

iamareebjamal commented 5 years ago

The issue is not resolved

pythongiant commented 5 years ago

Well.. you can add the bot now @iamareebjamal

iamareebjamal commented 5 years ago

The repo you have also has several issues. You have not ignored node_modules, and log files. This cannot be taken into production. Please don't be eager and let us incubate properly before this issue is closed

pythongiant commented 5 years ago

@iamareebjamal we have multiple instances of students not following the ISSUE template thats why I added that feature. This is my first node.js production app (i usually develop in python). Could you please try and elaborate on " Bot should allow customization of channels to which the updates should be posted through config file like other probot apps"

pythongiant commented 5 years ago

BTW I added the gitignore

iamareebjamal commented 5 years ago

@pythongiant We can use other probot apps for that.

Look at other probot apps for how to setup config

https://probot.github.io/api/latest/classes/context.html#config

We'll define configuration of which room to post notifications on rather than it being hardcoded in the bot

iamareebjamal commented 5 years ago

About .gitignore, doesn't matter now, node_modules are still there and will remain in git history unless you use git filter branch or BFG

iamareebjamal commented 5 years ago

Also, we don't use curl in node to do stuff. Use proper http client. This discussion will be best done on your repo. So please create an issue there and we'll follow up there

pythongiant commented 5 years ago

The folder isnt there. please recheck. @iamareebjamal the htttp client won't work since gitter has an issue with it. lemme make an issue for this tommorrow, if that's fine.

iamareebjamal commented 5 years ago

Gitter is nowhere in the picture, you are just making a request to the server using proper node code instead of curl. Using curl is also bad on environments where it won't be installed like Windows or minimal linux containers like alpine.

The folder is indeed there https://github.com/pythongiant/Gitter-Laby-Bot/tree/7b9dfc333404180418bd29055ea6cc14d36e535c

As a fun exercise, commit your gmail password to the repo and then remove it this way :wink:

YashKumarVerma commented 5 years ago

@pythongiant @iamareebjamal I think the discussion is good here itself. There are a lot of things to learn in this process itself, which will invariably help the students.

YashKumarVerma commented 5 years ago

The folder isnt there. please recheck. @iamareebjamal the htttp client won't work since gitter has an issue with it. lemme make an issue for this tommorrow, if that's fine.

What kind of issues ? i don't think gitter has issues with http client in particular.

pythongiant commented 5 years ago

Well I guess it is my own setup. lemme try arch

The folder isnt there. please recheck. @iamareebjamal the htttp client won't work since gitter has an issue with it. lemme make an issue for this tommorrow, if that's fine.

What kind of issues ? i don't think gitter has issues with http client in particular.

iamareebjamal commented 5 years ago

It doesn't depend on the OS you have

pythongiant commented 5 years ago

@iamareebjamal https://github.com/pythongiant/Gitter-Laby-Bot Checkout the repo now

iamareebjamal commented 5 years ago

So, how are we going to set token and room?

Also, it is still posting new comment on issue being open

pythongiant commented 5 years ago

@iamareebjamal that is because many students are not following the issue templates

pythongiant commented 5 years ago

So I thought it would be good to add it

pythongiant commented 5 years ago

The room and token need to be generated.. See the gitter API

iamareebjamal commented 5 years ago

I repeat, for commenting

We can use other probot apps for that

The room and token need to be generated.

I never asked how to generate them, I asked how to set them in the bot

pythongiant commented 5 years ago

You need to set the room and token variables in the js file. the deployed bot is currently sending messages to a private room. And we can also use a variety of other gitter probot apps. why create our own? @iamareebjamal

iamareebjamal commented 5 years ago

You need to set the room and token variables in the js file.

That's not what we want. It should read it from config file

And we can also use a variety of other gitter probot apps. why create our own?

I never wanted to create an app if there already was one. Please paste the link to such an app

pythongiant commented 5 years ago

we had a discussion about this on the forum. It said that we would like to have our own repo for students to contribute to and you can search the marketplace for gitter apps or probot apps that post to chat forums.

I never wanted to create an app if there already was one. Please paste the link to such an app

I have been having an error with it. I have contacted probot support about this. and they are yet to reply.

That's not what we want. It should read it from config file

iamareebjamal commented 5 years ago

What's the error? Post here

pythongiant commented 5 years ago

Returns a null

What's the error? Post here

iamareebjamal commented 5 years ago

When someone asks what's the error, you show them what you tried, the code, what you expected, what you got. How am I supposed to infer anything from returns a null

YashKumarVerma commented 5 years ago

@iamareebjamal sir, What are your views on using a pre-built bot for the project? I mean why do we need to reinvent the wheel? I know that custom work is always tailored fit, but at the end of the day, if the same is available prebuilt, how about using it? @pythongiant what do you think?

pythongiant commented 5 years ago

@YashKumarVerma i couldnt host the prebuilt bot myself. So i guess we are gonna have to make one oursleves

pythongiant commented 5 years ago

I saw a tg github bot but the gitter bot i saw before has been removed from the market place unfortunately

YashKumarVerma commented 5 years ago

@pythongiant maybe we can use some probot to do the commenting / github operation, and our curl to message on gitter

iamareebjamal commented 5 years ago

@YashKumarVerma That's what my intention was from the beginning

YashKumarVerma commented 5 years ago

@pythongiant I think you should use some pre built bot. Rest is your decision