<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Chee Yong</title>
    <description>The latest articles on DEV Community by Chee Yong (@leecheeyong).</description>
    <link>https://dev.to/leecheeyong</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F945746%2F2c80a3ad-3c28-469a-8cc4-63d6729f767b.png</url>
      <title>DEV Community: Chee Yong</title>
      <link>https://dev.to/leecheeyong</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/leecheeyong"/>
    <language>en</language>
    <item>
      <title>What should you concern about developing a Discord Bot (Jet Brawley)</title>
      <dc:creator>Chee Yong</dc:creator>
      <pubDate>Sat, 26 Nov 2022 18:12:19 +0000</pubDate>
      <link>https://dev.to/leecheeyong/what-should-you-concern-about-developing-a-discord-bot-jet-brawley-30e9</link>
      <guid>https://dev.to/leecheeyong/what-should-you-concern-about-developing-a-discord-bot-jet-brawley-30e9</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Hey everyone, I'm the developer of &lt;a href="https://brawley.js.org" rel="noopener noreferrer"&gt;Jet Brawley&lt;/a&gt; &amp;amp; few other &lt;a href="https://github.com/BotStudios" rel="noopener noreferrer"&gt;Discord Bots&lt;/a&gt;. Today, I'd like to share with everyone about my personal experience as a bot developer, as well as things that you need to know before or during the process of developing your &lt;a href="https://discord.com" rel="noopener noreferrer"&gt;Discord Bot&lt;/a&gt;. &lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj638sqoj0mjzalns18hd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj638sqoj0mjzalns18hd.png" alt="from Discord Blog" width="800" height="451"&gt;&lt;/a&gt;&lt;br&gt;
As a disclaimer, this is not a tutorial on creating a Discord Bot. I wrote this post to help those who are serious about creating a unique and useful Discord Bot.&lt;/p&gt;
&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Device&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl7d4cko3xva7uljsmkf2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl7d4cko3xva7uljsmkf2.png" alt="from Apple Newsroom" width="800" height="447"&gt;&lt;/a&gt;&lt;br&gt;
Yes, you can use a phone or tablet to code, but you should always avoid using them as it significantly slow down the development process.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Codespaces&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsf3a81shkcc1dxalcky9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsf3a81shkcc1dxalcky9.png" alt="Coding" width="800" height="449"&gt;&lt;/a&gt;&lt;br&gt;
There are many coding IDEs out there, avoid using notepad or normal text editor for programming.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Skills&lt;/strong&gt;&lt;br&gt;
The level of your coding skills &amp;amp; how experienced you are with programming isn't the top priority of creating an awesome Discord Bot but don't get me wrong, you do need to have a fairly decent grasp of a programming language in order to get started. &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Those who had never create a Discord Bot before, you should start playing around with the Discord API libraries of the programming language that you're going to use.&lt;/p&gt;
&lt;h2&gt;
  
  
  Idea
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwwrpkujoyna2cji92wnk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwwrpkujoyna2cji92wnk.png" alt="Idea" width="594" height="532"&gt;&lt;/a&gt;&lt;br&gt;
Don't get started from nowhere.&lt;/p&gt;

&lt;p&gt;So, you are trying to create a unique &amp;amp; useful bot, here's a few ideas that you should forget about.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Features that an existing bot offers&lt;/strong&gt; (or similar features) unless you're able to improve it on your own way that can attract new users that are looking for a bot that offers that specific feature)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Things that don't make sense.&lt;/strong&gt; You should be clear of what bots on Discord can and can't do. &lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;
  
  
  Sketch/list down your ideas
&lt;/h3&gt;

&lt;p&gt;You've had lots of ideas in mind, now just list them out like a todo list.&lt;/p&gt;

&lt;p&gt;Here's an example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- [news] command
  - Make a request to example.com and fetch the latest news
  - In embed form
  - Include links to the post
- [getnews] command
  - Make a request to example.com/getnews and fetch the specific news article
  - an option to choose category and search parameter option that is required
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Getting Started
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpjecilg6e2z0w7phs5cd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpjecilg6e2z0w7phs5cd.png" alt="from Discord App Discovery" width="776" height="398"&gt;&lt;/a&gt;&lt;br&gt;
First, you'll have to find out privileges that your bot needs. For instance, the message content privilege is required in order to read messages. (Tip: the use of message content privilege should be avoided for command purpose)&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpto5qjkgei7iylhwjs0h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpto5qjkgei7iylhwjs0h.png" alt="Open Library" width="800" height="436"&gt;&lt;/a&gt;&lt;br&gt;
Finally, learn how to use the library and creating an application on Discord (this process should be easy). It shouldn't be too complex if you're familiar with the programming language.&lt;br&gt;
In order to simplify the process, you should probably develop a bot with the programming language that you are most familiar with. (To give yourself a challenge, you can try developing your Discord bot with a programming language that you're not familiar with, that's a way of improving your skills)&lt;/p&gt;

&lt;p&gt;I'd always encourage programmers to write down another todo list, make a planning for the development process of your bot. Don't worry as I will walk you through the process.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Libraries that you need for your project (bot).&lt;/strong&gt; Try to list down every library that you'll be using for your project. &lt;em&gt;Try to include what you're going to use them for.&lt;/em&gt; 
Example:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- discord.js // interact with Discord API
- axios // Make http request to example.com, fetch the API
- mongoose // Store user data 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Explaining what you are trying to do.&lt;/strong&gt; You've listed out the commands that you're going to work on, now make it clearer, almost like documenting what you're trying to do with your own way. For Example:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- When a user runs /news
    1. Reply with the thinking message 
    2. Fetch example.com/news
    3. Create an embed
       - Title: Example news
       - Description: Today's news
       - Fields: an array of objects (name: the article name, value: the article brief)
    4. Edit the message 

- When a user runs /help
    1. Create an embed
    2. A guide on how to use the bot
    3. reply interaction

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Yes, I know, this sounds like an extra work, but this really comes in handy if you're working on a complex and challenging project. But it is definitely a good practice.&lt;/p&gt;

&lt;h2&gt;
  
  
  Coding
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Firngwljxud2hncptkt3y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Firngwljxud2hncptkt3y.png" alt="Coding" width="800" height="333"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Use code formatting tools.&lt;/strong&gt; This makes your code more user readable. &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Explain your code.&lt;/strong&gt; Adding a comment to explain or describe about your code does allow you to debug your project with less hesitation.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Keep it clean &amp;amp; organized.&lt;/strong&gt; Your code/files should be organized in a way that makes it easy for you to find a piece of code. Here's an example: &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7x3ylbm80qeuahmua729.png" alt="Organized" width="328" height="218"&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Remove unused code.&lt;/strong&gt; Some code editors tell if a function or variable is not in used, you should probably get rid of them.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Best Practices
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Keep your bot up to date.&lt;/strong&gt; Update your libraries, keep improving your bot&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;User feedback.&lt;/strong&gt; Take note on every feedbacks from users, try to improve them&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Remove unused registered slash commands&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Test your bot before deploying as a production&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Adding features.&lt;/strong&gt; Adding features to your bot will attract more users&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Get your bot verified.&lt;/strong&gt; &lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Thanks for reading !!
&lt;/h2&gt;

&lt;p&gt;This is my very first post, hope everyone had learned something new. &lt;br&gt;
Feel free to leave a comment down below !&lt;/p&gt;

&lt;p&gt;Check out &lt;strong&gt;Jet Brawley&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://brawley.js.org" rel="noopener noreferrer"&gt;Website&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://twitter.com/JetBrawley" rel="noopener noreferrer"&gt;Twitter&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/BotStudios/Jet-Brawley" rel="noopener noreferrer"&gt;Source Code&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>discuss</category>
    </item>
  </channel>
</rss>
