Skip to content

Commit dccc1c3

Browse files
committed
expand example-specific tutorial guidance
1 parent 7cf8e1a commit dccc1c3

33 files changed

Lines changed: 33 additions & 0 deletions

‎examples/agent/read-only-inventory.ds‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ for (guild in guilds) {
1111
// This example demonstrates agent-friendly input, structured output, and safe automation.
1212
// Run it with: discript examples/agent/read-only-inventory.ds (or pipe it to discript for stdin mode).
1313
// Read the final value and comments together to follow the data flow.
14+
/* Tutorial focus: Use this as a read-only baseline: fetch guild data, shape it into an object, and print machine-readable output. */

‎examples/agent/validate-before-mutation.ds‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ discord.channels.get(channelId).send(content, {dryRun: true})
1313
// This example demonstrates agent-friendly input, structured output, and safe automation.
1414
// Run it with: discript examples/agent/validate-before-mutation.ds (or pipe it to discript for stdin mode).
1515
// Read the final value and comments together to follow the data flow.
16+
/* Tutorial focus: The workflow separates validation from mutation so an agent can inspect the proposed target before approving a change. */

‎examples/composition/imported-functions.ds‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ for (guild in guilds) {
88
// This example demonstrates reusable functions and imported scripts.
99
// Run it with: discript examples/composition/imported-functions.ds (or pipe it to discript for stdin mode).
1010
// Read the final value and comments together to follow the data flow.
11+
/* Tutorial focus: This demonstrates `importScript`, shared scope, and reusable functions split across files. */

‎examples/discord/channel-messages.ds‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ print({id: message.id, author: message.author, content: message.content})
66
// This example demonstrates Discord API operations with safety controls.
77
// Run it with: discript examples/discord/channel-messages.ds (or pipe it to discript for stdin mode).
88
// Read the final value and comments together to follow the data flow.
9+
/* Tutorial focus: This demonstrates channel lookup, message listing, and selecting message fields for a compact report. */

‎examples/discord/dry-run-message.ds‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ preview
55
// This example demonstrates Discord API operations with safety controls.
66
// Run it with: discript examples/discord/dry-run-message.ds (or pipe it to discript for stdin mode).
77
// Read the final value and comments together to follow the data flow.
8+
/* Tutorial focus: Use `dryRun: true` to preview a message mutation while guaranteeing that Discord is not changed. */

‎examples/discord/emoji-sticker-inventory.ds‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ stickers = discord.guilds.get(guildId).stickers.list()
77
// This example demonstrates Discord API operations with safety controls.
88
// Run it with: discript examples/discord/emoji-sticker-inventory.ds (or pipe it to discript for stdin mode).
99
// Read the final value and comments together to follow the data flow.
10+
/* Tutorial focus: This demonstrates nested guild collections and normalized emoji/sticker inventory values. */

‎examples/discord/guild-summary.ds‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ channels = guild.channels.list()
99
// This example demonstrates Discord API operations with safety controls.
1010
// Run it with: discript examples/discord/guild-summary.ds (or pipe it to discript for stdin mode).
1111
// Read the final value and comments together to follow the data flow.
12+
/* Tutorial focus: This demonstrates composing guild, channel, role, and member reads into one summary object. */

‎examples/discord/invites-events.ds‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ events = discord.guilds.get(guildId).scheduledEvents.list()
66
// This example demonstrates Discord API operations with safety controls.
77
// Run it with: discript examples/discord/invites-events.ds (or pipe it to discript for stdin mode).
88
// Read the final value and comments together to follow the data flow.
9+
/* Tutorial focus: This demonstrates reading two different guild resource collections and combining their results. */

‎examples/discord/list-guilds-and-channels.ds‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ for (guild in guilds) {
88
// This example demonstrates Discord API operations with safety controls.
99
// Run it with: discript examples/discord/list-guilds-and-channels.ds (or pipe it to discript for stdin mode).
1010
// Read the final value and comments together to follow the data flow.
11+
/* Tutorial focus: This demonstrates nested iteration: list every guild, then list the channels belonging to each guild. */

‎examples/discord/member-report.ds‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ for (member in members) {
88
// This example demonstrates Discord API operations with safety controls.
99
// Run it with: discript examples/discord/member-report.ds (or pipe it to discript for stdin mode).
1010
// Read the final value and comments together to follow the data flow.
11+
/* Tutorial focus: This demonstrates member lookup, role projection, and voice-state reporting. */

0 commit comments

Comments
 (0)