Skip to content

Commit

Permalink
feat: Add event listener to respond to messages mentioning the bot
Browse files Browse the repository at this point in the history
- Implemented an event listener in `index.js` to reply to messages where the bot is mentioned.
- The bot now responds with a greeting and a brief description of its capabilities.
- remived fallback versions of streamyfin in `createissue`
  • Loading branch information
retardgerman committed Jan 11, 2025
1 parent 2123a79 commit 24cc188
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 1 addition & 3 deletions client.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@ module.exports = class Streamyfin extends Client {
} catch (error) {
console.error("Error fetching releases:", error);
return [
{ name: "0.22.0", value: "0.22.0" }, // Fallback data
{ name: "0.21.0", value: "0.21.0" },
{ name: "Older", value: "Older" },
{ name: "unknown", value: "unknown" }, // Fallback data
];
}
};
Expand Down
6 changes: 6 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ client.on("interactionCreate", async (interaction) => {
});
}
})

client.on('messageCreate', message => {
if (message.mentions.has(client.user) && !message.author.bot) {
message.reply("Hi there, I'm Finn! I'm a bot written for streamyfin! To find out what I can do, use `/help`!");
}
});
const registerCommands = async () => {
if (client.githubToken) await client.fetchReleases();

Expand Down

0 comments on commit 24cc188

Please sign in to comment.