<?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: SauhardoSengupta</title>
    <description>The latest articles on DEV Community by SauhardoSengupta (@thejavascripter).</description>
    <link>https://dev.to/thejavascripter</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F806152%2Fea875db2-b854-4fff-94f9-5bf7ec3ce6a8.png</url>
      <title>DEV Community: SauhardoSengupta</title>
      <link>https://dev.to/thejavascripter</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/thejavascripter"/>
    <language>en</language>
    <item>
      <title>Annoucement: Suggest What You Want!🎉🎉</title>
      <dc:creator>SauhardoSengupta</dc:creator>
      <pubDate>Wed, 27 Apr 2022 15:37:07 +0000</pubDate>
      <link>https://dev.to/thejavascripter/annoucement-suggest-what-you-want-3f2f</link>
      <guid>https://dev.to/thejavascripter/annoucement-suggest-what-you-want-3f2f</guid>
      <description>&lt;p&gt;I have been recently doing blogs about different frameworks and tutorials on various things but today I need your help.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;I Need Your Help&lt;/strong&gt;&lt;br&gt;
I want you to suggest me a topic (eg-frameworks, tutorials) and I will make a blog on it and also credit you for suggesting the ideas&lt;/p&gt;

&lt;p&gt;Feel free to suggest me anything!&lt;/p&gt;

&lt;p&gt;P.S - send suggestions in comments!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>What's Svelte?</title>
      <dc:creator>SauhardoSengupta</dc:creator>
      <pubDate>Sun, 24 Apr 2022 15:27:42 +0000</pubDate>
      <link>https://dev.to/thejavascripter/whats-svelte-294i</link>
      <guid>https://dev.to/thejavascripter/whats-svelte-294i</guid>
      <description>&lt;p&gt;it's like wherever I look nowadays everyone's using svelt and telling that's one of the best frameworks they used, so is it true? is svelte truly the best framwork?&lt;/p&gt;

&lt;p&gt;let's take a look at this in todays blog and see which is truly better&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Introduction&lt;/strong&gt;&lt;br&gt;
The first thing that we need to understand is that svelte is not a &lt;em&gt;framework&lt;/em&gt; nor a &lt;em&gt;library&lt;/em&gt; but it's a compiler.&lt;/p&gt;

&lt;p&gt;In svelte you write svelte code which compiles and converts into vanilla JavaScript code&lt;/p&gt;

&lt;p&gt;this code is then executed in the browsers,so no library like react or react-dom is not needed&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Advantages Of Svelt&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Svelt has many advantages but one of the best is small bundle size since you don't have a bunch of libraries to slow down your application&lt;/p&gt;

&lt;p&gt;Svelts learning curve is really really small as it uses html and javascript with a few added features&lt;/p&gt;

&lt;p&gt;Svelt does not use the virtual dom as it feels like its not worh it if you want to read about this&lt;/p&gt;

&lt;p&gt;Check Out This Article by svelt &lt;a href="https://svelte.dev/blog/virtual-dom-is-pure-overhead"&gt;https://svelte.dev/blog/virtual-dom-is-pure-overhead&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Svelt is truly reactive you dont need something like recoil or redux&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Svelt echosysystem&lt;/strong&gt;&lt;br&gt;
The svelte ecosystem is fairly new but has a great community and lots of libraries and code we can use &lt;/p&gt;

&lt;p&gt;lots of developers such as myself love svelt for its simplicity and its syntax&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ok lets talk about the bad&lt;/strong&gt;&lt;br&gt;
alright lets talk about somethings you may or may not like&lt;/p&gt;

&lt;p&gt;svelts syntax can be a bit confusing if you are a beginner&lt;br&gt;
thought its unlikely that you will find their syntax odd some developers do complain its a little hard for them to adjust but personally if would say svelts sytax is not hard but its different than something like react or svelt&lt;/p&gt;

&lt;p&gt;svelt is not popular?&lt;/p&gt;

&lt;p&gt;unfortunately frameworks are kind of a popularity contest and thats why people love frameworks like react and vue and i personally svelt is going under the rader for a lot of people&lt;br&gt;
this might cause some people to to use svelt at all as somepeople are really worried about the frameworks they use and learn &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;br&gt;
In conclusion svelt is great but is it the best framework? well no really... every framework has its ups and down but the way svelt is doing is amazing. Its has become one of my favourite things to talk about&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Want more? content&lt;/strong&gt;&lt;br&gt;
hey there do you want more of this good content?well you can visit my YouTube channel and subscribe there if you want to support me&lt;/p&gt;

&lt;p&gt;MyChannel - &lt;a href="https://www.youtube.com/channel/UCVN9qpxbrJ9qMPjpZf3ywpA"&gt;https://www.youtube.com/channel/UCVN9qpxbrJ9qMPjpZf3ywpA&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Creating A Moderator Bot using Node.js</title>
      <dc:creator>SauhardoSengupta</dc:creator>
      <pubDate>Sat, 23 Apr 2022 10:53:38 +0000</pubDate>
      <link>https://dev.to/thejavascripter/creating-a-discord-bot-moderator-using-discordjs-3dl1</link>
      <guid>https://dev.to/thejavascripter/creating-a-discord-bot-moderator-using-discordjs-3dl1</guid>
      <description>&lt;p&gt;Whether it's creating a discord gaming server or a community server you need some type of moderator to maintain and keep control of the chaos. This might be in the form of blocking inappropriate text or images which can be a big problem if the server is for children.&lt;/p&gt;

&lt;p&gt;so, the question is how do we do it? there are two ways to do this&lt;/p&gt;

&lt;p&gt;1) hire a moderator and pay them &lt;br&gt;
2) create a bot that can do all of the same things if the better and the cost is $0&lt;/p&gt;

&lt;p&gt;let's do option 2 it's much more effective and cost-efficient&lt;/p&gt;
&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;so we are going to use node.js with the discord.js library to interact with discord API&lt;/p&gt;

&lt;p&gt;so let's first initialize a package.json&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npm init&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;running this command will ask a bunch of questions for the project, so enter the correct details for the project and let's get into the next step&lt;/p&gt;

&lt;p&gt;create a javascript file called index.js and in the package.json add the following to the scripts&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   "scripts": {
      start: 'node index.js'
    },
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;now, let's install the necessary libraries&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;br&gt;
npm i discord.js --save&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;this is going to be for development so install it as a dev dependency.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;br&gt;
npm i nodemon --save-dev&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;now let's add another development script to the scripts in package.json&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"scripts": {
    dev: 'nodemon index.js'
 },
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h2&gt;
  
  
  Let's Get Started
&lt;/h2&gt;

&lt;p&gt;in the index.js file import the discord library to use it in our codebase&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const discord = require('discord.js');
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;then let's create a constant called client which will contain the discord client object which represents the bot.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const client = new discord.Client({
  intents: [
    Intents.FLAGS.GUILDS, 
    Intents.FLAGS.GUILD_MESSAGES
  ]
})
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;whenever someone sends a message or when the bot joins it's called an &lt;strong&gt;event&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;user1 ==&amp;gt; sends message ==&amp;gt; event sent&lt;br&gt;
each event has a name that represents its function like onMesssage and ready which only runs when a user send's a message or when the bot joins!.&lt;/p&gt;

&lt;p&gt;We can also give a callback function that runs when the event is sent.&lt;/p&gt;

&lt;p&gt;We can look if someone has posted something by using the onMessage event which will run when someone sends a message with all the details of the message sent&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;//logging when ready
client.on('ready', () =&amp;gt; {
  console.log('🤖🤖 Bot is ready to login');
  console.log(`Logged in as ${client.user.tag}!`);
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;we, need to install the bad-words package which will detect bad words in the messages&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npm i bad-words&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const Filter = require('bad-words')

client.on('messageCreate', async (message) =&amp;gt; {
  const filter = new Filter();

  if (filter.isProfane(message.content)) {
    message.delete();
    message.channel.send(
      `${message.author.username} you are not allowed to use that 
       word.`
    );
  }
})
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;now we have the get the discord token and use this line of code to initialize our bot&lt;/p&gt;

&lt;p&gt;&lt;code&gt;client.login(process.env.DISCORD_TOKEN);&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;to add nudity detection in images we can use this API. &lt;/p&gt;
&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
      &lt;div class="c-embed__cover"&gt;
        &lt;a href="https://sightengine.com/" class="c-link s:max-w-50 align-middle" rel="noopener noreferrer"&gt;
          &lt;img alt="" src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsightengine.com%2Fassets%2Fimg%2Fcovers%2Fsocial.jpg" height="auto" class="m-0"&gt;
        &lt;/a&gt;
      &lt;/div&gt;
    &lt;div class="c-embed__body"&gt;
      &lt;h2 class="fs-xl lh-tight"&gt;
        &lt;a href="https://sightengine.com/" rel="noopener noreferrer" class="c-link"&gt;
          Content Moderation and Image Analysis
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;p class="truncate-at-3"&gt;
          Powerful APIs to assess, filter and moderate photos, videos and texts. Instantly detect nudity, violence, offensive content with our easy-to-use API, at a fraction of the cost of human moderation
        &lt;/p&gt;
      &lt;div class="color-secondary fs-s flex items-center"&gt;
          &lt;img alt="favicon" class="c-embed__favicon m-0 mr-2 radius-0" src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsightengine.com%2Ffavicon.ico"&gt;
        sightengine.com
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;



&lt;p&gt;click on login if you have an account or get started if you don't have an account enter your email and password&lt;/p&gt;

&lt;p&gt;go to the API key's section and copy the API use token and the API secret&lt;/p&gt;

&lt;p&gt;also, install Axios to send and fetch data for the NSFW verification&lt;br&gt;
&lt;code&gt;npm i axios&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;after that's done let's do a request...&lt;br&gt;
now here we need to pass in a URL to send it for review&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;axios.get(
    'https://api.sightengine.com/1.0/check.json',
    {
      params: {
        url,
        models: 'nudity,wad,gore',
        api_user: API_USER,
        api_secret: API_SECRET,
      },
    }
  );
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;to get the user's attachment file let's see if the user has one&lt;br&gt;
and then extract the URL parameter from the message which contains the image sent by the user&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;client.on('messageCreate', async (message) =&amp;gt; {
  //checking if the user has a attachmnet
  if (message.attachments.size &amp;gt; 0) {
     //send the picture url for review using the api
    //message.attachments.first().url --&amp;gt; url of the image sent by the user

    const { data } = await axios.get(
    'https://api.sightengine.com/1.0/check.json',
    {
      params: {
        message.attachments.first().url,
        models: 'nudity,wad,gore',
        api_user: API_USER,
        api_secret: API_SECRET,
      },
    }
  );
  }
})
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;insert this code inside the if condition to delete the message and send an alert message&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  if (
        data.weapon &amp;gt; 0.01 ||
        data.alcohol &amp;gt; 0.1 ||
        data.gore.prob &amp;gt; 0.1 ||
        data.nudity.safe &amp;lt; 0.9
      ) {
        message.channel.send(
          `${message.author} Please do not post nudity or gore content.`
        );

        message.delete()
       }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;finally its ready! run npm run dev to see the results and all the messages that are inappropriate video messages etc.&lt;/p&gt;

&lt;p&gt;signing off...&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;PROMOTION&lt;/strong&gt;&lt;br&gt;
want to support me in making these blogs? &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;subscribe to my channel&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://www.youtube.com/channel/UCVN9qpxbrJ9qMPjpZf3ywpA" rel="noopener noreferrer"&gt;https://www.youtube.com/channel/UCVN9qpxbrJ9qMPjpZf3ywpA&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;follow me on GitHub&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://github.com/sauhardo2020" rel="noopener noreferrer"&gt;https://github.com/sauhardo2020&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>node</category>
      <category>discord</category>
      <category>bot</category>
    </item>
    <item>
      <title>Problem With CSS</title>
      <dc:creator>SauhardoSengupta</dc:creator>
      <pubDate>Tue, 19 Apr 2022 15:52:22 +0000</pubDate>
      <link>https://dev.to/thejavascripter/problem-with-css-3i0m</link>
      <guid>https://dev.to/thejavascripter/problem-with-css-3i0m</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--d679Bo9I--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cdnvbtzmpzeyqv5yzdik.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--d679Bo9I--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cdnvbtzmpzeyqv5yzdik.jpg" alt="Image description" width="880" height="495"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;CSS&lt;/strong&gt; is one of those technologies that we learn to use when starting with web development. But after we find better solutions we don't really think about it. Don't get me wrong CSS is great it helps us build modern and rich ui for websites. But when I'm creating a web application for my client CSS might not be the best choice.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Problem With Frameworks
&lt;/h2&gt;

&lt;p&gt;the only problem I have with using framework such as bootstrap or tailwind is that they are a completely different way of writing CSS and a average beginner might find it difficult to use these technology right away in their project. So the problem arises how do we make css less boring and also make it easier for developers to write it?&lt;/p&gt;

&lt;h2&gt;
  
  
  Solution To The Problem
&lt;/h2&gt;

&lt;p&gt;Let's introduce &lt;strong&gt;&lt;em&gt;Sass&lt;/em&gt;&lt;/strong&gt; also known as &lt;em&gt;Syntactically Awesome Style Sheets&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Sass is a css framework that builds on top of normal css,its like typescript but for css.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;But Why do i like sass so much?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;to know the answer of this lets answer three questions&lt;/p&gt;

&lt;p&gt;Why should I use sass?&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Sass is literally css!.Yeah sass is literally css but with some extra feature. This makes developer experience amazing!&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Sass is smart!. When you write sass you are also writing legacy support for older browsers&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Sass is mature! sass is stable and has a large community!&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;So the next time someone tells you they need to use a CSS framework point them to this blog!&lt;/p&gt;

&lt;p&gt;Now for the final part I am going to give you some resources that you can use to your advantage&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/akDIJa0AP5c"&gt;
&lt;/iframe&gt;
.&lt;/p&gt;

&lt;p&gt;sass Documentation: &lt;a href="https://sass-lang.com/"&gt;https://sass-lang.com/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;SASS SCSS SYNTAX AND SASS&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;sass can be written in two ways using the scss or the sass way&lt;br&gt;
create a file with .scss syntax to use the scss syntax &lt;br&gt;
and use .sass to use the sass bracket syntax&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What't the difference&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;SCSS does not contain any brackets and relies on indentation&lt;br&gt;
SASS uses to contain a style&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TIP: CHECK THE SASS DOCS TO SEE MORE ABOUT SASS VS SCSS&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;//scss code
.button
  padding: 3px 10px
  font-size: 12px
  border-radius: 3px
  border: 1px solid #e1e4e8

//sass code
 .button {
  padding: 3px 10px;
  font-size: 12px;
  border-radius: 3px;
  border: 1px solid #e1e4e8;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;PROMOTION&lt;/strong&gt;&lt;br&gt;
If you like this content be sure to subscribe to my youtube channel as a thank you helps me a lot! :)&lt;/p&gt;

&lt;p&gt;CHANNEL--👉&lt;a href="https://www.youtube.com/channel/UCVN9qpxbrJ9qMPjpZf3ywpA"&gt;https://www.youtube.com/channel/UCVN9qpxbrJ9qMPjpZf3ywpA&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;signing off....&lt;/p&gt;

</description>
      <category>css</category>
      <category>sass</category>
      <category>problem</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
