You can now handle forwarded messages using the new message snapshots.
@Override
public void onMessageReceived(MessageReceivedEvent event) {
MessageReference messageReference = event.getMessage().getMessageReference();
// Forwarded messages have a reference of type FORWARD
if (messageReference != null && messageReference.getType() == MessageReference.MessageReferenceType.FORWARD) {
// The content of the forwarded message is provided as a snapshot
MessageSnapshot snapshot = event.getMessage().getMessageSnapshots().getFirst();
System.out.println("Received forwarded message with content: " + snapshot.getContentRaw());
}
}
A bot can also forward a message using Message#fowardTo. Note that a forwarded message cannot contain any additional content.
To create a voice message, you must first determine the audio media type of your voice message and sample a waveform up to 256 bytes. Voice messages require a valid audio/* media type like audio/ogg.
The waveform is used to render the voice message shape in the preview. It must not be an accurate sampling of the actual audio.
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Bumps net.dv8tion:JDA from 5.1.1 to 5.1.2.
Release notes
Sourced from net.dv8tion:JDA's releases.
... (truncated)
Commits
5f799f1
Bump version to 5.1.22195954
Add github action for publishing (#2739)b036b20
Add support for message forwarding (#2744)e1188e7
Fix ScheduledEventManagerImpl::setStatus (#2743)77ec412
Support sending voice messages (#2738)8007014
Fix readme typo (#2724)Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show