Skip to content

Commit e18ca47

Browse files
bug fixes
1 parent 74f4bd1 commit e18ca47

File tree

2 files changed

+29
-17
lines changed

2 files changed

+29
-17
lines changed

src/discordWebhook.js

+25-15
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,14 @@ async function sendFollowedUserDiscordEmbed(user) {
8282
embeds: [
8383
{
8484
title: `Successfully followed ${user.login} (${user.id})`,
85+
description: `[[Github Profile]](${user.html_url}) [[Repositories]](https://github.com/${user.login}?tab=repositories) [[Starred Repos]](https://github.com/${user.login}?tab=stars)`,
8586
thumbnail: {
8687
url: user.avatar_url, // Set the user's avatar as the embed thumbnail
8788
},
8889
fields: [
8990
{
90-
name: "Profile URL",
91-
value: `[${user.login}](${user.html_url})`, // Embed the link to the user's profile
91+
name: "Username",
92+
value: user.login, // Embed the link to the user's profile
9293
inline: true, // Keep fields on the same line
9394
},
9495
{
@@ -97,7 +98,7 @@ async function sendFollowedUserDiscordEmbed(user) {
9798
inline: true, // Keep fields on the same line
9899
},
99100
{
100-
name: "Followed At",
101+
name: "Followed On",
101102
value: new Date().toLocaleString(), // Display current time and date
102103
inline: true, // Keep fields on the same line
103104
},
@@ -132,31 +133,40 @@ async function sendUnfollowedUserDiscordEmbed(user) {
132133
embeds: [
133134
{
134135
title: `Successfully unfollowed ${user.login} (${user.id})`,
135-
url: user.html_url,
136-
description: `Reason: ${user.unfollow_reason}`,
136+
description: `[[Github Profile]](${user.html_url}) [[Repositories]](https://github.com/${user.login}?tab=repositories) [[Starred Repos]](https://github.com/${user.login}?tab=stars)`,
137137
thumbnail: {
138138
url: user.avatar_url, // Set the user's avatar as the embed thumbnail
139139
},
140140
fields: [
141141
{
142142
name: "Followed On",
143-
value: new Date(user.followed_on).toLocaleString(), // Format the followed_on date
144-
inline: true, // Single line for followed date
143+
value: new Date(user.followed_on).toLocaleString(),
144+
inline: true,
145145
},
146+
{
147+
name: "Unfollow Queue Timestamp",
148+
value: new Date(user.added_to_queue_on).toLocaleString(),
149+
inline: true,
150+
},
151+
// Empty field to ensure a new line starts after two fields
152+
{ name: "\u200B", value: "\u200B", inline: true },
153+
146154
{
147155
name: "Unfollowed On",
148-
value: new Date().toLocaleString(), // Display current time and date
149-
inline: true, // Single line for unfollowed date
156+
value: new Date().toLocaleString(),
157+
inline: true,
150158
},
151159
{
152160
name: "Reason",
153-
value: user.unfollow_reason, // Display current time and date
154-
inline: true, // Single line for unfollowed date
161+
value: user.unfollow_reason || "N/A",
162+
inline: true,
155163
},
164+
// Another empty field to force two fields per line
165+
{ name: "\u200B", value: "\u200B", inline: true },
156166
],
157-
color: colorDecimal, // Use the custom color
167+
color: colorDecimal,
158168
footer: {
159-
text: "Built by www.kevintrinh.dev", // Add footer text
169+
text: "Built by www.kevintrinh.dev",
160170
},
161171
timestamp: new Date().toISOString(),
162172
},
@@ -184,7 +194,7 @@ async function sendMovedUserToUnfollowQueueDiscordEmbed(user) {
184194
embeds: [
185195
{
186196
title: `Added user to unfollow queue: ${user.login} (${user.id})`,
187-
url: user.html_url,
197+
description: `[[Github Profile]](${user.html_url}) [[Repositories]](https://github.com/${user.login}?tab=repositories) [[Starred Repos]](https://github.com/${user.login}?tab=stars)`,
188198
thumbnail: {
189199
url: user.avatar_url, // Set the user's avatar as the embed thumbnail
190200
},
@@ -195,7 +205,7 @@ async function sendMovedUserToUnfollowQueueDiscordEmbed(user) {
195205
inline: true, // Single line for followed date
196206
},
197207
{
198-
name: "Queue Timestamp",
208+
name: "Moved to Queue",
199209
value: new Date().toLocaleString(), // Display current time and date
200210
inline: true, // Single line for unfollowed date
201211
},

src/index.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,13 @@ async function processQueue() {
5151
console.log("Starting the main processing loop...");
5252

5353
sendDiscordEmbed(
54-
"Successfully connected to webhook!",
55-
"Note that this application may result in your account getting banned. Please proceed with caution and use appropriate config settings.\n\n**Github Repo Link ➜** [Github-Followers-Bot](https://github.com/KevinTrinh1227/Github-Followers-Bot)\n**Report issues ➜** [Github Support Ticket](https://github.com/KevinTrinh1227/Github-Followers-Bot/issues)\n**My Github Page ➜** [Visit My Profile](https://github.com/KevinTrinh1227)\n\nPlease support me by **starring** and/or **forking** my repositories! Thank you for using my product!",
54+
"Application is now online!",
55+
"Note that this application may result in your account getting banned. Please proceed with caution and use appropriate config settings.\n\n**Github Repo Link ➜** [Github-Followers-Bot](https://github.com/KevinTrinh1227/Github-Followers-Bot)\n**Report issues ➜** [Github Support Ticket](https://github.com/KevinTrinh1227/Github-Followers-Bot/issues)\n**My Github Page ➜** [Visit My Profile](https://github.com/KevinTrinh1227)\n\nReport any and all issues on Github. Please support me by **starring** and/or **forking** my repositories! Thank you for using my product!",
5656
"#55FF55"
5757
);
5858

59+
// await moveFollowBacksToUnfollowQueue();
60+
5961
while (true) {
6062
try {
6163
const myTotalFollowing = await getTotalFollowing(MY_GITHUB_USERNAME);

0 commit comments

Comments
 (0)