I recently attempted to develop a plugin for a Discord bot utilizing the Discordeno Library. The goal of this plugin was to automatically update the name of a Voice channel to display the local time on the computer every minute. However, I encountered an issue where the channel would only be renamed when the bot started and would not update correctly thereafter.
Here is a snippet of the code structure:
export async function clock(client: BotWithCache<Bot>) {
const d = new Date()
const conf = config.plugins.clockChannel
function clockEmoji(date: Date) {
// Code for converting time to emojis
}
// Additional code for updating channel information
}
The purpose of this code was to fetch the current time from the computer running the bot and continuously update the channel name accordingly. This feature was intended to help members track time in case I am unavailable online. However, instead of updating every minute as planned, the channel was only renamed once at the start. Despite troubleshooting efforts, the channel continued to display the same time repeatedly instead of reflecting the accurate time.