Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a discord bot #188

Closed
hkirat opened this issue Mar 10, 2024 · 32 comments
Closed

Create a discord bot #188

hkirat opened this issue Mar 10, 2024 · 32 comments

Comments

@hkirat
Copy link
Contributor

hkirat commented Mar 10, 2024

That posts anytime there is

  1. An issue created
  2. An bounty dispensed on PR merge
    on a channel on discord
@Rash-Hit
Copy link
Contributor

ok , got it ..

@nimit9
Copy link
Contributor

nimit9 commented Mar 10, 2024

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

@hkirat hkirat changed the title Create a docker bot Create a discord bot Mar 10, 2024
@hkirat
Copy link
Contributor Author

hkirat commented Mar 10, 2024

lol yes

@nimit9
Copy link
Contributor

nimit9 commented Mar 10, 2024

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

@hkirat

@hkirat
Copy link
Contributor Author

hkirat commented Mar 10, 2024

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

@nimit9
Copy link
Contributor

nimit9 commented Mar 10, 2024

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

@Rash-Hit
Copy link
Contributor

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

@hkirat
Copy link
Contributor Author

hkirat commented Mar 10, 2024

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

@Rash-Hit
Copy link
Contributor

@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
Copy link
Contributor Author

hkirat commented Mar 10, 2024

ah ok seems straightforward then, video is much appreciated yes

@Rash-Hit
Copy link
Contributor

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

@Rash-Hit
Copy link
Contributor

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

testing.webhook.mp4

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

@devsargam
Copy link
Collaborator

devsargam commented Mar 11, 2024

Can be done simply with discord.js

  • Listen to events in github when an issue or pr is created
  • scan for every message in the pr and if @hkirat sends /bounty ${number} parse with regex and post in discord
  • give the bounty to the author where @hkirat gives bounty

@MAYANK-TRIPATH
Copy link

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
Copy link
Contributor

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

@aadeshkulkarni
Copy link

@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.

bountry-hunter-pr.mov

@TanmayDhobale
Copy link
Contributor

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

@haddercone
Copy link
Contributor

@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
Copy link
Collaborator

devsargam commented Mar 15, 2024

@aadeshkulkarni @haddercone what do you think of this?

Kapture.2024-03-16.at.03.19.28.mp4

@devsargam
Copy link
Collaborator

devsargam commented Mar 15, 2024

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

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

@aadeshkulkarni
Copy link

aadeshkulkarni commented Mar 16, 2024

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
Copy link
Collaborator

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
Copy link

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
Copy link
Collaborator

Also: @aadeshkulkarni
image

@haddercone
Copy link
Contributor

haddercone commented Mar 16, 2024

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
Copy link
Collaborator

@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
Copy link
Contributor

haddercone commented Mar 16, 2024

@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
Copy link
Collaborator

@haddercone yepp, you're correct 💯

@hkirat is more than qualified to setup for cohort server

@neutr0n420
Copy link

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
Copy link
Collaborator

@neutr0n420 already resolved with #225

@neutr0n420
Copy link

ok cool

@haddercone
Copy link
Contributor

@hkirat @devsargam , should I close #227 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
9 participants