Skip to content

Commit

Permalink
Added the Newbie Advice Button (#125)
Browse files Browse the repository at this point in the history
Signed-off-by: codexkunal <[email protected]>
  • Loading branch information
codexkunal authored Jan 8, 2025
1 parent d54fb5d commit 2039619
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 3 deletions.
3 changes: 0 additions & 3 deletions .env.example

This file was deleted.

6 changes: 6 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,12 @@ app.action("faqs", async ({ ack, say }) => {
await ack();
theActions.faqs(say);
});


app.action("newbie_advice", async({ack, say}) => {
await ack();
theActions.newbie_advice(say);
})
//****************************************** */

// When a user joins the team, the bot sends a DM to the newcommer asking them how they would like to contribute
Expand Down
9 changes: 9 additions & 0 deletions components/actions/actionResponses.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,14 @@ async function faqs(say) {
);
}

async function newbie_advice(say) {
return await say(
`You clicked *New to Open Source ? Get Advice* \n
Welcome to the CHAOSS Community! Starting your journey in open source can be exciting and rewarding. To help you get started, we have a detailed guide just for newcomers. You can find it here:\n <https://github.com/chaoss/community/blob/main/advice_to_newcomers.md>. \n
This guide provides tips, best practices, and encouragement to help you make meaningful contributions. Remember, every contribution, big or small, matters. We're here to support you every step of the way! 🎉`
);
}

module.exports = {
develop,
joinMeet,
Expand All @@ -98,4 +106,5 @@ module.exports = {
regional_chapters,
learn_something_else,
faqs,
newbie_advice
};
16 changes: 16 additions & 0 deletions components/joinTeam.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,22 @@ async function joinTeamSlack(event, client, logger) {
text: `Welcome to *CHAOSS Community* <@${event.user.id}>! 🎉How would you like to get started? \n\nI want to..`,
},
},
{
type: 'actions',
elements: [
{
type: 'button',
text: {
type: 'plain_text',
text: 'New to Open Source? Get Advice',
emoji: true,
},
style: 'primary',
value: 'newbie_advice',
action_id: 'newbie_advice'
},
],
},
{
type: 'actions',
elements: [
Expand Down
16 changes: 16 additions & 0 deletions components/newbie.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,22 @@ async function newHere(message, client, logger) {
text: `Welcome to *CHAOSS Community* <@${message.user}>! 🎉How would you like to get started? \n\nI want to..`,
},
},
{
type: 'actions',
elements: [
{
type: 'button',
text: {
type: 'plain_text',
text: 'New to Open Source? Get Advice',
emoji: true,
},
style: 'primary',
value: 'newbie_advice',
action_id: 'newbie_advice'
},
],
},
{
type: 'actions',
elements: [
Expand Down

0 comments on commit 2039619

Please sign in to comment.