Skip to content

Commit

Permalink
chore: instance usage test
Browse files Browse the repository at this point in the history
  • Loading branch information
Keyrxng committed Oct 4, 2024
1 parent c611a2e commit 444ec72
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
5 changes: 1 addition & 4 deletions src/bot/mtproto-api/workrooms/create-chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,7 @@ export async function createChat(context: Context<"issues.labeled", SupportedEve

if ("link" in inviteLink) {
link = inviteLink.link;
await addCommentToIssue({
...context,
octokit: await context.adapters.github.getStorageOctokit(),
}, `A new workroom has been created for this task. [Join chat](${link})`, owner, repo, payload.issue.number);
await addCommentToIssue(context, `A new workroom has been created for this task. [Join chat](${link})`, owner, repo, payload.issue.number);
} else {
throw new Error(logger.error(`Failed to create chat invite link for the workroom: ${chatName}`).logMessage.raw);
}
Expand Down
3 changes: 2 additions & 1 deletion src/types/plugin-context-single.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export class PluginContext {
}

getContext(): Context {
const octokit: Context["octokit"] = this.getStorageApp()?.octokit ?? new Octokit({ auth: this.inputs.authToken });
const octokit: Context["octokit"] = new Octokit({ auth: this.inputs.authToken });

if (!octokit) {
throw new Error("Octokit could not be initialized");
Expand All @@ -71,6 +71,7 @@ export class PluginContext {
env: this.env,
logger: new Logs("verbose"),
} as Context;

return {
...ctx,
adapters: createAdapters(ctx),
Expand Down

0 comments on commit 444ec72

Please sign in to comment.