Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions src/class/push.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Context, { getEvent, getUserData, octokit, token } from "../index";
import Context, { GetEvent, GetUserData, octokit, token } from "../index";

/**
* @class
Expand Down Expand Up @@ -34,7 +34,7 @@ export default class Push {
* @returns {Promise<void>}
*/
async function userActivity(): Promise<void> {
const arrayActivity: getUserData = { "userData": [] };
const arrayActivity: GetUserData = { "userData": [] };
await fetch("https://api.github.com/users/Muunatic/events/public", {
method: "GET",
headers: {
Expand All @@ -44,7 +44,7 @@ export default class Push {
}
}).then((res: Response) => {
return res.json();
}).then((res: [getEvent]) => {
}).then((res: [GetEvent]) => {
let i: number;
for (i = 0; i < res.length; i++) {
if (res[i].type === "PushEvent") {
Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Octokit } from "octokit";
import { createAppAuth } from "@octokit/auth-app";
import { token } from "./data/config";
import { IssuesClose, IssuesComment, IssuesOpen, PRsStale, PullRequestOpen, PullRequestReview, PullRequestSynchronize, Push, WorkflowCheck } from "./structures/constant";
import { getEvent, getUserData } from "./structures/type";
import { GetEvent, GetUserData } from "./structures/type";
import "./structures/listener";
import dotenv from "dotenv";
dotenv.config();
Expand Down Expand Up @@ -114,4 +114,4 @@ setInterval(() => {

export default Context;
export { octokit, token };
export type { getEvent, getUserData };
export type { GetEvent, GetUserData };
8 changes: 4 additions & 4 deletions src/structures/type.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
export type getUserData = {
userData: userDataInterface[];
export type GetUserData = {
userData: UserDataInterface[];
}

type userDataInterface = {
type UserDataInterface = {
event: string;
}

export type getEvent = {
export type GetEvent = {
id: string;
type: string;

Expand Down