Skip to content

Commit

Permalink
✨ Added ipc DISCORD_GET_MESSAGES
Browse files Browse the repository at this point in the history
  • Loading branch information
ZickZenni committed Aug 29, 2024
1 parent 8c91205 commit 72b4b98
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/main/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,13 @@ export default class WaveCordApp {
return this.discord?.getChannel(channelId);
});

ipcMain.handle('DISCORD_GET_MESSAGES', (_, channelId: string) => {
const channel = this.discord?.getChannel(channelId);
if (channel === null || channel === undefined) return [];

return channel.getMessages(this.discord!);
});

ipcMain.handle(
'DISCORD_GET_LAST_VISITED_GUILD_CHANNEL',
(_, guildId: string) => {
Expand Down
1 change: 1 addition & 0 deletions src/main/ipc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export type IpcChannels =
| 'DISCORD_READY'
| 'DISCORD_GET_GUILDS'
| 'DISCORD_LOAD_CHANNEL'
| 'DISCORD_GET_MESSAGES'
| 'DISCORD_LOAD_GUILD'
| 'DISCORD_GET_LAST_VISITED_GUILD_CHANNEL'
| 'DISCORD_SET_LAST_VISITED_GUILD_CHANNEL';

0 comments on commit 72b4b98

Please sign in to comment.