M
M
Masha2020-10-13 08:54:31
BEM
Masha, 2020-10-13 08:54:31

An error in the code when creating a bot in vs. how to fix it?

When creating a Bot
After entering the command node shisa.js
Gives some error
C:\Users\PC\Desktop\shisa\shisa.js:4
let token = confing.token;
^

ReferenceError: confing is not defined
at Object. (C:\Users\PC\Desktop\shisa\shisa.js:4:13)
at Module._compile (internal/modules/cjs/loader.js:1015:30)
at Object.Module._extensions..js (internal /modules/cjs/loader.js:1035:10)

at Module.load (internal/modules/cjs/loader.js:879:32)
at Function.Module._load (internal/modules/cjs/loader.js:724 :14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js
:60:12)
at internal/main/run_main_module.js:17:47

Code itself:
const Discord = require('discord.js');
const shisa = new Discord.Client();
let config = require('./shisaconfig.json');
let token = config.token;
let prefix = config.prefix;

shisa.on('ready', () => {
console.log(`Bot started ${shisa.user.usernames}`)
});

shisa.on('message', msg => {
if (msg.content === 'ping') {
msg.reply('Pong!');
}
});

shisa.login(token);

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
Pavel Bogdanov, 2016-02-20
@slavapegaskin

1. There are no elements of elements in the BEM methodology.
2. Yes. But you can also start with the html tag.
3. Yes, you can add multiple classes. This will keep css scalable.
4. Yes, it will be more convenient for the subsequent development of the project.
5. No. The .menu__item class should already be on the a tag.
For example:
https://jsfiddle.net/7msq3L8g/

A
Alex_Titov, 2018-06-29
@Alex_Titov

1. You can nest block elements in each other as you like. Don't worry about nesting, BEM is not about that. Most importantly, don't create elements of elements.
2. No, not at all. A block can be, for example, .btn - a button located somewhere deep in other blocks.
3. I think you can mix BEM classes and framework classes.
4. Best of all, create separate CSS files for all BEM blocks and include them in the main file via import.
5. Only in extreme cases, when it is impossible otherwise. In your example, this is not necessary. Just give the link the class .menu__link and you're good to go -:)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question