Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- client.on("ready", () => {
- // This event will run if the bot starts, and logs in, successfully.
- console.log(`logged in as ${client.user.tag}`);
- // Example of changing the bot's playing game to something useful. `client.user` is what the
- // docs refer to as the "ClientUser".
- // Set the client user's status
- client.user.setStatus('online')
- client.user.setPresence({
- game: {
- name: `Youtube! Ryyan`,
- type: "watching",
- url: "https://www.twitch.tv/monstercat"
- }
- });
- });
- client.on("message", async message => {
- // This event will run on every single message received, from any channel or DM.
- // It's good practice to ignore other bots. This also makes your bot ignore itself
- // and not get into a spam loop (we call that "botception").
- if(message.author.bot) return;
- // Also good practice to ignore any message that does not start with our prefix,
- // which is set in the configuration file.
- if(message.content.indexOf(config.prefix) !== 0) return;
- // Here we separate our "command" name, and our "arguments" for the command.
- // e.g. if we have the message "+say Is this the real life?" , we'll get the following:
- // command = say
- // args = ["Is", "this", "the", "real", "life?"]
- const args = message.content.slice(config.prefix.length).trim().split(/ +/g);
- const command = args.shift().toLowerCase();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement