Dagger
Search

notify

Currently supports Discord only. Coming up: Slack.

Installation

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

Entrypoint

Return Type
Notify
Example
dagger -m github.com/gerhard/daggerverse/notify@4ad0f0317fd57c41001b48c5a9a3a49d39e43210 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() 🔗

EXAMPLE: dagger call discord –webhook-url env:DISCORD_WEBHOOK –message “Hi from Dagger Notify Module 👋 Learn more at https://github.com/gerhard/daggerverse”

Return Type
String !
Arguments
NameTypeDefault ValueDescription
webhookUrlSecret !-No description provided
messageString !-No description provided
Example
dagger -m github.com/gerhard/daggerverse/notify@4ad0f0317fd57c41001b48c5a9a3a49d39e43210 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() 🔗

Allow to send message on slack

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

Slack 🔗

sendMessage() 🔗

Send a message to a specific slack channel or reply in a thread

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@4ad0f0317fd57c41001b48c5a9a3a49d39e43210 call \
 slack \
 send-message --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().
			SendMessage(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()
		.send_message(token, color, message, channel_id)
	)
@func()
async example(token: Secret, color: string, message: string, channelId: string): Promise<string> {
	return dag
		.notify()
		.slack()
		.sendMessage(token, color, message, channelId)
}