(v4.2) Open Discord Framework Update (Part 2)
Replaced all "Default" classes & types with ID mappings & improved types. Updated Interactive Setup CLI & certain events, renamed ODStat's to ODStatistics. Moved many classes, types & interfaces to the framework
This commit is contained in:
@@ -22,8 +22,8 @@ export const registerActions = async () => {
|
||||
ticket.get("opendiscord:busy").value = true
|
||||
|
||||
//update stats
|
||||
await opendiscord.stats.get("opendiscord:global").setStat("opendiscord:tickets-claimed",1,"increase")
|
||||
await opendiscord.stats.get("opendiscord:user").setStat("opendiscord:tickets-claimed",user.id,1,"increase")
|
||||
await opendiscord.statistics.get("opendiscord:global").setStat("opendiscord:tickets-claimed",1,"increase")
|
||||
await opendiscord.statistics.get("opendiscord:user").setStat("opendiscord:tickets-claimed",user.id,1,"increase")
|
||||
|
||||
//update category
|
||||
if (typeof params.allowCategoryChange == "boolean" ? params.allowCategoryChange : true){
|
||||
|
||||
@@ -30,8 +30,8 @@ export const registerActions = async () => {
|
||||
ticket.get("opendiscord:busy").value = true
|
||||
|
||||
//update stats
|
||||
await opendiscord.stats.get("opendiscord:global").setStat("opendiscord:tickets-closed",1,"increase")
|
||||
await opendiscord.stats.get("opendiscord:user").setStat("opendiscord:tickets-closed",user.id,1,"increase")
|
||||
await opendiscord.statistics.get("opendiscord:global").setStat("opendiscord:tickets-closed",1,"increase")
|
||||
await opendiscord.statistics.get("opendiscord:user").setStat("opendiscord:tickets-closed",user.id,1,"increase")
|
||||
|
||||
//update category
|
||||
if (typeof params.allowCategoryChange == "boolean" ? params.allowCategoryChange : true){
|
||||
|
||||
@@ -184,8 +184,8 @@ export const registerActions = async () => {
|
||||
])
|
||||
|
||||
//manage stats
|
||||
await opendiscord.stats.get("opendiscord:global").setStat("opendiscord:tickets-created",1,"increase")
|
||||
await opendiscord.stats.get("opendiscord:user").setStat("opendiscord:tickets-created",user.id,1,"increase")
|
||||
await opendiscord.statistics.get("opendiscord:global").setStat("opendiscord:tickets-created",1,"increase")
|
||||
await opendiscord.statistics.get("opendiscord:user").setStat("opendiscord:tickets-created",user.id,1,"increase")
|
||||
|
||||
//manage bot permissions
|
||||
await opendiscord.events.get("onTicketPermissionsCreated").emit([option,opendiscord.permissions,channel,user])
|
||||
@@ -215,7 +215,7 @@ export const registerActions = async () => {
|
||||
if (generalConfig.data.system.pinFirstTicketMessage && msg.pinnable) await msg.pin("Ticket Message")
|
||||
|
||||
//manage stats
|
||||
await opendiscord.stats.get("opendiscord:ticket").setStat("opendiscord:messages-sent",ticket.id.value,1,"increase")
|
||||
await opendiscord.statistics.get("opendiscord:ticket").setStat("opendiscord:messages-sent",ticket.id.value,1,"increase")
|
||||
|
||||
await opendiscord.events.get("afterTicketMainMessageCreated").emit([ticket,msg,channel,user])
|
||||
}catch(err){
|
||||
|
||||
@@ -149,8 +149,8 @@ export const registerActions = async () => {
|
||||
})
|
||||
|
||||
//update stats
|
||||
await opendiscord.stats.get("opendiscord:global").setStat("opendiscord:transcripts-created",1,"increase")
|
||||
await opendiscord.stats.get("opendiscord:user").setStat("opendiscord:transcripts-created",params.user.id,1,"increase")
|
||||
await opendiscord.statistics.get("opendiscord:global").setStat("opendiscord:transcripts-created",1,"increase")
|
||||
await opendiscord.statistics.get("opendiscord:user").setStat("opendiscord:transcripts-created",params.user.id,1,"increase")
|
||||
await opendiscord.events.get("afterTranscriptCreated").emit([opendiscord.transcripts,instance.result.ticket,instance.result.channel,instance.result.user])
|
||||
}),
|
||||
new api.ODWorker("opendiscord:logs",0,(instance,params,source,cancel) => {
|
||||
|
||||
@@ -59,8 +59,8 @@ export const registerActions = async () => {
|
||||
}
|
||||
|
||||
//update stats
|
||||
await opendiscord.stats.get("opendiscord:global").setStat("opendiscord:tickets-deleted",1,"increase")
|
||||
await opendiscord.stats.get("opendiscord:user").setStat("opendiscord:tickets-deleted",user.id,1,"increase")
|
||||
await opendiscord.statistics.get("opendiscord:global").setStat("opendiscord:tickets-deleted",1,"increase")
|
||||
await opendiscord.statistics.get("opendiscord:user").setStat("opendiscord:tickets-deleted",user.id,1,"increase")
|
||||
|
||||
//delete ticket from manager
|
||||
opendiscord.tickets.remove(ticket.id)
|
||||
|
||||
@@ -17,8 +17,8 @@ export const registerActions = async () => {
|
||||
ticket.option = data
|
||||
|
||||
//update stats
|
||||
await opendiscord.stats.get("opendiscord:global").setStat("opendiscord:tickets-moved",1,"increase")
|
||||
await opendiscord.stats.get("opendiscord:user").setStat("opendiscord:tickets-moved",user.id,1,"increase")
|
||||
await opendiscord.statistics.get("opendiscord:global").setStat("opendiscord:tickets-moved",1,"increase")
|
||||
await opendiscord.statistics.get("opendiscord:user").setStat("opendiscord:tickets-moved",user.id,1,"increase")
|
||||
|
||||
//get new channel properties
|
||||
const channelPrefix = ticket.option.get("opendiscord:channel-prefix").value
|
||||
|
||||
@@ -22,8 +22,8 @@ export const registerActions = async () => {
|
||||
ticket.get("opendiscord:busy").value = true
|
||||
|
||||
//update stats
|
||||
await opendiscord.stats.get("opendiscord:global").setStat("opendiscord:tickets-pinned",1,"increase")
|
||||
await opendiscord.stats.get("opendiscord:user").setStat("opendiscord:tickets-pinned",user.id,1,"increase")
|
||||
await opendiscord.statistics.get("opendiscord:global").setStat("opendiscord:tickets-pinned",1,"increase")
|
||||
await opendiscord.statistics.get("opendiscord:user").setStat("opendiscord:tickets-pinned",user.id,1,"increase")
|
||||
|
||||
//move to top of category
|
||||
if (channel.parent){
|
||||
|
||||
@@ -35,8 +35,8 @@ export const registerActions = async () => {
|
||||
}
|
||||
|
||||
//update stats
|
||||
await opendiscord.stats.get("opendiscord:global").setStat("opendiscord:tickets-reopened",1,"increase")
|
||||
await opendiscord.stats.get("opendiscord:user").setStat("opendiscord:tickets-reopened",user.id,1,"increase")
|
||||
await opendiscord.statistics.get("opendiscord:global").setStat("opendiscord:tickets-reopened",1,"increase")
|
||||
await opendiscord.statistics.get("opendiscord:user").setStat("opendiscord:tickets-reopened",user.id,1,"increase")
|
||||
|
||||
//update category
|
||||
if (typeof params.allowCategoryChange == "boolean" ? params.allowCategoryChange : true){
|
||||
|
||||
@@ -33,8 +33,8 @@ export const registerActions = async () => {
|
||||
}
|
||||
|
||||
//update stats
|
||||
await opendiscord.stats.get("opendiscord:global").setStat("opendiscord:tickets-transferred",1,"increase")
|
||||
await opendiscord.stats.get("opendiscord:user").setStat("opendiscord:tickets-transferred",user.id,1,"increase")
|
||||
await opendiscord.statistics.get("opendiscord:global").setStat("opendiscord:tickets-transferred",1,"increase")
|
||||
await opendiscord.statistics.get("opendiscord:user").setStat("opendiscord:tickets-transferred",user.id,1,"increase")
|
||||
|
||||
//get new channel properties
|
||||
const channelPrefix = ticket.option.get("opendiscord:channel-prefix").value
|
||||
|
||||
Reference in New Issue
Block a user