The documentation for Alexa skill events at https://www.jovo.tech/docs/amazon-alexa/skill-events#skill-events uses two different expressions to get the user id:
this.getUserId() and this.$user.Id()
Both don’t work, it should be:
this.$user.getId()
The documentation for Alexa skill events at https://www.jovo.tech/docs/amazon-alexa/skill-events#skill-events uses two different expressions to get the user id:
this.getUserId() and this.$user.Id()
Both don’t work, it should be:
this.$user.getId()
Ah yes, that’s correct, thank you!
Would you be up to submitting a pull request with the fix? https://github.com/jovotech/jovo-framework/blob/master/docs/platforms/amazon-alexa/skillevents.md
Shame on me, but i’m really bad with GIT. I could create a patch though. Maybe this helps:
diff --git a/docs/platforms/amazon-alexa/skillevents.md b/docs/platforms/amazon-alexa/skillevents.md
index 49ba6ff7f4d72f132eb996aa0d3f6b5d6f302027..5c59781c8ba799a114b6fded65332e8f3776f8ef 100644
--- a/docs/platforms/amazon-alexa/skillevents.md
+++ b/docs/platforms/amazon-alexa/skillevents.md
@@ -117,7 +117,7 @@ And adding the `AlexaSkillEvent.SkillEnabled` inside your `ON_EVENT` state:
ON_EVENT: {
'AlexaSkillEvent.SkillEnabled'() {
console.log('AlexaSkillEvent.SkillEnabled');
- console.log(`UserId: ${this.getUserId()}`);
+ console.log(`UserId: ${this.$user.getId()}`);
},
}
```
@@ -143,7 +143,7 @@ And adding the `AlexaSkillEvent.SkillDisabled` inside your `ON_EVENT` state:
ON_EVENT: {
'AlexaSkillEvent.SkillDisabled'() {
console.log('AlexaSkillEvent.SkillDisabled');
- console.log(`UserId: ${this.getUserId()}`);
+ console.log(`UserId: ${this.$user.getId()}`);
// Remove user from the database when the skill is disabled
// if the user re-enables the skill, they will have a new userId anyway
@@ -173,7 +173,7 @@ And adding the `AlexaSkillEvent.SkillAccountLinked` inside your `ON_EVENT` state
ON_EVENT: {
'AlexaSkillEvent.SkillAccountLinked'() {
console.log('AlexaSkillEvent.SkillAccountLinked');
- console.log(`UserId: ${this.getUserId()}`);
+ console.log(`UserId: ${this.$user.getId()}`);
},
}
```
@@ -201,7 +201,7 @@ And adding the `AlexaSkillEvent.SkillPermissionAccepted` inside your `ON_EVENT`
ON_EVENT: {
'AlexaSkillEvent.SkillPermissionAccepted'() {
console.log('AlexaSkillEvent.SkillPermissionAccepted');
- console.log(`UserId: ${this.getUserId()}`);
+ console.log(`UserId: ${this.$user.getId()}`);
console.log(`Permissions: ${JSON.stringify(this.$alexaSkill.getSkillEventBody().acceptedPermissions)}`);
},
}
@@ -211,7 +211,7 @@ ON_EVENT: {
ON_EVENT: {
'AlexaSkillEvent.SkillPermissionAccepted'() {
console.log('AlexaSkillEvent.SkillPermissionAccepted');
- console.log(`UserId: ${this.getUserId()}`);
+ console.log(`UserId: ${this.$user.getId()}`);
console.log(`Permissions: ${JSON.stringify(this.$alexaSkill!.getSkillEventBody().acceptedPermissions)}`);
},
}
@@ -238,7 +238,7 @@ And adding the `AlexaSkillEvent.SkillPermissionChanged` inside your `ON_EVENT` s
ON_EVENT: {
'AlexaSkillEvent.SkillPermissionChanged'() {
console.log('AlexaSkillEvent.SkillPermissionChanged');
- console.log(`UserId: ${this.$user.Id()}`);
+ console.log(`UserId: ${this.$user.getId()}`);
console.log(`Permissions: ${JSON.stringify(this.$alexaSkill.getSkillEventBody().acceptedPermissions)}`);
},
}
@@ -248,7 +248,7 @@ ON_EVENT: {
ON_EVENT: {
'AlexaSkillEvent.SkillPermissionChanged'() {
console.log('AlexaSkillEvent.SkillPermissionChanged');
- console.log(`UserId: ${this.$user.Id()}`);
+ console.log(`UserId: ${this.$user.getId()}`);
console.log(`Permissions: ${JSON.stringify(this.$alexaSkill!.getSkillEventBody().acceptedPermissions)}`);
},
}
Haha, ok, thank you!! I typically just update the docs directly on GitHub and create a Pull Request from their UI.
Just wanted to make sure you get the credits