Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What's the ctx object contain bot? #18

Closed
loganpowell opened this issue Feb 19, 2020 · 2 comments
Closed

What's the ctx object contain bot? #18

loganpowell opened this issue Feb 19, 2020 · 2 comments

Comments

@loganpowell
Copy link
Owner

code:

module.exports = app => {
  app.log("yay, loaded stimula")
  app.on("issues.opened", async ctx => {
    const comment = ctx.issue({ body: "thanks for posting!" })
    const payload = ctx.issue({ body: JSON.stringify(ctx, null, 2) })
    return ctx.github.issues.createComment(payload)
  })
}
@stimula
Copy link

stimula bot commented Feb 19, 2020

{
"name": "issues",
"id": "34231600-535d-11ea-9a64-853ec23b82d4",
"payload": {
"action": "opened",
"issue": {
"url": "https://api.github.com/repos/loganpowell/ac/issues/18",
"repository_url": "https://api.github.com/repos/loganpowell/ac",
"labels_url": "https://api.github.com/repos/loganpowell/ac/issues/18/labels{/name}",
"comments_url": "https://api.github.com/repos/loganpowell/ac/issues/18/comments",
"events_url": "https://api.github.com/repos/loganpowell/ac/issues/18/events",
"html_url": "#18",
"id": 567852856,
"node_id": "MDU6SXNzdWU1Njc4NTI4NTY=",
"number": 18,
"title": "What's the ctx object contain bot?",
"user": {
"login": "loganpowell",
"id": 3408191,
"node_id": "MDQ6VXNlcjM0MDgxOTE=",
"avatar_url": "https://avatars1.githubusercontent.com/u/3408191?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/loganpowell",
"html_url": "https://github.com/loganpowell",
"followers_url": "https://api.github.com/users/loganpowell/followers",
"following_url": "https://api.github.com/users/loganpowell/following{/other_user}",
"gists_url": "https://api.github.com/users/loganpowell/gists{/gist_id}",
"starred_url": "https://api.github.com/users/loganpowell/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/loganpowell/subscriptions",
"organizations_url": "https://api.github.com/users/loganpowell/orgs",
"repos_url": "https://api.github.com/users/loganpowell/repos",
"events_url": "https://api.github.com/users/loganpowell/events{/privacy}",
"received_events_url": "https://api.github.com/users/loganpowell/received_events",
"type": "User",
"site_admin": false
},
"labels": [],
"state": "open",
"locked": false,
"assignee": null,
"assignees": [],
"milestone": null,
"comments": 0,
"created_at": "2020-02-19T21:17:16Z",
"updated_at": "2020-02-19T21:17:16Z",
"closed_at": null,
"author_association": "OWNER",
"body": "code:\r\n\r\njs\r\nmodule.exports = app => {\r\n app.log(\"yay, loaded stimula\")\r\n app.on(\"issues.opened\", async ctx => {\r\n const comment = ctx.issue({ body: \"thanks for posting!\" })\r\n const payload = ctx.issue({ body: JSON.stringify(ctx, null, 2) })\r\n return ctx.github.issues.createComment(payload)\r\n })\r\n}\r\n\r\n"
},
"repository": {
"id": 229994333,
"node_id": "MDEwOlJlcG9zaXRvcnkyMjk5OTQzMzM=",
"name": "ac",
"full_name": "loganpowell/ac",
"private": false,
"owner": {
"login": "loganpowell",
"id": 3408191,
"node_id": "MDQ6VXNlcjM0MDgxOTE=",
"avatar_url": "https://avatars1.githubusercontent.com/u/3408191?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/loganpowell",
"html_url": "https://github.com/loganpowell",
"followers_url": "https://api.github.com/users/loganpowell/followers",
"following_url": "https://api.github.com/users/loganpowell/following{/other_user}",
"gists_url": "https://api.github.com/users/loganpowell/gists{/gist_id}",
"starred_url": "https://api.github.com/users/loganpowell/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/loganpowell/subscriptions",
"organizations_url": "https://api.github.com/users/loganpowell/orgs",
"repos_url": "https://api.github.com/users/loganpowell/repos",
"events_url": "https://api.github.com/users/loganpowell/events{/privacy}",
"received_events_url": "https://api.github.com/users/loganpowell/received_events",
"type": "User",
"site_admin": false
},
"html_url": "https://github.com/loganpowell/ac",
"description": null,
"fork": false,
"url": "https://api.github.com/repos/loganpowell/ac",
"forks_url": "https://api.github.com/repos/loganpowell/ac/forks",
"keys_url": "https://api.github.com/repos/loganpowell/ac/keys{/key_id}",
"collaborators_url": "https://api.github.com/repos/loganpowell/ac/collaborators{/collaborator}",
"teams_url": "https://api.github.com/repos/loganpowell/ac/teams",
"hooks_url": "https://api.github.com/repos/loganpowell/ac/hooks",
"issue_events_url": "https://api.github.com/repos/loganpowell/ac/issues/events{/number}",
"events_url": "https://api.github.com/repos/loganpowell/ac/events",
"assignees_url": "https://api.github.com/repos/loganpowell/ac/assignees{/user}",
"branches_url": "https://api.github.com/repos/loganpowell/ac/branches{/branch}",
"tags_url": "https://api.github.com/repos/loganpowell/ac/tags",
"blobs_url": "https://api.github.com/repos/loganpowell/ac/git/blobs{/sha}",
"git_tags_url": "https://api.github.com/repos/loganpowell/ac/git/tags{/sha}",
"git_refs_url": "https://api.github.com/repos/loganpowell/ac/git/refs{/sha}",
"trees_url": "https://api.github.com/repos/loganpowell/ac/git/trees{/sha}",
"statuses_url": "https://api.github.com/repos/loganpowell/ac/statuses/{sha}",
"languages_url": "https://api.github.com/repos/loganpowell/ac/languages",
"stargazers_url": "https://api.github.com/repos/loganpowell/ac/stargazers",
"contributors_url": "https://api.github.com/repos/loganpowell/ac/contributors",
"subscribers_url": "https://api.github.com/repos/loganpowell/ac/subscribers",
"subscription_url": "https://api.github.com/repos/loganpowell/ac/subscription",
"commits_url": "https://api.github.com/repos/loganpowell/ac/commits{/sha}",
"git_commits_url": "https://api.github.com/repos/loganpowell/ac/git/commits{/sha}",
"comments_url": "https://api.github.com/repos/loganpowell/ac/comments{/number}",
"issue_comment_url": "https://api.github.com/repos/loganpowell/ac/issues/comments{/number}",
"contents_url": "https://api.github.com/repos/loganpowell/ac/contents/{+path}",
"compare_url": "https://api.github.com/repos/loganpowell/ac/compare/{base}...{head}",
"merges_url": "https://api.github.com/repos/loganpowell/ac/merges",
"archive_url": "https://api.github.com/repos/loganpowell/ac/{archive_format}{/ref}",
"downloads_url": "https://api.github.com/repos/loganpowell/ac/downloads",
"issues_url": "https://api.github.com/repos/loganpowell/ac/issues{/number}",
"pulls_url": "https://api.github.com/repos/loganpowell/ac/pulls{/number}",
"milestones_url": "https://api.github.com/repos/loganpowell/ac/milestones{/number}",
"notifications_url": "https://api.github.com/repos/loganpowell/ac/notifications{?since,all,participating}",
"labels_url": "https://api.github.com/repos/loganpowell/ac/labels{/name}",
"releases_url": "https://api.github.com/repos/loganpowell/ac/releases{/id}",
"deployments_url": "https://api.github.com/repos/loganpowell/ac/deployments",
"created_at": "2019-12-24T19:25:07Z",
"updated_at": "2020-02-09T07:17:14Z",
"pushed_at": "2020-02-09T07:17:12Z",
"git_url": "git://github.com/loganpowell/ac.git",
"ssh_url": "git@github.com:loganpowell/ac.git",
"clone_url": "https://github.com/loganpowell/ac.git",
"svn_url": "https://github.com/loganpowell/ac",
"homepage": "https://loganpowell.github.io/ac",
"size": 9914,
"stargazers_count": 1,
"watchers_count": 1,
"language": "JavaScript",
"has_issues": true,
"has_projects": true,
"has_downloads": true,
"has_wiki": true,
"has_pages": true,
"forks_count": 0,
"mirror_url": null,
"archived": false,
"disabled": false,
"open_issues_count": 18,
"license": null,
"forks": 0,
"open_issues": 18,
"watchers": 1,
"default_branch": "master"
},
"sender": {
"login": "loganpowell",
"id": 3408191,
"node_id": "MDQ6VXNlcjM0MDgxOTE=",
"avatar_url": "https://avatars1.githubusercontent.com/u/3408191?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/loganpowell",
"html_url": "https://github.com/loganpowell",
"followers_url": "https://api.github.com/users/loganpowell/followers",
"following_url": "https://api.github.com/users/loganpowell/following{/other_user}",
"gists_url": "https://api.github.com/users/loganpowell/gists{/gist_id}",
"starred_url": "https://api.github.com/users/loganpowell/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/loganpowell/subscriptions",
"organizations_url": "https://api.github.com/users/loganpowell/orgs",
"repos_url": "https://api.github.com/users/loganpowell/repos",
"events_url": "https://api.github.com/users/loganpowell/events{/privacy}",
"received_events_url": "https://api.github.com/users/loganpowell/received_events",
"type": "User",
"site_admin": false
},
"installation": {
"id": 6879711,
"node_id": "MDIzOkludGVncmF0aW9uSW5zdGFsbGF0aW9uNjg3OTcxMQ=="
}
},
"github": {
"log": {},
"actions": {},
"activity": {},
"apps": {},
"checks": {},
"codesOfConduct": {},
"emojis": {},
"gists": {},
"git": {},
"gitignore": {},
"interactions": {},
"issues": {},
"licenses": {},
"markdown": {},
"meta": {},
"migrations": {},
"oauthAuthorizations": {},
"orgs": {},
"projects": {},
"pulls": {},
"rateLimit": {},
"reactions": {},
"repos": {},
"search": {},
"teams": {},
"users": {},
"retry": {}
}
}

@stimula
Copy link

stimula bot commented Feb 24, 2020

{
"name": "issues",
"id": "8cb53300-5710-11ea-9812-ae218d12ddfc",
"payload": {
"action": "closed",
"issue": {
"url": "https://api.github.com/repos/loganpowell/ac/issues/18",
"repository_url": "https://api.github.com/repos/loganpowell/ac",
"labels_url": "https://api.github.com/repos/loganpowell/ac/issues/18/labels{/name}",
"comments_url": "https://api.github.com/repos/loganpowell/ac/issues/18/comments",
"events_url": "https://api.github.com/repos/loganpowell/ac/issues/18/events",
"html_url": "#18",
"id": 567852856,
"node_id": "MDU6SXNzdWU1Njc4NTI4NTY=",
"number": 18,
"title": "What's the ctx object contain bot?",
"user": {
"login": "loganpowell",
"id": 3408191,
"node_id": "MDQ6VXNlcjM0MDgxOTE=",
"avatar_url": "https://avatars1.githubusercontent.com/u/3408191?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/loganpowell",
"html_url": "https://github.com/loganpowell",
"followers_url": "https://api.github.com/users/loganpowell/followers",
"following_url": "https://api.github.com/users/loganpowell/following{/other_user}",
"gists_url": "https://api.github.com/users/loganpowell/gists{/gist_id}",
"starred_url": "https://api.github.com/users/loganpowell/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/loganpowell/subscriptions",
"organizations_url": "https://api.github.com/users/loganpowell/orgs",
"repos_url": "https://api.github.com/users/loganpowell/repos",
"events_url": "https://api.github.com/users/loganpowell/events{/privacy}",
"received_events_url": "https://api.github.com/users/loganpowell/received_events",
"type": "User",
"site_admin": false
},
"labels": [],
"state": "closed",
"locked": false,
"assignee": null,
"assignees": [],
"milestone": null,
"comments": 1,
"created_at": "2020-02-19T21:17:16Z",
"updated_at": "2020-02-24T14:18:38Z",
"closed_at": "2020-02-24T14:18:37Z",
"author_association": "OWNER",
"body": "code:\r\n\r\njs\r\nmodule.exports = app => {\r\n app.log(\"yay, loaded stimula\")\r\n app.on(\"issues.opened\", async ctx => {\r\n const comment = ctx.issue({ body: \"thanks for posting!\" })\r\n const payload = ctx.issue({ body: JSON.stringify(ctx, null, 2) })\r\n return ctx.github.issues.createComment(payload)\r\n })\r\n}\r\n\r\n"
},
"repository": {
"id": 229994333,
"node_id": "MDEwOlJlcG9zaXRvcnkyMjk5OTQzMzM=",
"name": "ac",
"full_name": "loganpowell/ac",
"private": false,
"owner": {
"login": "loganpowell",
"id": 3408191,
"node_id": "MDQ6VXNlcjM0MDgxOTE=",
"avatar_url": "https://avatars1.githubusercontent.com/u/3408191?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/loganpowell",
"html_url": "https://github.com/loganpowell",
"followers_url": "https://api.github.com/users/loganpowell/followers",
"following_url": "https://api.github.com/users/loganpowell/following{/other_user}",
"gists_url": "https://api.github.com/users/loganpowell/gists{/gist_id}",
"starred_url": "https://api.github.com/users/loganpowell/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/loganpowell/subscriptions",
"organizations_url": "https://api.github.com/users/loganpowell/orgs",
"repos_url": "https://api.github.com/users/loganpowell/repos",
"events_url": "https://api.github.com/users/loganpowell/events{/privacy}",
"received_events_url": "https://api.github.com/users/loganpowell/received_events",
"type": "User",
"site_admin": false
},
"html_url": "https://github.com/loganpowell/ac",
"description": null,
"fork": false,
"url": "https://api.github.com/repos/loganpowell/ac",
"forks_url": "https://api.github.com/repos/loganpowell/ac/forks",
"keys_url": "https://api.github.com/repos/loganpowell/ac/keys{/key_id}",
"collaborators_url": "https://api.github.com/repos/loganpowell/ac/collaborators{/collaborator}",
"teams_url": "https://api.github.com/repos/loganpowell/ac/teams",
"hooks_url": "https://api.github.com/repos/loganpowell/ac/hooks",
"issue_events_url": "https://api.github.com/repos/loganpowell/ac/issues/events{/number}",
"events_url": "https://api.github.com/repos/loganpowell/ac/events",
"assignees_url": "https://api.github.com/repos/loganpowell/ac/assignees{/user}",
"branches_url": "https://api.github.com/repos/loganpowell/ac/branches{/branch}",
"tags_url": "https://api.github.com/repos/loganpowell/ac/tags",
"blobs_url": "https://api.github.com/repos/loganpowell/ac/git/blobs{/sha}",
"git_tags_url": "https://api.github.com/repos/loganpowell/ac/git/tags{/sha}",
"git_refs_url": "https://api.github.com/repos/loganpowell/ac/git/refs{/sha}",
"trees_url": "https://api.github.com/repos/loganpowell/ac/git/trees{/sha}",
"statuses_url": "https://api.github.com/repos/loganpowell/ac/statuses/{sha}",
"languages_url": "https://api.github.com/repos/loganpowell/ac/languages",
"stargazers_url": "https://api.github.com/repos/loganpowell/ac/stargazers",
"contributors_url": "https://api.github.com/repos/loganpowell/ac/contributors",
"subscribers_url": "https://api.github.com/repos/loganpowell/ac/subscribers",
"subscription_url": "https://api.github.com/repos/loganpowell/ac/subscription",
"commits_url": "https://api.github.com/repos/loganpowell/ac/commits{/sha}",
"git_commits_url": "https://api.github.com/repos/loganpowell/ac/git/commits{/sha}",
"comments_url": "https://api.github.com/repos/loganpowell/ac/comments{/number}",
"issue_comment_url": "https://api.github.com/repos/loganpowell/ac/issues/comments{/number}",
"contents_url": "https://api.github.com/repos/loganpowell/ac/contents/{+path}",
"compare_url": "https://api.github.com/repos/loganpowell/ac/compare/{base}...{head}",
"merges_url": "https://api.github.com/repos/loganpowell/ac/merges",
"archive_url": "https://api.github.com/repos/loganpowell/ac/{archive_format}{/ref}",
"downloads_url": "https://api.github.com/repos/loganpowell/ac/downloads",
"issues_url": "https://api.github.com/repos/loganpowell/ac/issues{/number}",
"pulls_url": "https://api.github.com/repos/loganpowell/ac/pulls{/number}",
"milestones_url": "https://api.github.com/repos/loganpowell/ac/milestones{/number}",
"notifications_url": "https://api.github.com/repos/loganpowell/ac/notifications{?since,all,participating}",
"labels_url": "https://api.github.com/repos/loganpowell/ac/labels{/name}",
"releases_url": "https://api.github.com/repos/loganpowell/ac/releases{/id}",
"deployments_url": "https://api.github.com/repos/loganpowell/ac/deployments",
"created_at": "2019-12-24T19:25:07Z",
"updated_at": "2020-02-09T07:17:14Z",
"pushed_at": "2020-02-09T07:17:12Z",
"git_url": "git://github.com/loganpowell/ac.git",
"ssh_url": "git@github.com:loganpowell/ac.git",
"clone_url": "https://github.com/loganpowell/ac.git",
"svn_url": "https://github.com/loganpowell/ac",
"homepage": "https://loganpowell.github.io/ac",
"size": 9914,
"stargazers_count": 1,
"watchers_count": 1,
"language": "JavaScript",
"has_issues": true,
"has_projects": true,
"has_downloads": true,
"has_wiki": true,
"has_pages": true,
"forks_count": 0,
"mirror_url": null,
"archived": false,
"disabled": false,
"open_issues_count": 4,
"license": null,
"forks": 0,
"open_issues": 4,
"watchers": 1,
"default_branch": "master"
},
"sender": {
"login": "loganpowell",
"id": 3408191,
"node_id": "MDQ6VXNlcjM0MDgxOTE=",
"avatar_url": "https://avatars1.githubusercontent.com/u/3408191?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/loganpowell",
"html_url": "https://github.com/loganpowell",
"followers_url": "https://api.github.com/users/loganpowell/followers",
"following_url": "https://api.github.com/users/loganpowell/following{/other_user}",
"gists_url": "https://api.github.com/users/loganpowell/gists{/gist_id}",
"starred_url": "https://api.github.com/users/loganpowell/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/loganpowell/subscriptions",
"organizations_url": "https://api.github.com/users/loganpowell/orgs",
"repos_url": "https://api.github.com/users/loganpowell/repos",
"events_url": "https://api.github.com/users/loganpowell/events{/privacy}",
"received_events_url": "https://api.github.com/users/loganpowell/received_events",
"type": "User",
"site_admin": false
},
"installation": {
"id": 6879711,
"node_id": "MDIzOkludGVncmF0aW9uSW5zdGFsbGF0aW9uNjg3OTcxMQ=="
}
},
"github": {
"log": {},
"actions": {},
"activity": {},
"apps": {},
"checks": {},
"codesOfConduct": {},
"emojis": {},
"gists": {},
"git": {},
"gitignore": {},
"interactions": {},
"issues": {},
"licenses": {},
"markdown": {},
"meta": {},
"migrations": {},
"oauthAuthorizations": {},
"orgs": {},
"projects": {},
"pulls": {},
"rateLimit": {},
"reactions": {},
"repos": {},
"search": {},
"teams": {},
"users": {},
"retry": {}
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant