Login Register






Thread Rating:
  • 0 Vote(s) - 0 Average


Tutorial Writing a Discord bot filter_list
Author
Message
RE: Writing a Discord bot #2
For this case, winston is purely aesthetic, and something more lightweight like chalk could do the job of coloring text just as well (plus, asynchronicity isn't a requirement here). Some additions to this could be using an argument parser like argparse to specify bot activities, or give the user the capability to send messages.

I actually made something really similar a while back, check it out here.

Not that this was bad, but just some tips for writing tutorials in the future:
  • don't spoonfeed readers by giving them the exact code. Instead of giving the command to install npm packages (can be shortened to just npm install socket.io winston), tell them to do that, but not how. Thus they need to teach themselves if they don't already know.
  • Explain your code more thoroughly using comments or breaking it into smaller pieces, so readers know what's going on. Again, this is about helping them learn

Furthermore, adding the following to package.json then running npm install . negates the need for pre-installing dependencies, as well as generates set executables and runs any defined scripts
Code:
"dependencies": {
    "socket.io": ">=1.4.5",
    "winston": ">=2.2.0"
}

Edit: seeing discord bots pop up again has convinced me to make a functional command parsing bot for discord, so stay tuned
It's often the outcasts, the iconoclasts ... those who have the least to lose because they
don't have much in the first place, who feel the new currents and ride them the farthest.

[+] 2 users Like Inori's post
Reply





Messages In This Thread
Writing a Discord bot - by TheEvilSocks - 03-05-2016, 03:00 AM
RE: Writing a Discord bot - by Inori - 03-05-2016, 03:50 AM
RE: Writing a Discord bot - by pvnk - 03-05-2016, 07:26 AM
RE: Writing a Discord bot - by Dismas - 03-05-2016, 12:22 PM
RE: Writing a Discord bot - by ThePutzer - 02-14-2017, 05:48 PM
RE: Writing a Discord bot - by Warriorfoox - 08-30-2017, 11:36 PM
RE: Writing a Discord bot - by Blink - 02-14-2017, 09:52 PM
RE: Writing a Discord bot - by m0dem - 02-14-2017, 11:12 PM
RE: Writing a Discord bot - by Aeolian - 02-14-2017, 11:13 PM
RE: Writing a Discord bot - by Blink - 02-14-2017, 11:14 PM
RE: Writing a Discord bot - by Mlrkey - 02-23-2017, 12:16 AM
RE: Writing a Discord bot - by TheEvilSocks - 03-12-2017, 06:58 AM
RE: Writing a Discord bot - by Esoterith - 08-31-2017, 03:53 AM
RE: Writing a Discord bot - by mothered - 08-31-2017, 06:47 AM
RE: Writing a Discord bot - by Skryptec - 08-31-2017, 07:12 AM



Users browsing this thread: 2 Guest(s)