How to code an autospawn bot

Posted May 28, 2021 461 views

Hello everyone, I’m a noob in coding and I need some help..
I would like to create a discord bot like pokecord but I don’t know how to code the Pokémon’s spawn (I think it is every N messages) and I don’t know how to code the Pokémon’s capturing with the command… Sorry if these are dumb problems for you guys but I’m a newby..and sorry for my bad English..
I try to explain better, the bot should spawn after some messages (20 for expample) sent by the people in the server, the pokemon is just an embed with the picture and the description, and people can capture them with a command, for example “P! capture pikachu”. How can i make the bot spawn these embeds after 20 messages sent by the people? Is that something like a setinterval functions?
i mean, if i have a bot and i have and embed.. what the code should be to make it spawn every 20 messages? Sorry if i repeat but i’m not sure that i’m clear or not with this question :(
thank you very much for answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer


What I could suggest here is, in case that you wanted to write your own custom bot and have full control on how it works, is to start with this tutorial here on how to build a Discord bod from scratch:

If you have no coding experience, I would recommend this How To Code in JavaScript tutorial series which would give you the fundamental knowledge that you need in order to start writing code.


by Tom
Discord is a chat application that allows millions of users across the globe to message and voice chat online in communities called guilds or servers. In this tutorial, you will build a Discord bot from scratch, using Node.js and the Discord.js library, which allows users to directly interact with the Discord API. You'll set up a profile for a Discord bot, get authentication tokens for the bot, and program the bot with the ability to process commands, with arguments, from users.