<?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: Suhana Jabin</title>
    <description>The latest articles on DEV Community by Suhana Jabin (@suhanajabin).</description>
    <link>https://dev.to/suhanajabin</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%2F1286165%2Ffff2c091-5f99-4c49-aa0a-fc62ba80ba86.png</url>
      <title>DEV Community: Suhana Jabin</title>
      <link>https://dev.to/suhanajabin</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/suhanajabin"/>
    <language>en</language>
    <item>
      <title>Our team procrastinated on writing bug reports. So we built an AI to do it for us</title>
      <dc:creator>Suhana Jabin</dc:creator>
      <pubDate>Sun, 18 Aug 2024 16:04:58 +0000</pubDate>
      <link>https://dev.to/suhanajabin/our-team-procrastinated-on-writing-bug-reports-so-we-built-an-ai-to-do-it-for-us-423g</link>
      <guid>https://dev.to/suhanajabin/our-team-procrastinated-on-writing-bug-reports-so-we-built-an-ai-to-do-it-for-us-423g</guid>
      <description>&lt;h2&gt;
  
  
  1. Case Study : AI for creating Bug Reports
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Team Problem:
&lt;/h3&gt;

&lt;p&gt;Keeping track of multiple messages in a team can be quite difficult. Discord, a popular platform for team discussions, can soon become overwhelmed with lengthy conversations, making it difficult to find important messages and at times, you can even forget those discussed points .&lt;/p&gt;

&lt;h3&gt;
  
  
  Team Solution:
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;What if there was a way to automatically summarize these messages and convert them into actionable insights?&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In this article, we will explore a basic approach to do that—using Python to scrape Discord messages, harnessing the summarization power of Google Gemini (a powerful tool that uses Machine learning models for text generation)  , and effortlessly integrating these summaries into GitLab as issues. This process not only saves time but also ensures that your team's most important discussions are efficiently tracked and managed.&lt;/p&gt;

&lt;h3&gt;
  
  
  How it works
&lt;/h3&gt;

&lt;p&gt;Our approach:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Fetching the discord message chunks from the server.&lt;/li&gt;
&lt;li&gt;Summarizing it with the help of Gemini&lt;/li&gt;
&lt;li&gt;Creating an issue in the Gitlab repo that contains the summary of selected discord issue.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Let's take a quick look on how to implement this idea:&lt;br&gt;
The whole task is divided into 3 basic sections:&lt;/p&gt;
&lt;h4&gt;
  
  
  Watch Discord
&lt;/h4&gt;

&lt;p&gt;We are utilizing Discord APIs to helps us gather messages from a Discord channel, so we can later process and summarize them using tools like Gemini. This way, we can quickly organize and make sense of large amounts of information. &lt;/p&gt;

&lt;p&gt;We need to create a Bot to get the messages from Discord Channel .&lt;br&gt;
So , let's start by creating a Bot in a new application.&lt;/p&gt;



&lt;p&gt;&lt;strong&gt;a) Creating a new application&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Login to Discord&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Navigate to the &lt;a href="https://discord.com/developers/applications" rel="noopener noreferrer"&gt;application page&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fhackmd.io%2F_uploads%2FH1_wUEA5R.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fhackmd.io%2F_uploads%2FH1_wUEA5R.png" alt="Screenshot from 2024-08-17 20-09-40"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click on the "New Application" Button on the top right corner.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fhackmd.io%2F_uploads%2FHyR8H405A.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fhackmd.io%2F_uploads%2FHyR8H405A.png" alt="Screenshot from 2024-08-17 15-13-50"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Give the application name and create.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fhackmd.io%2F_uploads%2FBJ3o0kR5C.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fhackmd.io%2F_uploads%2FBJ3o0kR5C.png" alt="Screenshot from 2024-08-17 15-03-44"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;b) Setting up your Bot&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Navigate to the Bot tab in &lt;a href="https://discord.com/developers/applications" rel="noopener noreferrer"&gt;application page&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fhackmd.io%2F_uploads%2Fr15wVc1j0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fhackmd.io%2F_uploads%2Fr15wVc1j0.png" alt="Screenshot from 2024-08-18 21-02-52"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Provide the username and &lt;strong&gt;note the Bot Access Token&lt;/strong&gt; as we need it in the future for connecting this Bot to the respective discord channel.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If in case you can't see the Bot Access Token , click the &lt;strong&gt;Reset Token&lt;/strong&gt; to generate a new Bot Access Token.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fhackmd.io%2F_uploads%2FBk7zdN05C.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fhackmd.io%2F_uploads%2FBk7zdN05C.png" alt="Screenshot from 2024-08-17 20-14-06"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If you want others to invite your Bot to any servers, make sure the &lt;strong&gt;public bot is ticked&lt;/strong&gt;.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fhackmd.io%2F_uploads%2FHJ4yu4CcA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fhackmd.io%2F_uploads%2FHJ4yu4CcA.png" alt="Screenshot from 2024-08-17 20-14-40"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Make sure message content intent is ticked to enable your bot to receive messages.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fhackmd.io%2F_uploads%2FSyopDV05A.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fhackmd.io%2F_uploads%2FSyopDV05A.png" alt="Screenshot from 2024-08-17 20-15-14"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Great! So now you have successfully set up your Bot account.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;c) Inviting your Bot into your server&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Head to the Oauth2 tab and navigate to the OAuth2 URL Generator section.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fhackmd.io%2F_uploads%2FBJ1adE050.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fhackmd.io%2F_uploads%2FBJ1adE050.png" alt="Screenshot from 2024-08-17 20-18-07"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Click the Bot checkbox&lt;/strong&gt; and Bot permission section will appear.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fhackmd.io%2F_uploads%2FBkuxtVA50.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fhackmd.io%2F_uploads%2FBkuxtVA50.png" alt="Screenshot from 2024-08-17 20-18-22"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Upon clicking the bot checkbox, there will be another box for providing Bot permissions. Choose the permissions as per your usecase. Be careful when you provide the administrator permission to the bot.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fhackmd.io%2F_uploads%2FByv4KV0c0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fhackmd.io%2F_uploads%2FByv4KV0c0.png" alt="Screenshot from 2024-08-17 20-19-31"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You can see a link will appear in the generated URL section.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fhackmd.io%2F_uploads%2FB18PYEC9R.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fhackmd.io%2F_uploads%2FB18PYEC9R.png" alt="Screenshot from 2024-08-17 20-22-46"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Open that url in a new tab and you'll be prompted to select the server.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;After you select the server, &lt;strong&gt;click authorize&lt;/strong&gt; and you're done with the Bot creation part! &lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fhackmd.io%2F_uploads%2FHkj7qVAqR.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fhackmd.io%2F_uploads%2FHkj7qVAqR.png" alt="Screenshot from 2024-08-17 20-26-01"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;d) The Coding part!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We need to create a Python script to scrap the discord messages in the specific channel. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;i)  Make sure you have the right permissions&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;We need the channel ID for scraping and it can only be obtained when you're granted &lt;strong&gt;administrator privilege&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;ii) Install the required libraries&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;pip&lt;/span&gt; &lt;span class="n"&gt;install&lt;/span&gt; &lt;span class="n"&gt;discord&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;iii) Provide the Bot Access Token&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;bot_token&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getenv&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;DISCORD_BOT_TOKEN&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Bot Access Token is necessary to run the client.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;iv) Giving the right permission to the client&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;intents = discord.Intents.default()&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Discord Intents are a way of telling which events your bot wants to receive.&lt;/li&gt;
&lt;li&gt;This line &lt;strong&gt;creates an Intent object&lt;/strong&gt; with default settings and by default, the bot will receive a minimal set of events- messages,reactions and basic events.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;v) Enabling the message intent&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;intents.messages = True&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;This line allows the bot to receive events related to messages.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;vi)  Configuring Bot Client&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;client = discord.Client(intents=intents)&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;This line configures the bot client with the right event permissions.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;vii) Defining an event handler in Python&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;
&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;on_ready&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;Logged in as &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;guild&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;discord&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;utils&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;guilds&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# Get the first guild (server) the bot is in
&lt;/span&gt;    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;guild&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;Connected to guild: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;guild&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;channel&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;guild&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;channels&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;Channel: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;channel&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt; (ID: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;channel&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;id&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;)&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;No guilds found.&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="n"&gt;channel&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get_channel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;channel_id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;channel&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;message&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;channel&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;history&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;limit&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
            &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;author&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;Channel not found.&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Firstly, the client retrieves the first guild/server it is connected to.&lt;/li&gt;
&lt;li&gt;Secondly, it checks for the channel with the given channel ID among the list of channels, and if it matches, the client starts an asynchronous loop to fetch the last 100 messages. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To read the rest of the article, visit : &lt;a href="https://journal.hexmos.com/bug-description-generator/" rel="noopener noreferrer"&gt;https://journal.hexmos.com/bug-description-generator/&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Learn How Docker Works via Mocker, a Tiny Python Implementation</title>
      <dc:creator>Suhana Jabin</dc:creator>
      <pubDate>Sun, 10 Mar 2024 16:08:27 +0000</pubDate>
      <link>https://dev.to/suhanajabin/learn-how-docker-works-via-mocker-a-tiny-python-implementation-102m</link>
      <guid>https://dev.to/suhanajabin/learn-how-docker-works-via-mocker-a-tiny-python-implementation-102m</guid>
      <description>&lt;h3&gt;
  
  
  Introduction
&lt;/h3&gt;

&lt;p&gt;How about creating a container on your own in a few simple steps?&lt;br&gt;
Wait, what is a container? What is its significance?&lt;/p&gt;

&lt;p&gt;A container can be described as a small package that holds all the stuff needed to run a program smoothly, no matter where we put it. Containerization has emerged as a key component of modern software development and deployment in the tech industry.&lt;/p&gt;

&lt;p&gt;While many developers are comfortable using existing container solutions like Docker, there's immense value in understanding how containers work under the hood.&lt;/p&gt;

&lt;p&gt;A container image is like a package containing everything needed to run an application, including code, libraries, and dependencies. It's arranged in layers, with each layer adding or modifying the previous one. These layers are stacked together to create the complete environment needed for the application to run.&lt;/p&gt;

&lt;p&gt;Imagine you're baking a cake. Each ingredient you add flour, eggs, sugar, etc represents a layer in the container image. The final cake is like the complete container image, with all the layers combined to create the finished product. So, just as you can mix and match ingredients to create different cakes, you can layer different components in a container image to create various applications.&lt;/p&gt;

&lt;p&gt;A container is a lightweight, portable, and self-sufficient environment that encapsulates an application and its dependencies, enabling consistent and reliable deployment across different environments.&lt;/p&gt;

&lt;p&gt;So basically, you need a container image for the functioning of a container.&lt;/p&gt;

&lt;p&gt;Whereas Docker is a popular containerization platform that simplifies the process of building, managing, and running containers.&lt;/p&gt;

&lt;p&gt;Now, let's look into the basic terminologies regarding the container.&lt;/p&gt;

&lt;h4&gt;
  
  
  Understanding the basics
&lt;/h4&gt;

&lt;p&gt;In Linux, containers rely on core building blocks such as cgroups and namespaces. These components are essential for tasks like managing resources, isolating processes, and controlling access to the file system, all tailored to suit our specific needs.&lt;/p&gt;

&lt;p&gt;Let's take a closer look at namespaces&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Namespaces&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;"Namespaces lets you see specific parts of a system."&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Namespaces are a Linux Kernel feature that helps in isolating various aspects of a process. They help in creating isolated environments so that they don't interfere with other processes or the host system.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Control Groups&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;While coming to Control Groups, known as Cgroups, are created to set specific constraints around them. Say that you need to limit the memory usage or CPU utilization, we directly use cgroups for this purpose.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;"Cgroups help in assigning certain resource restrictions that aid in effective process management and resource utilization."&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;3. Networking&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Networking is a crucial aspect to enable communication between services, ensuring isolation and security, and facilitating scalability and flexibility in modern cloud-native applications.&lt;/p&gt;

&lt;p&gt;So the networking part of the container aids in creating virtual network interfaces, manipulating the route table, creating network namespaces, and many more.&lt;/p&gt;

&lt;p&gt;This will cover the basics for you, now let's kickstart our container coding journey from scratch.&lt;/p&gt;

&lt;h3&gt;
  
  
  Pulling the image from Repository
&lt;/h3&gt;

&lt;p&gt;First and foremost, we need an image and this can be pulled from any of the available repositories. So we need a function to pull the container image from the repository.&lt;/p&gt;

&lt;p&gt;When it comes to the image, there is another term known as manifest. Manifest contains all the related metadata, image layers, image configuration, OS and related architecture, etc.&lt;/p&gt;

&lt;p&gt;These are the functions that are done mainly in the pull function:-&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;We need to authenticate with the Docker Hub registry to pull a Docker image from a specified repository.&lt;/li&gt;
&lt;li&gt;After authentication we need to get the manifest from the repository. The manifest is fetched from the repository layer by layer.&lt;/li&gt;
&lt;li&gt;Then these layers are saved within a directory as a JSON file and a separate folder containing the layer features and other additional information.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Rest of the article can be viewed from &lt;a href="https://journal.hexmos.com/building-docker-container/"&gt;https://journal.hexmos.com/building-docker-container/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>containerization</category>
      <category>docker</category>
    </item>
  </channel>
</rss>
