I am trying to make a discord bot for a database or something similar. The point of the bot should be to store information. I want to store the number of podcasts I have listened to, how many hours they add up to, and what are they, all this sort of information. I thought a discord bot should do; I know of quite a few that store such information. I am really a beginner to this, and any information would help me out. one of the functions that this bot should have is a dropdown menu; I came across this problem where when I call the menu function, the bot crashes, and I get this type of error:
throw new Error(
^
Error: TOO_MANY_CHARACTERS_OF_MENU_DESCRIPTION: The maximum length of MessageMenuOption.description is 100 characters, received 54 instead.
This is my code of the dropdown menu:
client.on('message', async message =>{
if(!message.guild || message.author.bot) return;
if(message.content == prefix + 'menu'){
//first option
let = option1 = new MessageMenuOption()
.setLabel('Podcast')
.setValue('Podcast')
.setDescription('If you have listened to a podcast today, post it here!')
.setDefault()
//second option
let = option2 = new MessageMenuOption()
.setLabel('Tutorial')
.setValue('Tutorial')
.setDescription('If you have watched a tutorial today, post it here!')
.setDefault()
//third option
let = option3 = new MessageMenuOption()
.setLabel('Documentary/General_knowledge')
.setValue('Documentary/General_knowledge')
.setDescription('If you have watched a documentary today, post it here!')
.setDefault()
let selection = new MessageMenu()
.setID('Selection')
.setMaxValues(1)
.setMinValues(1)
.setPlaceholder('Select something!')
.addOption(option1)
.addOption(option2)
.addOption(option3)
let embed = new Discord.MessageEmbed()
.setColor('BLURPLE').setTitle('What have you learned today?')
let menuMsg = await message.channel.send(embed, selection)
function menu_selection(menu) {
switch(values[0]) {
case 'Podcast':
menu.reply.send("Nice!, hope this podcast was useful!")
break;
case 'Tutorial':
menu.reply.send("Nice!, hope this tutorial was useful!")
break;
case 'Documentary/General_knowledge':
menu.reply.send("Nice!, hope this video was useful!")
break;
}
}
client.on('clickMenu', (menu) => {
if(menu.message.id == menuMsg.id) {
if(menu.clicker.user.id == message.author.id) menu_selection(menu)
else menu.reply.send("Type ```.menu``` to get access to this menu!")
}
})
}
})