v3.5.4 push 1
This commit is contained in:
+1
-1
@@ -427,7 +427,7 @@ exports.checker = async () => {
|
||||
checkType(config.languageFile,"string","languagefile")
|
||||
const lf = config.languageFile
|
||||
|
||||
if (!lf.startsWith("custom") && !lf.startsWith("english") && !lf.startsWith("dutch") && !lf.startsWith("romanian") && !lf.startsWith("german") && !lf.startsWith("arabic") && !lf.startsWith("spanish") && !lf.startsWith("portuguese") && !lf.startsWith("french") && !lf.startsWith("italian") && !lf.startsWith("czech") && !lf.startsWith("danish") && !lf.startsWith("russian") && !lf.startsWith("turkish") && !lf.startsWith("polish") && !lf.startsWith("slovenian") && !lf.startsWith("thai") && !lf.startsWith("norwegian") && !lf.startsWith("greek") && !lf.startsWith("ukrainian") && !lf.startsWith("hungarian") && !lf.startsWith("indonesian")){
|
||||
if (!lf.startsWith("custom") && !lf.startsWith("english") && !lf.startsWith("dutch") && !lf.startsWith("romanian") && !lf.startsWith("german") && !lf.startsWith("arabic") && !lf.startsWith("spanish") && !lf.startsWith("portuguese") && !lf.startsWith("french") && !lf.startsWith("italian") && !lf.startsWith("czech") && !lf.startsWith("danish") && !lf.startsWith("russian") && !lf.startsWith("turkish") && !lf.startsWith("polish") && !lf.startsWith("slovenian") && !lf.startsWith("thai") && !lf.startsWith("norwegian") && !lf.startsWith("greek") && !lf.startsWith("ukrainian") && !lf.startsWith("hungarian") && !lf.startsWith("indonesian") && !lf.startsWith("kurdish")){
|
||||
createError("'languagefile' | invalid language, more info in the wiki")
|
||||
}
|
||||
|
||||
|
||||
@@ -220,7 +220,7 @@ const getTicketStats = async (guild,channelid) => {
|
||||
/**@type {TextChannel|undefined} */
|
||||
const channel = guild.channels.cache.find((c) => c.id == channelid)
|
||||
const messageAmount = (channel) ? (await getmessages(channel,5000)).length : 0
|
||||
const participants = (channel) ? channel.members.map((m) => m.user.username) : []
|
||||
const participants = (channel) ? channel.members.map((m) => "<@"+m.user.id+">") : []
|
||||
|
||||
//saved data
|
||||
const createdAt = getStats("ticket","CREATED_AT",channelid)
|
||||
@@ -228,7 +228,7 @@ const getTicketStats = async (guild,channelid) => {
|
||||
|
||||
const TEMPcreatedBy = getStats("ticket","CREATED_BY",channelid)
|
||||
const TEMPcreatedByUser = (TEMPcreatedBy) ? guild.members.cache.find((m) => m.id == TEMPcreatedBy) : undefined
|
||||
const createdBy = (TEMPcreatedByUser) ? TEMPcreatedByUser.user.username : "an unknown person 😄"
|
||||
const createdBy = (TEMPcreatedByUser) ? "<@"+TEMPcreatedByUser.user.id+">" : "an unknown person 😄"
|
||||
|
||||
return {
|
||||
createdAt: (typeof createdAt == "undefined") ? new Date().getTime() : createdAt,
|
||||
@@ -316,7 +316,7 @@ const createTicketStatsEmbed = async (guild,channelid) => {
|
||||
|
||||
const sentences = [
|
||||
`${l.stats.ticketCreatedOn}: <t:${Math.round(stats.createdAt/1000)}:f>`,
|
||||
`${l.stats.ticketCreatedBy}: \`${stats.createdBy}\``,
|
||||
`${l.stats.ticketCreatedBy}: ${stats.createdBy}`,
|
||||
`${l.stats.messagesSent}: \`${stats.messageAmount}\``,
|
||||
`${l.stats.status}: ${newStatus}`
|
||||
]
|
||||
|
||||
@@ -34,17 +34,19 @@ exports.beingprocessed = (name,id,rawprocesstime,user) => {
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {String} name
|
||||
* @param {String} id
|
||||
* @param {String} url
|
||||
* @param {discord.User} user
|
||||
* @param {String} name channel name
|
||||
* @param {String} url transcript url
|
||||
* @param {discord.User} user transcript closer
|
||||
* @param {discord.User} creator transcript creator
|
||||
*/
|
||||
exports.tsready = (name,id,url,user) => {
|
||||
exports.tsready = (name,url,user,creator) => {
|
||||
const embed = new discord.EmbedBuilder()
|
||||
.setTitle("🧾 "+l.transcripts.title)
|
||||
.setColor(config.color)
|
||||
.setAuthor({name:user.username,iconURL:user.displayAvatarURL()})
|
||||
.setFooter({text:name})
|
||||
|
||||
if (creator) embed.setFields([{name:"Ticket Creator", value:"<@"+creator.id+">"}])
|
||||
|
||||
if (url){
|
||||
embed.setURL(url)
|
||||
|
||||
@@ -114,7 +114,7 @@ module.exports = async (messages,guild,channel,user,reason) => {
|
||||
tc.send({embeds:[errembed],files:[attachment]})
|
||||
}
|
||||
if (tsconfig.sendTranscripts.enableDM && user){
|
||||
const embed = tsembeds.tsready(chName,chId,null,user)
|
||||
const embed = tsembeds.tsready(chName,null,user,ticketopener)
|
||||
try {
|
||||
ticketopener.send({embeds:[embed],files:[attachment]})
|
||||
}catch{}
|
||||
@@ -151,12 +151,12 @@ module.exports = async (messages,guild,channel,user,reason) => {
|
||||
//ready
|
||||
setTimeout(() => {
|
||||
if (msg){
|
||||
msg.edit({embeds:[tsembeds.tsready(chName,chId,url,user)]})
|
||||
msg.edit({embeds:[tsembeds.tsready(chName,url,user,ticketopener)]})
|
||||
}
|
||||
|
||||
if (tsconfig.sendTranscripts.enableDM){
|
||||
if (!user) return
|
||||
const embed = tsembeds.tsready(chName,chId,url,user)
|
||||
const embed = tsembeds.tsready(chName,url,user,ticketopener)
|
||||
try {
|
||||
ticketopener.send({embeds:[embed]})
|
||||
}catch{}
|
||||
@@ -174,7 +174,7 @@ module.exports = async (messages,guild,channel,user,reason) => {
|
||||
tc.send({embeds:[errembed],files:[attachment]})
|
||||
}
|
||||
if (tsconfig.sendTranscripts.enableDM && user){
|
||||
const embed = tsembeds.tsready(chName,chId,null,user)
|
||||
const embed = tsembeds.tsready(chName,null,user,ticketopener)
|
||||
try {
|
||||
ticketopener.send({embeds:[embed],files:[attachment]})
|
||||
}catch{}
|
||||
@@ -182,7 +182,7 @@ module.exports = async (messages,guild,channel,user,reason) => {
|
||||
}
|
||||
}else{
|
||||
const attachment = await require("./oldTranscript").createTranscript(messages,channel)
|
||||
const embed = tsembeds.tsready(chName,chId,false,user)
|
||||
const embed = tsembeds.tsready(chName,null,user,ticketopener)
|
||||
|
||||
if (tsconfig.sendTranscripts.enableChannel){
|
||||
/**@type {discord.TextChannel|undefined} */
|
||||
@@ -192,7 +192,7 @@ module.exports = async (messages,guild,channel,user,reason) => {
|
||||
tc.send({embeds:[embed],files:[attachment]})
|
||||
}
|
||||
if (tsconfig.sendTranscripts.enableDM && user){
|
||||
const embed = tsembeds.tsready(chName,chId,null,user)
|
||||
const embed = tsembeds.tsready(chName,null,user,ticketopener)
|
||||
try {
|
||||
ticketopener.send({embeds:[embed],files:[attachment]})
|
||||
}catch{}
|
||||
|
||||
Reference in New Issue
Block a user