Merge branch 'main' of ssh://git.0xfffe.org/frostbide/frostbot
This commit is contained in:
@@ -21,10 +21,18 @@ module.exports = {
|
||||
);
|
||||
|
||||
const embed = new EmbedBuilder()
|
||||
.setTitle(`<@${user.id}>'s Invite Count`)
|
||||
.setTitle(`Invite info for @${user.username}`)
|
||||
.setColor(0x009bc2)
|
||||
.setDescription(
|
||||
'Invites: ' + (invites ?? 'No invites found for this user.')
|
||||
.addFields(
|
||||
{
|
||||
name: 'Invites created',
|
||||
value: `${invites.length}`,
|
||||
inline: true,
|
||||
},
|
||||
{
|
||||
name: 'Total uses',
|
||||
value: `${invites.reduce((acc, invite) => parseInt(acc) + parseInt(invite.uses), 0)}`,
|
||||
}
|
||||
)
|
||||
.setTimestamp();
|
||||
|
||||
|
||||
@@ -124,12 +124,12 @@ function main(ctx) {
|
||||
},
|
||||
async getUserInvites(guildId, userId) {
|
||||
const result = await database.db.query(
|
||||
`SELECT SUM(uses) AS total_uses
|
||||
`SELECT uses, invite
|
||||
FROM inviteCount
|
||||
WHERE serverid = $1 AND userid = $2`,
|
||||
[guildId, userId]
|
||||
);
|
||||
return result.rows?.[0]?.total_uses || 0;
|
||||
return result.rows;
|
||||
},
|
||||
|
||||
async getUserLeaderboard(guildId, amount = 10) {
|
||||
|
||||
Reference in New Issue
Block a user