mirror of
https://github.com/qwerinope/qweribot.git
synced 2025-12-19 08:41:39 +01:00
rework auth (i'm an idiot), add whisper commands, change whispercmds, back to webhook
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { redis } from "lib/redis";
|
||||
import { chatterApi } from "index";
|
||||
import { api } from "index";
|
||||
import { HelixUser } from "@twurple/api"
|
||||
import logger from "lib/logger";
|
||||
|
||||
@@ -27,7 +27,7 @@ export default class User {
|
||||
userObj.username = username;
|
||||
const userid = await redis.get(`userlookup:${username}`);
|
||||
if (!userid) {
|
||||
const userdata = await chatterApi.users.getUserByName(username);
|
||||
const userdata = await api.users.getUserByName(username);
|
||||
if (!userdata) return null;
|
||||
userObj._setCache(userdata);
|
||||
userObj.id = userdata.id;
|
||||
@@ -50,7 +50,7 @@ export default class User {
|
||||
const userObj = new User();
|
||||
userObj.id = userId;
|
||||
if (!await redis.exists(`user:${userId}:displayName`)) {
|
||||
const userdata = await chatterApi.users.getUserById(userId);
|
||||
const userdata = await api.users.getUserById(userId);
|
||||
if (!userdata) return null;
|
||||
userObj._setCache(userdata);
|
||||
userObj.username = userdata.name;
|
||||
|
||||
Reference in New Issue
Block a user