mirror of
https://github.com/Hessenuk/DiscordTickets.git
synced 2024-12-23 00:03:09 +02:00
Made it so the bot dm's the creator and logs it in an logging channel
This commit is contained in:
parent
9b4dcdee51
commit
390bec85c8
@ -126,6 +126,12 @@ module.exports = {
|
|||||||
let u = await client.users.fetch(ticket.creator);
|
let u = await client.users.fetch(ticket.creator);
|
||||||
|
|
||||||
if (u) {
|
if (u) {
|
||||||
|
let dm;
|
||||||
|
try {
|
||||||
|
dm = u.dmChannel || await u.createDM();
|
||||||
|
} catch (e) {
|
||||||
|
log.warn(`Could not create DM channel with ${u.tag}`);
|
||||||
|
}
|
||||||
const archive = client.channels.cache.find(ch => ch.id === "")
|
const archive = client.channels.cache.find(ch => ch.id === "")
|
||||||
|
|
||||||
let res = {};
|
let res = {};
|
||||||
@ -158,6 +164,7 @@ module.exports = {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
archive.send(res)
|
archive.send(res)
|
||||||
|
dm.send(res)
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
message.channel.send('❌ Couldn\'t send to Logging Channel.');
|
message.channel.send('❌ Couldn\'t send to Logging Channel.');
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user