mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-10 07:03:08 -04:00
deprecate old analytics system
This commit is contained in:
parent
797de47dd7
commit
8d624d1d81
4 changed files with 1 additions and 23 deletions
|
@ -91,10 +91,6 @@ const { createEmbed } = require('#utils/embed');
|
|||
const { icon, highlight } = require('#utils/markdown');
|
||||
const { editOrReply } = require('#utils/message');
|
||||
|
||||
// Analytics
|
||||
commandClient.on('commandRan', ({ context, command }) => { if(!command.metadata.use_custom_ingest) ingest(command.name, "command_ran")} )
|
||||
interactionClient.on('commandRan', ({ context, command }) => { if(!command.metadata.use_custom_ingest) ingest(command.name, "slash_command_ran")} )
|
||||
|
||||
// Handle missing permission errors
|
||||
commandClient.on('commandPermissionsFailClient', ({context, permissions}) => {
|
||||
if(!context.channel.can(Permissions.SEND_MESSAGES)) return;
|
||||
|
|
|
@ -45,15 +45,4 @@ module.exports.basecamp = async function (log, content = ""){
|
|||
console.log(e)
|
||||
throw "Basecamp request failed."
|
||||
}
|
||||
}
|
||||
|
||||
module.exports.ingest = async function (event, type = "generic"){
|
||||
if(!process.env.INGEST_SERVICE_HOST) return console.warn("No ingest service host configured.")
|
||||
try{
|
||||
let r = await superagent.get(`${process.env.INGEST_SERVICE_HOST}/d/${type}/${encodeURIComponent(event)}`)
|
||||
.set("x-ingest-client", process.env.INGEST_SERVICE_CLIENT)
|
||||
}catch(e){
|
||||
console.log(e)
|
||||
console.log("ingest failed")
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue