Compare commits

..

2 commits

Author SHA1 Message Date
12289bbee9 utils: fix missed request handler calls 2023-03-06 18:21:57 -07:00
f52f14d3a3 bump dysnomia 2023-03-06 18:17:53 -07:00
2 changed files with 30 additions and 16 deletions

View file

@ -17,7 +17,7 @@ specifiers:
dependencies: dependencies:
'@ctrl/tinycolor': 3.4.1 '@ctrl/tinycolor': 3.4.1
'@projectdysnomia/dysnomia': github.com/projectdysnomia/dysnomia/0df1369a822dba8851c667b22d5bac34f4e849e6 '@projectdysnomia/dysnomia': github.com/projectdysnomia/dysnomia/10021c901a6114c967cd604579cbd4876d2bcbd7
better-ytdl-core: 1.0.1 better-ytdl-core: 1.0.1
dumpy: github.com/Cynosphere/dumpy.js/5fc22353cdcb97084bab572266390e780d9f7a7b dumpy: github.com/Cynosphere/dumpy.js/5fc22353cdcb97084bab572266390e780d9f7a7b
google-images: 2.1.0 google-images: 2.1.0
@ -2437,11 +2437,31 @@ packages:
- encoding - encoding
dev: false dev: false
github.com/projectdysnomia/dysnomia/0df1369a822dba8851c667b22d5bac34f4e849e6: github.com/projectdysnomia/dysnomia/10021c901a6114c967cd604579cbd4876d2bcbd7:
resolution: {tarball: https://codeload.github.com/projectdysnomia/dysnomia/tar.gz/0df1369a822dba8851c667b22d5bac34f4e849e6} resolution: {tarball: https://codeload.github.com/projectdysnomia/dysnomia/tar.gz/10021c901a6114c967cd604579cbd4876d2bcbd7}
name: '@projectdysnomia/dysnomia' name: '@projectdysnomia/dysnomia'
version: 0.1.0-dev version: 0.2.0-dev
engines: {node: '>=10.4.0'} engines: {node: '>=10.4.0'}
peerDependencies:
'@discordjs/opus': ^0.9.0
erlpack: github:discord/erlpack || github:abalabahaha/erlpack
eventemitter3: ^5.0.0
pako: ^2.1.0
sodium-native: ^4.0.1
zlib-sync: ^0.1.8
peerDependenciesMeta:
'@discordjs/opus':
optional: true
erlpack:
optional: true
eventemitter3:
optional: true
pako:
optional: true
sodium-native:
optional: true
zlib-sync:
optional: true
dependencies: dependencies:
ws: 8.12.0 ws: 8.12.0
optionalDependencies: optionalDependencies:

View file

@ -113,10 +113,7 @@ async function getImage(msg, str) {
return `https://cdn.discordapp.com/emojis/${id}.png?v=1`; return `https://cdn.discordapp.com/emojis/${id}.png?v=1`;
} else if (/<@!?([0-9]*)>/.test(refMsg.content)) { } else if (/<@!?([0-9]*)>/.test(refMsg.content)) {
const id = refMsg.content.match(/<@!?([0-9]*)>/)[1]; const id = refMsg.content.match(/<@!?([0-9]*)>/)[1];
const user = await hf.bot.rest.authRequest({ const user = await hf.bot.requestHandler.request("GET", "/users/" + id);
method: "GET",
path: "/users/" + id,
});
if (user) if (user)
return `https://cdn.discordapp.com/avatars/${id}/${user.avatar}.png?size=1024`; return `https://cdn.discordapp.com/avatars/${id}/${user.avatar}.png?size=1024`;
} }
@ -136,10 +133,7 @@ async function getImage(msg, str) {
return `https://cdn.discordapp.com/emojis/${id}.png?v=1`; return `https://cdn.discordapp.com/emojis/${id}.png?v=1`;
} else if (/<@!?([0-9]*)>/.test(str)) { } else if (/<@!?([0-9]*)>/.test(str)) {
const id = str.match(/<@!?([0-9]*)>/)[1]; const id = str.match(/<@!?([0-9]*)>/)[1];
const user = await hf.bot.rest.authRequest({ const user = await hf.bot.requestHandler.request("GET", "/users/" + id);
method: "GET",
path: "/users/" + id,
});
if (user) if (user)
return `https://cdn.discordapp.com/avatars/${id}/${user.avatar}.png?size=1024`; return `https://cdn.discordapp.com/avatars/${id}/${user.avatar}.png?size=1024`;
} else if (img) { } else if (img) {
@ -277,10 +271,10 @@ async function selectionMessage(
async function lookupUser(msg, str, filter) { async function lookupUser(msg, str, filter) {
if (/[0-9]{17,21}/.test(str)) { if (/[0-9]{17,21}/.test(str)) {
return await hf.bot.rest.authRequest({ return await hf.bot.requestHandler.request(
method: "GET", "GET",
path: "/users/" + str.match(/([0-9]{17,21})/)[1], "/users/" + str.match(/([0-9]{17,21})/)[1]
}); );
} }
let users; let users;