mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-08 06:03:04 -04:00
fix fetching users with old ids
This commit is contained in:
parent
c549cceeec
commit
ce127c8782
3 changed files with 7 additions and 7 deletions
|
@ -33,7 +33,7 @@ module.exports = {
|
||||||
const g = context.guild
|
const g = context.guild
|
||||||
// Guild Card
|
// Guild Card
|
||||||
let guildCard = createEmbed("default", context, {
|
let guildCard = createEmbed("default", context, {
|
||||||
description: `${icon("house")} **${g.name}** ${highlight(`(${g.id})`)}\n\n${icon("calendar")} **Created at: **${timestamp(g.createdAt)}\n\n<:lc_guild_owner:674652779406426122> **Server Owner: **<@${g.owner.id}>`,
|
description: `${icon("house")} **${g.name}** ${highlight(`(${g.id})`)}\n\n${icon("calendar")} **Created at: **${timestamp(g.createdAt, "f")}\n\n<:lc_guild_owner:674652779406426122> **Server Owner: **<@${g.owner.id}>`,
|
||||||
thumbnail: {
|
thumbnail: {
|
||||||
url: g.iconUrl + `?size=4096`
|
url: g.iconUrl + `?size=4096`
|
||||||
},
|
},
|
||||||
|
|
|
@ -40,7 +40,7 @@ module.exports = {
|
||||||
},
|
},
|
||||||
fields: [{
|
fields: [{
|
||||||
name: `${icon("calendar")} Dates`,
|
name: `${icon("calendar")} Dates`,
|
||||||
value: `**Account Created: **${timestamp(u.createdAt)}`,
|
value: `**Account Created: **${timestamp(u.createdAt, "f")}`,
|
||||||
inline: false
|
inline: false
|
||||||
}]
|
}]
|
||||||
})
|
})
|
||||||
|
@ -48,7 +48,7 @@ module.exports = {
|
||||||
|
|
||||||
// Guild Container
|
// Guild Container
|
||||||
if(m){
|
if(m){
|
||||||
userCard.fields[0].value = userCard.fields[0].value + `\n**Joined Guild: **${timestamp(m.joinedAt)}`
|
userCard.fields[0].value = userCard.fields[0].value + `\n**Joined Guild: **${timestamp(m.joinedAt, "f")}`
|
||||||
let guildFields = []
|
let guildFields = []
|
||||||
|
|
||||||
// TODO: make this an icon()
|
// TODO: make this an icon()
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
async function getUser(context, query){
|
async function getUser(context, query){
|
||||||
let user;
|
let user;
|
||||||
let member;
|
let member;
|
||||||
if(/[0-9]{18}/.test(query)){
|
if(/[0-9]{17,18}/.test(query)){
|
||||||
let uid = query.match(/[0-9]{18}/)
|
let uid = query.match(/[0-9]{17,18}/)
|
||||||
try{
|
try{
|
||||||
user = await context.client.rest.fetchUser(uid)
|
user = await context.client.rest.fetchUser(uid)
|
||||||
if(context.guild) member = await getMember(context, user.id)
|
if(context.guild) member = await getMember(context, user.id)
|
||||||
|
@ -18,8 +18,8 @@ async function getUser(context, query){
|
||||||
|
|
||||||
async function getMember(context, query){
|
async function getMember(context, query){
|
||||||
if(!context.guild) return;
|
if(!context.guild) return;
|
||||||
if(/[0-9]{18}/.test(query)){
|
if(/[0-9]{17,18}/.test(query)){
|
||||||
let uid = query.match(/[0-9]{18}/)
|
let uid = query.match(/[0-9]{17,18}/)
|
||||||
try{
|
try{
|
||||||
member = await context.guild.fetchMember(uid)
|
member = await context.guild.fetchMember(uid)
|
||||||
return member;
|
return member;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue