Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions docs/tutorials/writing_your_first_bot.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ void main() async {
if (event.mentions.contains(botUser)) {
await event.message.channel.sendMessage(MessageBuilder(
content: 'Hi There!',
replyId: event.message.id,
referencedMessage: MessageReferenceBuilder.reply(messageId: event.message.id,),
));
}
});
Expand Down Expand Up @@ -167,7 +167,7 @@ client.onMessageCreate.listen((event) async {
if (event.mentions.contains(botUser)) {
await event.message.channel.sendMessage(MessageBuilder(
content: 'Hi There!',
replyId: event.message.id,
referencedMessage: MessageReferenceBuilder.reply(messageId: event.message.id),
));
}
});
Expand All @@ -188,13 +188,13 @@ If it does, then we want to send a message to the same channel the message was s
```dart
await event.message.channel.sendMessage(MessageBuilder(
content: 'Hi There!',
replyId: event.message.id,
referencedMessage: MessageReferenceBuilder.reply(messageId: event.message.id),
));
```

The `sendMessage` method takes a `MessageBuilder` that describes the message that will be sent. In
this case, we specify the content of our message and a `replyId`.
this case, we specify the content of our message and a `referencedMessage`.

The `replyId` parameter allows us to reply to a message (here, the message that mentioned the bot)
The `referencedMessage` parameter allows us to reply to a message (here, the message that mentioned the bot)
by giving its ID. Most entities - messages included - have an ID on Discord, which we access with
`message.id`.