Skip to content

Commit

Permalink
update to work with API 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Amelixx committed May 4, 2022
1 parent 0e47497 commit 5e5f89b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@amelix/phoenix.js",
"version": "1.0.2",
"version": "1.0.3",
"description": "A feature-rich API wrapper for the critically acclaimed chatting app Phoenix.. or something.",
"main": "lib/index.js",
"types": "lib/index.d.ts",
Expand Down
4 changes: 2 additions & 2 deletions src/classes/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export class Client extends EventEmitter {

private connect() {
const socketOptions: { [k: string]: any; } = {};
socketOptions.query = { token: "Bearer " + this.token };
socketOptions.query = { token: this.token };

this.socket = io("https://" + hostname, socketOptions);

Expand Down Expand Up @@ -327,7 +327,7 @@ export class Client extends EventEmitter {
async request<T=any>(method="GET", path:string, headers:{[k: string]: string}={}, write?:any): Promise<PhoenixResponse<T>> {
if (typeof write === "object") write = JSON.stringify(write);

headers.auth = "Bearer " + this.token
headers.authorization = this.token

return new Promise((resolve, reject) => {
const req = https.request({
Expand Down
2 changes: 1 addition & 1 deletion src/config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const hostname = "phoenix.amelix.xyz"
export const hostname = "api.phoenix.amelix.xyz"
export const apiPath = ""
export const defaultIcon = 'https://' + hostname + '/avatars/default'
export const messageQueryLimit = 150

0 comments on commit 5e5f89b

Please sign in to comment.