mirror of
https://github.com/veganhacktivists/arabot.git
synced 2025-05-19 04:24:14 +02:00
feat(arabot): add log to log channel for payments
This commit is contained in:
parent
d3594be3ef
commit
857319e136
@ -21,7 +21,8 @@ import { Args, Command, RegisterBehavior } from '@sapphire/framework';
|
|||||||
import type { User, Guild, Message } from 'discord.js';
|
import type { User, Guild, Message } from 'discord.js';
|
||||||
import { updateUser } from '#utils/database/dbExistingUser';
|
import { updateUser } from '#utils/database/dbExistingUser';
|
||||||
import { getBalance, transfer } from '#utils/database/economy';
|
import { getBalance, transfer } from '#utils/database/economy';
|
||||||
import { EmbedBuilder } from 'discord.js';
|
import { EmbedBuilder, TextChannel } from 'discord.js';
|
||||||
|
import IDs from '#utils/ids';
|
||||||
|
|
||||||
export class BalanceCommand extends Command {
|
export class BalanceCommand extends Command {
|
||||||
public constructor(context: Command.Context, options: Command.Options) {
|
public constructor(context: Command.Context, options: Command.Options) {
|
||||||
@ -176,6 +177,24 @@ export class BalanceCommand extends Command {
|
|||||||
|
|
||||||
info.success = true;
|
info.success = true;
|
||||||
info.embeds.push(embed);
|
info.embeds.push(embed);
|
||||||
|
|
||||||
|
// Log the payment in the server
|
||||||
|
let logChannel = guild.channels.cache
|
||||||
|
.get(IDs.channels.logs.economy) as TextChannel | undefined;
|
||||||
|
|
||||||
|
if (logChannel === undefined) {
|
||||||
|
logChannel = await guild.channels
|
||||||
|
.fetch(IDs.channels.logs.economy) as TextChannel | undefined;
|
||||||
|
if (logChannel === undefined) {
|
||||||
|
this.container.logger.error('Pay Error: Could not fetch log channel');
|
||||||
|
return info;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
embed
|
||||||
|
.setTimestamp()
|
||||||
|
.setFooter({ text: `ID: ${user.id}` });
|
||||||
|
await logChannel.send({ embeds: [embed] });
|
||||||
return info;
|
return info;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -118,6 +118,7 @@ const devIDs = {
|
|||||||
},
|
},
|
||||||
logs: {
|
logs: {
|
||||||
restricted: '999431681217937513',
|
restricted: '999431681217937513',
|
||||||
|
economy: '999431681599623198',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
categories: {
|
categories: {
|
||||||
|
@ -121,6 +121,7 @@ let IDs = {
|
|||||||
},
|
},
|
||||||
logs: {
|
logs: {
|
||||||
restricted: '920993034462715925',
|
restricted: '920993034462715925',
|
||||||
|
economy: '932050015034159174',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
categories: {
|
categories: {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user