team icon indicating copy to clipboard operation
team copied to clipboard

create a discord bot

Open kennethreitz opened this issue 6 years ago • 23 comments
trafficstars

kennethreitz avatar Feb 11 '19 15:02 kennethreitz

Working on it

rHuggler avatar Feb 11 '19 15:02 rHuggler

Hi @rHuggler, I can also help with it. :)

ParthS007 avatar Feb 11 '19 18:02 ParthS007

Hi @ParthS007, help would be appreciated. I've started working on it this evening and didn't get that far.

https://github.com/rHuggler/krorg-bot (i created it on my personal account because i don't know if i can create it as KR's organization yet)

It works, but it doesn't look very good (to me) and still doesn't have any validation. The README is also very poor but I plan to update it tomorrow.

rHuggler avatar Feb 12 '19 01:02 rHuggler

@rHuggler ping me on discord when it's ready to be moved in to the org!

kennethreitz avatar Feb 12 '19 13:02 kennethreitz

I'm thinking about changing to Javascript, the existing Discord API wrappers for Python I've found are outdated and/or have vulnerable versions of other packages as sub-dependencies. Any thoughts on that?

rHuggler avatar Feb 12 '19 13:02 rHuggler

Hey,

I feel like that would be okay to do. Do you have any documentation to review?

If anyone else has any ideas on how to create the bot with python, drop a comment and provide some examples on how to implement.

vimrichie avatar Feb 12 '19 18:02 vimrichie

JS sounds fine! as long as it works :)

kennethreitz avatar Feb 12 '19 18:02 kennethreitz

@kenneth-reitz Is the Bot only for adding a user to Org?

ParthS007 avatar Feb 12 '19 18:02 ParthS007

we can have it do github notifications too

kennethreitz avatar Feb 12 '19 18:02 kennethreitz

Yes @kenneth-reitz, We can do the notifications part by adding webhook of the bot and selecting the events that are to be shown as notifications on Discord.

ParthS007 avatar Feb 12 '19 18:02 ParthS007

Wrapping up the day and it's working now :tada:

I've ran some tests on a private server and a test organization I've created and I was able to add an user. There's still a lot of work to do (input validation, Github response handling, etc.) but it works :)

rHuggler avatar Feb 13 '19 03:02 rHuggler

yay!!!!

kennethreitz avatar Feb 13 '19 13:02 kennethreitz

I need some help figuring out these things:

  • Where to deploy the bot to and how to keep it running (Heroku, I guess?)
  • How to authorize the bot to read & write membership in the organization (in my tests I've used my personal access token and an organization I own)

rHuggler avatar Feb 13 '19 14:02 rHuggler

@rHuggler, We can deploy it on Heroku and we have to enable the worker instance which will keep it running. For bot authorization, we can get it from @kenneth-reitz

ParthS007 avatar Feb 13 '19 15:02 ParthS007

Heroku works, or glitch. Let's do this!

kennethreitz avatar Feb 14 '19 11:02 kennethreitz

Make a Heroku app and deploy it, and then we'll transfer the app to my org.

Let's do autodeploys from GitHub too. And tests so we can auto-merge PRs.

kennethreitz avatar Feb 14 '19 11:02 kennethreitz

tests can just be "does this run"

kennethreitz avatar Feb 14 '19 11:02 kennethreitz

Alright. It would be good if someone could collaborate as well, I won't be available today

rHuggler avatar Feb 14 '19 14:02 rHuggler

@rHuggler I will be happy to help. :) Add me as a collaborator on the bot repo and ping me on Discord for further discussion. :+1:

ParthS007 avatar Feb 14 '19 14:02 ParthS007

@rHuggler @ParthS007 I'll be happy to collaborate too 😃 , let me know if there's anything I can help with

Projjol-zz avatar Feb 14 '19 14:02 Projjol-zz

I'll add you as collaborators when I'm back from lunch

EDIT: Done, you're both invited to be Collaborators. To everyone else, feel free to fork and open a Pull Request!

rHuggler avatar Feb 14 '19 14:02 rHuggler

thanks @rHuggler!

Projjol-zz avatar Feb 15 '19 20:02 Projjol-zz

Hi there, What is the current situation?

sadikkuzu avatar Mar 29 '19 06:03 sadikkuzu