Rename: "source" to "origin" for improved readability
This commit is contained in:
@@ -10,7 +10,7 @@ const lang = opendiscord.languages
|
||||
export const registerActions = async () => {
|
||||
opendiscord.actions.add(new api.ODAction("opendiscord:update-ticket-topic"))
|
||||
opendiscord.actions.get("opendiscord:update-ticket-topic").workers.add([
|
||||
new api.ODWorker("opendiscord:update-ticket-topic",2,async (instance,params,source,cancel) => {
|
||||
new api.ODWorker("opendiscord:update-ticket-topic",2,async (instance,params,origin,cancel) => {
|
||||
const {guild,channel,user,ticket,newTopic} = params
|
||||
if (channel.isThread() || !(channel instanceof discord.TextChannel)) throw new api.ODSystemError("Unable to set topic of ticket! Open Ticket doesn't support threads!")
|
||||
|
||||
@@ -43,14 +43,14 @@ export const registerActions = async () => {
|
||||
channel.setTopic(channelTopics.join(" • "),"Topic Changed")
|
||||
|
||||
//reply with new message
|
||||
if (params.sendMessage && newTopic) await channel.send((await opendiscord.builders.messages.getSafe("opendiscord:topic-set").build(source,{guild,channel,user,ticket,topic:newTopic})).message)
|
||||
if (params.sendMessage && newTopic) await channel.send((await opendiscord.builders.messages.getSafe("opendiscord:topic-set").build(origin,{guild,channel,user,ticket,topic:newTopic})).message)
|
||||
ticket.get("opendiscord:busy").value = false
|
||||
if (newTopic) await opendiscord.events.get("afterTicketTopicChanged").emit([ticket,user,channel,oldTopic,newTopic])
|
||||
}),
|
||||
new api.ODWorker("opendiscord:discord-logs",1,async (instance,params,source,cancel) => {
|
||||
new api.ODWorker("opendiscord:discord-logs",1,async (instance,params,origin,cancel) => {
|
||||
const {guild,channel,user,ticket} = params
|
||||
}),
|
||||
new api.ODWorker("opendiscord:logs",0,(instance,params,source,cancel) => {
|
||||
new api.ODWorker("opendiscord:logs",0,(instance,params,origin,cancel) => {
|
||||
const {guild,channel,user,ticket,newTopic} = params
|
||||
|
||||
if (newTopic) opendiscord.log(user.displayName+" changed the topic of a ticket!","info",[
|
||||
@@ -59,7 +59,7 @@ export const registerActions = async () => {
|
||||
{key:"channel",value:"#"+channel.name},
|
||||
{key:"channelid",value:channel.id,hidden:true},
|
||||
{key:"topic",value:newTopic},
|
||||
{key:"method",value:source}
|
||||
{key:"method",value:origin}
|
||||
])
|
||||
})
|
||||
])
|
||||
|
||||
Reference in New Issue
Block a user