Dagger
Search

notify

Supports Discord & Slack.

Installation

dagger install github.com/gerhard/daggerverse/notify@v0.4.0

Entrypoint

Return Type
Notify
Example
dagger -m github.com/gerhard/daggerverse/notify@a05f4cb0e94139014c94936bcb18a6081b068eac call \
func (m *myModule) example() *Notify  {
	return dag.
			Notify()
}
@function
def example() -> dag.Notify:
	return (
		dag.notify()
	)
@func()
example(): Notify {
	return dag
		.notify()
}

Types

Notify 🔗

discord() 🔗

Message a Discord webhook: dagger call discord --webhook-url=env:DISCORD_WEBHOOK --message="👋 from Dagger notify module"

Return Type
String !
Arguments
NameTypeDefault ValueDescription
webhookUrlSecret !-No description provided
messageString !-No description provided
Example
dagger -m github.com/gerhard/daggerverse/notify@a05f4cb0e94139014c94936bcb18a6081b068eac call \
 discord --webhook-url env:MYSECRET --message string
func (m *myModule) example(ctx context.Context, webhookUrl *Secret, message string) string  {
	return dag.
			Notify().
			Discord(ctx, webhookUrl, message)
}
@function
async def example(webhook_url: dagger.Secret, message: str) -> str:
	return await (
		dag.notify()
		.discord(webhook_url, message)
	)
@func()
async example(webhookUrl: Secret, message: string): Promise<string> {
	return dag
		.notify()
		.discord(webhookUrl, message)
}

slack() 🔗

Message a specific Slack channel: dagger call slack --token=env:SLACK_TOKEN --channel-id=C07PBDE3U57 --color="#FC0" --message="👋 from Dagger notify module"

Return Type
String !
Arguments
NameTypeDefault ValueDescription
tokenSecret !-The slack token to authenticate with the slack organization
colorString !-The sidebar color of the message
messageString !-The content of the notification to send
channelIdString !-The channel where to post the message
titleString -Set a title to the message
footerString -Set a footer to the message
footerIconString -Set an icon in the footer, the icon should be a link
imageUrlString -Add an image in the message
threadIdString -The thread id if we want to reply to a message or in a thread
Example
dagger -m github.com/gerhard/daggerverse/notify@a05f4cb0e94139014c94936bcb18a6081b068eac call \
 slack --token env:MYSECRET --color string --message string --channel-id string
func (m *myModule) example(ctx context.Context, token *Secret, color string, message string, channelId string) string  {
	return dag.
			Notify().
			Slack(ctx, token, color, message, channelId)
}
@function
async def example(token: dagger.Secret, color: str, message: str, channel_id: str) -> str:
	return await (
		dag.notify()
		.slack(token, color, message, channel_id)
	)
@func()
async example(token: Secret, color: string, message: string, channelId: string): Promise<string> {
	return dag
		.notify()
		.slack(token, color, message, channelId)
}