https://github.com/e-chan1007/gmail-discord-notification
https://github.com/e-chan1007/gmail-discord-notification
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/e-chan1007/gmail-discord-notification
- Owner: e-chan1007
- Created: 2024-04-27T05:05:59.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-08T07:10:24.000Z (7 months ago)
- Last Synced: 2025-03-08T07:24:30.034Z (7 months ago)
- Language: TypeScript
- Size: 1.94 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# gmail-discord-notification
A simple Gmail notification for Discord.
## Installation
Project ID: `1zQ6wfsTUaecxmqNSijQyJ2fVh8PG4VEMc7zbGdSxBmAmdPAUD3zsWG0f`
## Usage
```js
const options = [
{
default: true,
webhookURL: 'https://discord.com/api/webhooks/...'
},
{
query: 'label:LabelName',
webhookURL: 'https://discord.com/api/webhooks/...',
discordOptions: {
avatarURL: 'https://cdn.discordapp.com/avatars/...',
}
},
{
query: 'from:noreply@example.com',
ignore: true
},
// ...
];GmailDiscordNotification.checkMail(options, PropertiesService.getScriptProperties());
```Where `options` is an array with the following structure:
```ts
interface Option {
default?: boolean;
query?: string;
webhookURL?: string;
ignore?: boolean;
discordOptions?: object;
discordEmbedOptions?: object;
prependSendTo?: boolean;
}
```## Tips
- Append `thread_id` query parameter to the webhook URL to send messages to the thread.
- `https://discord.com/api/webhooks/...?thread_id=...`