code100x / cms

https://app.100xdevs.com/
615 stars 830 forks source link

Create a discord bot #188

Open hkirat opened 3 months ago

hkirat commented 3 months ago

That posts anytime there is

  1. An issue created
  2. An bounty dispensed on PR merge on a channel on discord
Rash-Hit commented 3 months ago

ok , got it ..

nimit9 commented 3 months ago

Did you mean discord bot? @hkirat And should this bot be a standalone project or should it be integrated with the existing cms?

hkirat commented 3 months ago

lol yes

nimit9 commented 3 months ago

And should this bot be a standalone project or should it be integrated with the existing cms?

@hkirat

hkirat commented 3 months ago

can be independent project probably that's generic enough for anyone to ingrate

nimit9 commented 3 months ago

Okay, will work on it, can you assign it to me?

Rash-Hit commented 3 months ago

@hkirat thanks for the clarity but cant we do this via webhooks ???

hkirat commented 3 months ago

I'm totally unsure of the approach here open to ideas

Rash-Hit commented 3 months ago

@hkirat basically discord provide us a webhook url which we can connect with our github in setting .. and then can sync notification with discord ..

will send a video in few .. for confirmation

hkirat commented 3 months ago

ah ok seems straightforward then, video is much appreciated yes

Rash-Hit commented 3 months ago

@hkirat will send .. now adding border to comment box and sending there for confirmation ... haha

Rash-Hit commented 3 months ago

@hkirat please check here is the video , are we looking for something like this

https://github.com/code100x/cms/assets/73944177/dacbb699-b181-41ee-892b-3f225e694436

-- ps : compressing video took way more than the original task

devsargam commented 3 months ago

Can be done simply with discord.js

MAYANK-TRIPATH commented 3 months ago

hey @hkirat surr watch this may be this what you want. https://www.youtube.com/watch?v=-KDQqWNK3Tw

If not happy to make a custom discord bot :)

TanmayDhobale commented 3 months ago

@MAYANK-TRIPATH damn thanks for video its so easy with this approach

aadeshkulkarni commented 3 months ago

@hkirat - The below video is an implementation for Bounty hunter discord notification . If the approach is okay, can add logic for issue creation as well.

https://github.com/code100x/cms/assets/67855887/6bcf7cd8-3fad-42fd-b98c-ea961fba8eee

TanmayDhobale commented 3 months ago

DAMN BOT looks fine to me , but bro light mode ??

haddercone commented 3 months ago

@hkirat,

I've set up GitHub workflows for push notifications on new issues and bounties. Let me know your thoughts on sticking with this method.

Adding a video for your reference:

demo.webm

devsargam commented 3 months ago

@aadeshkulkarni @haddercone what do you think of this?

https://github.com/code100x/cms/assets/76874341/2523985c-84d1-46d7-833d-557cb9b113ae

devsargam commented 3 months ago

create issues or pr in this repo for testing: https://github.com/devsargam/100xbounty-bot

Updates: https://discord.gg/kFxQKbUG this channel

aadeshkulkarni commented 3 months ago

https://discord.gg/kFxQKbUG

Looks good @devsargam.

Curious to know the purpose of adding an additional comment on the Gh PR (since the /bounty $x comment also conveys a similar message)

On a different note, my approach requires the maintainer to setup github webhook, discord webhook & make changes in env. I liked @haddercone's approach more because it requires minimal configuration on the maintainer's side to get it up and running.

Interested to know what your approach is.

devsargam commented 3 months ago

Curious to know the purpose of adding an additional comment on the Gh PR (since the /bounty $x comment also conveys a similar message)

That comment is just a reference, in future it can be a call to different api to directly dispense the bounty amount Also, just showing the webhook on discord can fail at times

Actually mine approach is even bare minimum since you just need to add the app to github repo Try adding this app to one of your repo: https://github.com/apps/100xbountybot

aadeshkulkarni commented 3 months ago

Actually mine approach is even bare minimum since you just need to add the app to github repo Try adding this app to one of your repo: https://github.com/apps/100xbountybot

Tried it. Loved it. This is probably the best approach.

devsargam commented 3 months ago

Also: @aadeshkulkarni image

haddercone commented 3 months ago

The application looks great @devsargam!

I'm just curious to know about setting up Discord notifications for my personal channel within the app. I've saw that when I write the bounty comment, the reply occurs on the PR itself.

How can I receive these notifications on my own channel? Thanks

devsargam commented 3 months ago

@haddercone thanks 😇

You could either setup your own instance

Or

I can create a command like /setup webhook https://example.com Which probably requires some type of db happy to do it if u say so

haddercone commented 3 months ago

@devsargam, I was just curious about the setup that's all ☺️.

I was thinking from a point, where we would need to add the bots to the cohort 2 server. The application works fine with current configurations.

In current scenario we might have to setup a separate instance for the cohort 2 server.

devsargam commented 3 months ago

@haddercone yepp, you're correct 💯

@hkirat is more than qualified to setup for cohort server

neutr0n420 commented 3 months ago

I can see two PR for this issue, but if it is not too late can I also work on this one? @hkirat @devsargam

devsargam commented 3 months ago

@neutr0n420 already resolved with #225

neutr0n420 commented 3 months ago

ok cool

haddercone commented 3 months ago

@hkirat @devsargam , should I close #227 ?