Skip to content

Commit

Permalink
fix(talk): fix issue with no author info + issue with socketio discon…
Browse files Browse the repository at this point in the history
…nect
  • Loading branch information
qlaffont committed Mar 6, 2024
1 parent c3d8880 commit 4f68ede
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
15 changes: 11 additions & 4 deletions src/components/client/client.html
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,18 @@
}

document.addEventListener("DOMContentLoaded", function () {
var socket = io();
var socket = io({
'reconnection': true,
'reconnectionDelay': 1000,
'reconnectionDelayMax': 1000,
'reconnectionAttempts': 999
});

//Get query param
const urlParams = new URLSearchParams(window.location.search);
socket.emit("join-room", "messages-"+ urlParams.get('guildId'));
socket.on('connect', () => {
//Get query param
const urlParams = new URLSearchParams(window.location.search);
socket.emit("join-room", "messages-" + urlParams.get('guildId'));
});

socket.on("new-message", function (data) {
console.debug(data);
Expand Down
4 changes: 2 additions & 2 deletions src/components/messages/talkCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ export const talkCommand = () => ({
media,
mediaContentType: 'audio/mpeg',
mediaDuration: Math.ceil(additionalContent.mediaDuration),
author: interaction.user.username,
authorImage: interaction.user.avatarURL(),
}),
type: QueueType.VOCAL,
discordGuildId: interaction.guildId!,
duration: additionalContent.mediaDuration ? Math.ceil(additionalContent.mediaDuration) : env.DEFAULT_DURATION,
author: interaction.user.username,
authorImage: interaction.user.avatarURL(),
},
});
},
Expand Down

0 comments on commit 4f68ede

Please sign in to comment.