Skip to content

Commit

Permalink
dont need to log everythjing
Browse files Browse the repository at this point in the history
  • Loading branch information
rungulus committed Jul 24, 2024
1 parent 37dbd86 commit c390405
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions frontend/bucket.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,10 +231,10 @@ class Bucket extends EventEmitter {
if (currentMessage) {
// Make sure to use `username` from `member.user` or `author`
senderDisplayName = currentMessage.member ? currentMessage.member.user.username : currentMessage.author.username;
console.log('presanitized username:' + senderDisplayName);
//console.log('presanitized username:' + senderDisplayName);
// Sanitize the username and truncate if necessary
senderDisplayName = senderDisplayName.replace(/[^a-zA-Z0-9_-]/g, '');
console.log('sanitized username:' + senderDisplayName);
//console.log('sanitized username:' + senderDisplayName);
if (senderDisplayName.length > 64) {
senderDisplayName = senderDisplayName.substring(0, 64);
}
Expand Down Expand Up @@ -355,13 +355,13 @@ class Bucket extends EventEmitter {
this.client.on('messageCreate', async(message) => {
const configData = await getConfig();
if (message.channelId == this.allowedChannelId && message.mentions.has(this.client.user)) {
console.log('got message in channel');
//console.log('got message in channel');
await message.channel.sendTyping();
this.totalPings++;
this.botState = `Activated by ${message.author.tag}`;
console.log(`Got Ping! It's from ${message.author.tag}`);
//console.log(`Got Ping! It's from ${message.author.tag}`);

const sender = message.author.username.replace(/[^a-zA-Z0-9_-]/g, '');;
const sender = message.author.displayName.replace(/[^a-zA-Z0-9_-]/g, '');;



Expand All @@ -373,13 +373,13 @@ class Bucket extends EventEmitter {
// If the message is a reply, get the message chain
messagesArray = await this.getMessageChain(message);

console.log('examining chain, this is a reply:')
console.log(messagesArray);
//console.log('message is a reply')
//console.log(messagesArray);
} else {
// If it's not a reply, just use the current message
messagesArray = [{ role: "user", name: `${sender}`, content: `${this.originalMessage}` }];
console.log('examining message, this is not a reply:')
console.log(messagesArray);
//console.log('message is not a reply')
//console.log(messagesArray);
}
// Call sendChatMessage with the constructed messages array
const response = await sendChatMessage(messagesArray, sender).catch(error => {
Expand Down

0 comments on commit c390405

Please sign in to comment.