Snippets Collections
sk-proj-6Wyu81CgBmXF5g7f7qbaT3BlbkFJB0Jgj3t4t8X9gFIFkdnw
package main

​

import (

    "encoding/json"

    "fmt"

    "os"

)

​

type response1 struct {

    Page   int

    Fruits []string

}

type response2 struct {

    Page   int      `json:"page"`

    Fruits []string `json:"fruits"`

}

​

func main() {

    bolB, _ := json.Marshal(true)

    fmt.Println(string(bolB))

​

    intB, _ := json.Marshal(1)

    fmt.Println(string(intB))

​

    fltB, _ := json.Marshal(2.)

    fmt.Println(string(fltB))

​

    strB, _ := json.Marshal("gopher")

    fmt.Println(string(strB))

​

    slcD := []string{"apple", "peach", "pear"}

    slcB, _ := json.Marshal(slcD)

    fmt.Println(string(slcB))
34
​

    mapD := map[string]int{"apple": 5, "lettuce": 7}

    mapB, _ := json.Marshal(mapD)

    fmt.Println(string(mapB))

​

    res1D := &response1{
Get-Help
   [[-Name] <String>]
   [-Path <String>]
   [-Category <String[]>]
   [-Full]
   [-Component <String[]>]
   [-Functionality <String[]>]
   [-Role <String[]>]
   [<CommonParameters>]
.checkbox-lg .custom-control-label::before, 
.checkbox-lg .custom-control-label::after {
  top: .8rem;
  width: 1.55rem;
  height: 1.55rem;
}

.checkbox-lg .custom-control-label {
  padding-top: 13px;
  padding-left: 6px;
}


.checkbox-xl .custom-control-label::before, 
.checkbox-xl .custom-control-label::after {
  top: 1.2rem;
  width: 1.85rem;
  height: 1.85rem;
}

.checkbox-xl .custom-control-label {
  padding-top: 23px;
  padding-left: 10px;
}
// icons.svg file containing all svg icons with 'symbol' referrenced with an ID
<svg aria-hidden="true" style="position: absolute; width: 0; height: 0; overflow: hidden;" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<symbol id="icon-monitor" viewBox="0 0 24 24">
<title>monitor</title>
<path d="M20 2h-16c-1.7 0-3 1.3-3 3v10c0 1.7 1.3 3 3 3h7v2h-3c-0.6 0-1 0.4-1 1s0.4 1 1 1h8c0.6 0 1-0.4 1-1s-0.4-1-1-1h-3v-2h7c1.7 0 3-1.3 3-3v-10c0-1.7-1.3-3-3-3zM21 15c0 0.6-0.4 1-1 1h-16c-0.6 0-1-0.4-1-1v-10c0-0.6 0.4-1 1-1h16c0.6 0 1 0.4 1 1v10z"></path>
</symbol>
<symbol id="icon-moon" viewBox="0 0 24 24">
<title>moon</title>
<path d="M21.5 11.9c-0.3-0.2-0.8-0.2-1.1 0.1-2.1 1.6-5 1.6-7.1 0-2.7-2-3.3-5.7-1.3-8.4 0.2-0.3 0.3-0.7 0.1-1.1-0.2-0.3-0.6-0.5-1-0.5-4.8 0.4-8.6 4.2-9 9-0.5 5.5 3.5 10.4 9 10.9 0.3 0 0.6 0 0.9 0 2.3 0 4.6-0.8 6.4-2.3 2.1-1.7 3.3-4.1 3.6-6.8 0-0.3-0.2-0.7-0.5-0.9zM17.2 18.1c-1.6 1.4-3.7 2-5.8 1.8-4.4-0.4-7.6-4.3-7.2-8.7 0.3-3.1 2.4-5.8 5.2-6.8-1.2 3.2-0.1 7 2.8 9.2 2.2 1.6 5 2 7.5 1.1-0.6 1.3-1.4 2.5-2.5 3.4z"></path>
</symbol>
<symbol id="icon-more-horizontal" viewBox="0 0 24 24">
<title>more-horizontal</title>
<path d="M14 12c0 1.105-0.895 2-2 2s-2-0.895-2-2c0-1.105 0.895-2 2-2s2 0.895 2 2z"></path>
<path d="M21 12c0 1.105-0.895 2-2 2s-2-0.895-2-2c0-1.105 0.895-2 2-2s2 0.895 2 2z"></path>
<path d="M7 12c0 1.105-0.895 2-2 2s-2-0.895-2-2c0-1.105 0.895-2 2-2s2 0.895 2 2z"></path>
</symbol>
<symbol id="icon-more-vertical" viewBox="0 0 24 24">
<title>more-vertical</title>
<path d="M14 12c0 1.105-0.895 2-2 2s-2-0.895-2-2c0-1.105 0.895-2 2-2s2 0.895 2 2z"></path>
<path d="M14 5c0 1.105-0.895 2-2 2s-2-0.895-2-2c0-1.105 0.895-2 2-2s2 0.895 2 2z"></path>
<path d="M14 19c0 1.105-0.895 2-2 2s-2-0.895-2-2c0-1.105 0.895-2 2-2s2 0.895 2 2z"></path>
</symbol>
<symbol id="icon-move" viewBox="0 0 24 24">
<title>move</title>
<path d="M22.9 12.4c0.1-0.2 0.1-0.5 0-0.8-0.1-0.1-0.1-0.2-0.2-0.3l-3-3c-0.4-0.4-1-0.4-1.4 0s-0.4 1 0 1.4l1.3 1.3h-6.6v-6.6l1.3 1.3c0.2 0.2 0.4 0.3 0.7 0.3s0.5-0.1 0.7-0.3c0.4-0.4 0.4-1 0-1.4l-3-3c-0.1-0.1-0.2-0.2-0.3-0.2-0.2-0.1-0.5-0.1-0.8 0-0.1 0.1-0.2 0.1-0.3 0.2l-3 3c-0.4 0.4-0.4 1 0 1.4s1 0.4 1.4 0l1.3-1.3v6.6h-6.6l1.3-1.3c0.4-0.4 0.4-1 0-1.4s-1-0.4-1.4 0l-3 3c-0.1 0.1-0.2 0.2-0.2 0.3-0.1 0.2-0.1 0.5 0 0.8 0.1 0.1 0.1 0.2 0.2 0.3l3 3c0.2 0.2 0.4 0.3 0.7 0.3s0.5-0.1 0.7-0.3c0.4-0.4 0.4-1 0-1.4l-1.3-1.3h6.6v6.6l-1.3-1.3c-0.4-0.4-1-0.4-1.4 0s-0.4 1 0 1.4l3 3c0.1 0.1 0.2 0.2 0.3 0.2 0.1 0.1 0.3 0.1 0.4 0.1s0.3 0 0.4-0.1c0.1-0.1 0.2-0.1 0.3-0.2l3-3c0.4-0.4 0.4-1 0-1.4s-1-0.4-1.4 0l-1.3 1.3v-6.6h6.6l-1.3 1.3c-0.4 0.4-0.4 1 0 1.4 0.2 0.2 0.5 0.3 0.7 0.3s0.5-0.1 0.7-0.3l3-3c0.1-0.1 0.2-0.2 0.2-0.3z"></path>
</symbol>
<symbol id="icon-music" viewBox="0 0 24 24">
<title>music</title>
<path d="M21.6 2.2c-0.2-0.2-0.5-0.2-0.8-0.2l-12 2c-0.4 0.1-0.8 0.5-0.8 1v11h-3c-1.7 0-3 1.3-3 3s1.3 3 3 3h2c1.7 0 3-1.3 3-3v-13.2l10-1.7v9.9h-3c-1.7 0-3 1.3-3 3s1.3 3 3 3h2c1.7 0 3-1.3 3-3v-14c0-0.3-0.1-0.6-0.4-0.8zM8 19c0 0.6-0.4 1-1 1h-2c-0.6 0-1-0.4-1-1s0.4-1 1-1h3v1zM20 17c0 0.6-0.4 1-1 1h-2c-0.6 0-1-0.4-1-1s0.4-1 1-1h3v1z"></path>
</symbol>
</defs>
</svg>



// html file using svg and use tags to pull the correct icon from the icons.svg
// animations do not work using this method

  <svg width="100" height="100">
    <use xlink:href="icons.svg#icon-custom"></use>
  </svg>


// using an object for animation use
   <object
          data="./img/bouncing-circles.svg"
          type="image/svg+xml"
          class="preloader-animation"
        >
          <h5 class="fallback">Loading...</h5>
        </object>

bool isprime(int x){
    if(x<=1) return false;
    if(x==2 || x==3) return true;
    if(x%2==0 || x%3==0) return false;
    for(int i=5;i*i<=x;i+=6){
        if(x%i==0 || x%(i+2)==0) return false;
    }
    return true;
}
<div class="data-list">
    <template for:each={data} for:item="item">
        <div key={item.code} class="data-item" data-code={item.code} data-name={item.name} data-volume={item.volume} onclick={handleItemClick}>
            <strong>{item.code}</strong><br />{item.name}<br />{item.volumeFormatted}
        </div>
    </template>
</div>

handleItemClick(event) {
this.MCCObj = {
code: event.currentTarget.dataset.code,//nome dos campos 
name: event.currentTarget.dataset.name,
volume: event.currentTarget.dataset.volume
}

this.selectedMCC = this.MCCObj.code + ' - ' + this.MCCObj.name;
}
# Replace <PATH_TO_CONDA> with the path to your conda install
source <PATH_TO_CONDA>/bin/activate
conda init
apt-get install libgl1-mesa-glx libegl1-mesa libxrandr2 libxrandr2 libxss1 libxcursor1 libxcomposite1 libasound2 libxi6 libxtst6
<ul><!-- wp:list-item -->
<li><a href="/student-life/nyc">New York, NY</a></li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li><a href="/student-life/long-island">Long Island, NY</a></li>
<!-- /wp:list-item --></ul>
<style type="text/css">
    #custom-gladly-chat-button #gladly-not-authenticated {
        visibility: hidden;
    }

    #custom-gladly-chat-button #gladly-authenticated {
        visibility: hidden;
    }

    #custom-gladly-chat-button.gladly-show {
        visibility: visible;
    }

    #custom-gladly-chat-button.gladly-show #gladly-not-authenticated {
        visibility: hidden;
    }

    #custom-gladly-chat-button.gladly-show.gladly-has-authenticated #gladly-authenticated {
        visibility: visible;
    }

    /* TODO Check what the class name should be for when chat is unavailable */
    .chat-unavailable {
        width: 254px;
        height: 108px;
        flex-shrink: 0;
        border-radius: 8px;
        background: var(--primary-light, #FFF);
        box-shadow: 0px 6px 10px 0px rgba(34, 34, 34, 0.20), 0px -4px 10px 0px rgba(34, 34, 34, 0.05);
        color: var(--primary-dark, #222);
        font-size: 14px;
        font-style: normal;
        font-weight: 400;
        line-height: 20px;
    }

    .campaign-message {
        font-family: var(--webfont-primary, sans-serif);
        font-weight: 400;
        font-size: 14px;
        line-height: 1.428571429;
        color: #222;
        box-sizing: content-box;
        position: fixed;
        width: 167px;
        bottom: 26px;
        right: 26px;
        border-radius: 8px;
        z-index: 999;
        /* to show over the chat button */
        cursor: pointer;
        height: auto;
        padding-bottom: 30px;
    }

    .campaign-message-close-button {
        display: inline-flex;
        width: 10px;
        height: 10px;
        padding: 8px;
        justify-content: center;
        align-items: center;
        flex-shrink: 0;
        border-radius: 50%;
        background: var(--primary-dark, #222);
        cursor: pointer;
        position: absolute;
        top: -12px;
        left: 148px;
        border: 2px solid var(--primary-dark, #222);
    }

    .campaign-message-text {
        background-color: var(--primary-light, #FFF);
        color: var(--primary-dark, #222);
        font-size: 14px;
        font-style: normal;
        font-weight: 400;
        line-height: 20px;
        padding: 12px 16px;
        display: block;
        border-radius: 8px;
        box-shadow: 0px 6px 10px 0px rgba(34, 34, 34, 0.20), 0px -4px 10px 0px rgba(34, 34, 34, 0.05);
    }

    .campaign-message-svg {
        width: 16px;
        height: 10px;
        flex-shrink: 0;
        fill: var(--primary-light, #FFF);
        bottom: 7px;
        left: 127px;
        position: relative;
        z-index: 104;
    }

    #custom-gladly-chat-button {
        display: inline-flex;
        padding: 10px 14px;
        justify-content: center;
        align-items: center;
        border-radius: 260px;
        background: var(--primary-dark, #222);
        box-shadow: 0px 4px 10px 0px rgba(0, 0, 0, 0.15);
        width: auto !important;
        height: auto !important;
        position: fixed;
        bottom: 24px;
        right: 24px;
        z-index: 998;
        cursor: pointer;
        border: 1px solid var(--primary-light, #FFF);
    }

    #custom-gladly-chat-button:hover {
        background: var(--primary-dark, #222);
        /* overrides uber styles */
    }

    #custom-gladly-chat-button:focus,
    .campaign-message-close-button:focus {
        outline: dotted 1px;
        outline-offset: -4px;
        outline-color: white;
    }


    .gladly-text {
        color: var(--primary-light, #FFF) !important;
        text-align: center;
        font-family: var(--webfont-primary, sans-serif);
        font-size: 14px;
        font-style: normal;
        font-weight: 700;
        line-height: 20px;
    }

    .unread-dot {
        display: inline;
        position: absolute;
        bottom: 29px;
        right: 3px;
    }

    #gladlyChat_container button[data-aid="selfService-chatButton"] .overrideStyle-sc-10heg51-0.ewrblv {
        display: none;
    }

    #gladlyChat_container .animateChatButton-appear-done {
        display: flex;
        justify-content: center;
    }

    #gladlyChat_container button[data-aid="selfService-chatButton"],
    #gladlyChat_container button[data-aid="selfService-chatButton"]:hover {
        background: var(--primary-dark, #222) !important;
        display: flex !important;
        width: auto !important;
        height: auto !important;
        justify-content: center !important;
        align-items: center;
        gap: 12px;
        flex-shrink: 0;
        min-width: 89% !important;
        min-height: 49px !important;
        margin: auto 24px 24px 24px !important;
    }

    .chat-button-icon,
    .chat-button-text {
        z-index: 2;
    }

    .chat-button-text {
        text-transform: uppercase;
    }

    /* for focus border */
    #gladlyChat_container button[data-aid="selfService-chatButton"]:focus {
        border-color: #222;
        background: #222;
        color: #fff;
        box-shadow: none;
    }

    #gladlyChat_container button[data-aid="selfService-chatButton"]:focus::before {
        display: block;
        content: "";
        border-color: #aaa;
        border-width: 1px;
        border-radius: 0;
        border-style: solid;
        position: absolute;
        top: 1px;
        right: 1px;
        bottom: 1px;
        left: 1px;
        z-index: 1;
    }

    #gladlyChat_container button[data-aid="selfService-chatButton"] div {
        display: none !important;
    }

    #gladlyChat_container button[data-aid="selfService-chatButton"]::after {
        content: "Chat With Us";
        text-transform: uppercase;
        color: var(--white, #FFF);
        text-align: center;
        font-size: 12px;
        font-style: normal;
        font-weight: 600;
        line-height: 12px;
        letter-spacing: 1px;
        text-transform: uppercase;
    }

    #gladlyChat_container button[data-aid="selfService-chatButton"],
    #gladlyChat_container button[data-aid="selfService-chatButton"]:focus {
        padding: 18px 24px;
    }

    #gladlyChat_container .QHDDO {
        stroke: #222 !important;
    }

    @media screen and (max-width: 768px) {
        .unread-dot {
            bottom: 25px;
        }

        .campaign-message {
            bottom: 20px;
            right: 17px;
            padding-bottom: 32px;
        }

        #custom-gladly-chat-button {
            padding: 8px 14px;
            bottom: 24px;
            right: 16px;
        }

        .gladly-text {
            font-size: 12px;
        }

        #gladlyChat_container button[data-aid="selfService-chatButton"],
        #gladlyChat_container button[data-aid="selfService-chatButton"]:hover,
        #gladlyChat_container button[data-aid="selfService-chatButton"]:focus {
            margin: auto 16px 16px 16px !important;
        }

        body[data-is-interrupter-on="true"][data-interrupter-variation="collapsed banner"] #custom-gladly-chat-button {
            bottom: 86px;
        }

        body[data-is-interrupter-on="true"][data-interrupter-variation="medium banner"] #custom-gladly-chat-button {
            bottom: 171px;
        }

        body[data-is-interrupter-on="true"][data-interrupter-variation="collapsed banner"] .campaign-message {
            bottom: 83px;
        }


        body[data-is-interrupter-on="true"][data-interrupter-variation="medium banner"] .campaign-message {
            bottom: 167px;
        }
    }

    @media screen and (max-width: 932px) and (orientation: landscape) {

        #gladlyChat_container button[data-aid="selfService-chatButton"],
        #gladlyChat_container button[data-aid="selfService-chatButton"]:hover,
        #gladlyChat_container button[data-aid="selfService-chatButton"]:focus {
            min-width: 95% !important;
            margin: 24px !important;
        }
    }
</style>
<button id="custom-gladly-chat-button" aria-describedby="gladly-campaign-message" onclick="gladlyChatOnClick()" class="gladly-show">
    <span class="gladly-text">Chat With Us</span>
    <div id="gladly-not-authenticated">
        <span class="gladly-text sr-only">Chat With Us</span>
    </div>
    <div id="gladly-authenticated">
        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none" class="unread-dot">
            <circle cx="8" cy="8" r="7" fill="#BB0000" stroke="white" stroke-width="2"></circle>
        </svg>
    </div>
</button>
# Replace <PACKAGE> with the name of a package you want to install in your environment
conda install <PACKAGE>
# Replace <ENV> with a new name for your environment
# Replace <PACKAGE> with the name of a package you want to install in your environment
conda create -n <ENV> <PACKAGE> ipykernel
h1 {
	font-size: 48px;
	font-weight: 400;
	line-height: 1.2em;
	color: #000000;
}

h2 {
	font-size: 40px;
	font-weight: 400;
	line-height: 1.2em;
	color: #000000;
}

h3 {
	font-size: 36px;
	font-weight: 400;
	line-height: 1.2em;
	color: #000000;
}

h4 {
	font-size: 32px;
	font-weight: 400;
	line-height: 1.2em;
	color: #000000;
}

h5 {
	font-size: 28px;
	font-weight: 400;
	line-height: 1.2em;
	color: #000000;
}

h6 {
	font-size: 24px;
	font-weight: 400;
	line-height: 1.2em;
	color: #000000;
}
<a href="https://maticz.com/nft-game-development">NFT Game Development</a>
<a href="https://maticz.com/bitstamp-clone-script">Bitstamp Clone Script</a>
<a href="https://maticz.com/bc-game-clone-script">BC.game Clone Script</a>
<script>
$(document).ready(function() {
    // Check the language of the page
    var lang = $('html').attr('lang');
    
    // Define the language parameter based on the page language
    var languageParam;
    if (lang === 'es-ES') {
        languageParam = 'es';
    } else if (lang === 'en-US') {
        languageParam = 'en';
    } else if (lang === 'ca') {
        languageParam = 'ca';
    } else if (lang === 'fr-FR') {
        languageParam = 'fr';
    }

    if (languageParam) {
        // Modify scripts with src starting with the specified URL
        $('script[src^="https://fareharbor.com/embeds/script/calendar/bellesguardgaudi/"]').each(function() {
            var newSrc = $(this).attr('src') + '&language=' + languageParam;
            $(this).attr('src', newSrc);
        });

        // Modify links with href starting with the specified URL
        $('a[href^="https://fareharbor.com/embeds/book/bellesguardgaudi/"]').each(function() {
            var newHref = $(this).attr('href') + '&language=' + languageParam;
            $(this).attr('href', newHref);
        });
    }
});
</script>
Sub AddSheetNameAndConsolidate()
    Dim ws As Worksheet
    Dim newWs As Worksheet
    Dim lastRow As Long, newRow As Long
    Dim sourceWsName As String
    Dim rng As Range
    
    ' Create a new worksheet for consolidated data
    Set newWs = ThisWorkbook.Worksheets.Add
    newWs.Name = "Consolidated Data"
    newRow = 2
    
    ' Add headers to the consolidated worksheet
    newWs.Cells(1, 1).Value = "Source Worksheet"
    
    ' Loop through each worksheet in the workbook
    For Each ws In ThisWorkbook.Worksheets
        ' Skip the consolidated worksheet itself
        If ws.Name <> newWs.Name Then
            ' Determine the name of the source worksheet
            sourceWsName = ws.Name
            
            ' Determine the last row in the current worksheet
            lastRow = ws.Cells(ws.Rows.Count, 1).End(xlUp).Row
            
            ' Insert a new column A with the worksheet name for each row
            ws.Columns("A:A").Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
            ws.Cells(1, 1).Value = "Source Worksheet"
            ws.Range(ws.Cells(2, 1), ws.Cells(lastRow, 1)).Value = sourceWsName
            
            ' Copy data from column A onward to the consolidated worksheet
            Set rng = ws.Range(ws.Cells(1, 1), ws.Cells(lastRow, ws.UsedRange.Columns.Count + 1))
            rng.Copy newWs.Cells(newRow, 1)
            
            ' Increment the new row pointer for the next worksheet's data
            newRow = newRow + rng.Rows.Count
        End If
    Next ws
    
    ' Autofit columns in the consolidated worksheet
    newWs.Columns.AutoFit
    
    MsgBox "Consolidation completed successfully!", vbInformation
End Sub
youtube.com##+js(set-cookie, VISITOR_INFO1_LIVE, 1, , , domain, .youtube.com)
youtube.com##+js(cookie-remover, VISITOR_INFO1_LIVE)
The Canvas API can be used to create graphics in games using JavaScript and the HTML canvas element.

You will need to use the getContext method which will provide the context for where the graphics will be rendered.

Example Code
canvas.getContext("2d");

The canvas element has a width property which is a positive number that represents the width of the canvas.

Example Code
canvas.width

The innerWidth property is a number that represents the interior width of the browser window.

The innerHeight property is a number that represents the interior height of the browser window.

Here is the syntax for using the destructuring assignment in the parameter list of the arrow function:

Example Code
btn.addEventListener('click', ({ target }) => {
  console.log(target);
});

When working with objects where the property name and value are the same, you can use the shorthand property name syntax. This syntax allows you to omit the property value if it is the same as the property name.

Example Code
// using shorthand property name syntax
obj = {
  a, b, c
}
The following code is the same as:

Example Code
obj = {
  a: a,
  b: b,
  c: c
}
Sub CombineWorksheetsFromMultipleFiles()
    Dim selectedFiles As FileDialog
    Dim selectedFile As Variant
    Dim newWorkbook As Workbook
    Dim sourceWorkbook As Workbook
    Dim ws As Worksheet
    Dim newWorksheet As Worksheet
    Dim fileName As String
    Dim sheetIndex As Integer
    
    ' Step 1: Select Excel files
    Set selectedFiles = Application.FileDialog(msoFileDialogOpen)
    selectedFiles.AllowMultiSelect = True
    selectedFiles.Title = "Select Excel Files to Combine"
    selectedFiles.Filters.Clear
    selectedFiles.Filters.Add "Excel Files", "*.xls; *.xlsx; *.xlsm", 1
    
    If selectedFiles.Show <> -1 Then
        MsgBox "No files selected. Exiting macro."
        Exit Sub
    End If
    
    ' Step 2: Create a new workbook
    Set newWorkbook = Workbooks.Add
    Set newWorksheet = newWorkbook.Sheets(1) ' Change index or name as needed
    sheetIndex = 1
    
    ' Step 3: Loop through selected files and copy worksheets
    For Each selectedFile In selectedFiles.SelectedItems
        Set sourceWorkbook = Workbooks.Open(selectedFile)
        fileName = sourceWorkbook.Name
        
        For Each ws In sourceWorkbook.Worksheets
            ws.Copy after:=newWorkbook.Sheets(newWorkbook.Sheets.Count)
            ' Rename the copied sheet to include the original file name
            newWorkbook.Sheets(newWorkbook.Sheets.Count).Name = Left(fileName, InStrRev(fileName, ".") - 1) & "_" & ws.Name
        Next ws
        
        sourceWorkbook.Close SaveChanges:=False
    Next selectedFile
    
    ' Step 4: Confirmation
    MsgBox "Worksheets combined and renamed successfully!", vbInformation
    
    ' Clean up
    Set selectedFiles = Nothing
    Set newWorkbook = Nothing
    Set sourceWorkbook = Nothing
    Set ws = Nothing
    Set newWorksheet = Nothing
End Sub


import numpy as np
    // array to hold list of PDF files to be merged
    $files = array("a.pdf", "b.pdf", "c.pdf");
    $pageCount = 0;
    // initiate FPDI
    $pdf = new FPDI();

    // iterate through the files
    foreach ($files AS $file) {
        // get the page count
        $pageCount = $pdf->setSourceFile($file);
        // iterate through all pages
        for ($pageNo = 1; $pageNo <= $pageCount; $pageNo++) {
            // import a page
            $templateId = $pdf->importPage($pageNo);
            // get the size of the imported page
            $size = $pdf->getTemplateSize($templateId);

            // create a page (landscape or portrait depending on the imported page size)
            if ($size['w'] > $size['h']) {
                $pdf->AddPage('L', array($size['w'], $size['h']));
            } else {
                $pdf->AddPage('P', array($size['w'], $size['h']));
            }

            // use the imported page
            $pdf->useTemplate($templateId);

            $pdf->SetFont('Helvetica');
            $pdf->SetXY(5, 5);
            $pdf->Write(8, 'Generated by FPDI');
        }
    }
import 'dart:developer';

import 'package:firebase_auth/firebase_auth.dart';
import 'package:easy_localization/easy_localization.dart';

import '../../features/auth/core/models/token_response_model.dart';
import 'api_exceptions.dart';

abstract class FirebaseAuthApiClient {

  Future<void> signIn(String phoneNumber, Function(String) codeSent);

  Future<TokenResponseModel> verifyOTP(String verificationId, String smsCode);
  Future<void> signUpWithOTP(String phoneNumber, Function(String) codeSent);
}

class FirebaseAuthApiClientImpl extends FirebaseAuthApiClient {
  final FirebaseAuth _auth;

  FirebaseAuthApiClientImpl(this._auth);

  @override
  Future<void> signIn(String phoneNumber, Function(String) codeSent) async {
    try {
      final phone = "+$phoneNumber";
      log('Signing in with phone number: $phone');
      await _auth.verifyPhoneNumber(
        phoneNumber: phone,
        verificationCompleted: (PhoneAuthCredential credential) async {
          await _auth.signInWithCredential(credential);
          print("Credential $credential");
        },
        verificationFailed: (FirebaseAuthException e) {
          print("Error $e");
          throw _handleError(e, tr('otpSignUpError'));
        },
        codeSent: (String verificationId, int? resendToken) {
          print("Code send code send ");
          codeSent(verificationId);
        },
        codeAutoRetrievalTimeout: (String verificationId) {},
      );
    } catch (e) {
      log('Sign in error: $e');
      throw _handleError(e, tr('otpSignInError'));
    }
  }

  @override
  Future<TokenResponseModel> verifyOTP(
      String verificationId, String smsCode) async {
    try {
      PhoneAuthCredential credential = PhoneAuthProvider.credential(
        verificationId: verificationId,
        smsCode: smsCode,
      );
      print("Credenrial $credential");
      print("verificationId $verificationId smsCode $smsCode ");
      final data = await _auth.signInWithCredential(credential);

      final token = await data.user!.getIdToken();


      if(token == null) {

      throw _handleError( ExceptionWithMessage(tr('tokenNotFound')), tr('tokenNotFound'));
      }
      print("Token $token");


      return TokenResponseModel.fromJson(data, token);
    } catch (e) {
      throw _handleError(e, tr('otpVerificationError'));
    }
  }

  @override
  Future<void> signUpWithOTP(
      String phoneNumber, Function(String) codeSent) async {
    try {
      final phone = "+$phoneNumber";
      print(phone);
      await _auth.verifyPhoneNumber(
        phoneNumber: phone,
        verificationCompleted: (PhoneAuthCredential credential) async {
          await _auth.signInWithCredential(credential);
          print("Credential $credential");
        },
        verificationFailed: (FirebaseAuthException e) {
          print("Error $e");
          throw _handleError(e, tr('otpSignUpError'));
        },
        codeSent: (String verificationId, int? resendToken) {
          codeSent(verificationId);
        },
        codeAutoRetrievalTimeout: (String verificationId) {},
      );
    } catch (e) {
      throw _handleError(e, tr('otpSignUpError'));
    }
  }

  Exception _handleError(dynamic error, String defaultMessage) {
    if (error is FirebaseAuthException) {
      switch (error.code) {
        case 'invalid-verification-code':
          return ExceptionWithMessage(tr('invalidVerificationCode'));
        case 'user-disabled':
          return UnauthorisedException();
        case 'too-many-requests':
          return ExceptionWithMessage(tr('tooManyRequests'));
        case 'operation-not-allowed':
          return ExceptionWithMessage(tr('operationNotAllowed'));
        default:
          return ExceptionWithMessage('$defaultMessage: ${error.message}');
      }
    }
    return ExceptionWithMessage(defaultMessage);
  }
}
import 'dart:io';

import 'package:firebase_storage/firebase_storage.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';

import 'api_exceptions.dart';

abstract class FirebaseStorageClient {
  Future<String> uploadFile(String path, String filePath);
  Future<void> downloadFile(String path, String downloadToPath);
  Future<void> deleteFile(String path);
  Future<String> getFileUrl(String path);
}

class FirebaseStorageClientImpl extends FirebaseStorageClient {
  final FirebaseStorage _storage;

  FirebaseStorageClientImpl(this._storage);

  @override
  Future<String> uploadFile(String path, String filePath) async {
    try {
      final ref = _storage.ref().child(path);
      final uploadTask = ref.putFile(File(filePath));
      await uploadTask.whenComplete(() {});
      return await ref.getDownloadURL();
    } catch (e) {
      throw _handleError(e, tr('errorUploadingFile'));
    }
  }

  @override
  Future<void> downloadFile(String path, String downloadToPath) async {
    try {
      final ref = _storage.ref().child(path);
      final file = File(downloadToPath);
      await ref.writeToFile(file);
    } catch (e) {
      throw _handleError(e, tr('errorDownloadingFile'));
    }
  }

  @override
  Future<void> deleteFile(String path) async {
    try {
      final ref = _storage.ref().child(path);
      await ref.delete();
    } catch (e) {
      throw _handleError(e, tr('errorDeletingFile'));
    }
  }

  @override
  Future<String> getFileUrl(String path) async {
    try {
      final ref = _storage.ref().child(path);
      return await ref.getDownloadURL();
    } catch (e) {
      throw _handleError(e, tr('errorGettingFileUrl'));
    }
  }

  Exception _handleError(dynamic error, String defaultMessage) {
    if (error is FirebaseException) {
      switch (error.code) {
        case 'permission-denied':
          return UnauthorisedException();
        case 'not-found':
          return Exception(defaultMessage);
        default:
          return ExceptionWithMessage('$defaultMessage: ${error.message}');
      }
    }
    return Exception(defaultMessage);
  }
}
 
SELECT a.SubscriberKey,
       a.reason
FROM (
        SELECT s.SubscriberKey,
            'Undeliverable' as reason
        FROM ENT._Subscribers s
        JOIN Test_Retail_TA_News_2024_INCLUDE c on c.SubscriberKey = s.SubscriberKey
        WHERE 1 = 1
            AND s.status in ('held', 'bounced', 'unsubscribe', 'unsubscribed')
            AND s.SubscriberKey IN (
                SELECT x.SubscriberKey
                FROM [Test_Retail_TA_News_2024_INCLUDE] x
                WHERE 1 = 1
            )
             
    ) a

    
UNION ALL
SELECT a.SubscriberKey,
       a.reason
FROM (
        SELECT b.SubscriberKey,  
              'Dealer Exclusion' as reason
        FROM [Test_Retail_TA_News_2024_INCLUDE] b
        WHERE 1 = 1
            AND LOWER(
                RIGHT (
                    b.EmailAddress,
                    LEN(b.EmailAddress) - CHARINDEX('@', b.EmailAddress)
                )
            ) IN (
                SELECT LOWER(x.Domain)
                FROM ent.[Dealer Domains] x
            )
    ) a
UNION ALL
SELECT a.SubscriberKey,
       a.reason
FROM (
        SELECT b.SubscriberKey,
            'Hard bounce DE' as reason
        FROM [Test_Retail_TA_News_2024_INCLUDE] b
        WHERE 1 = 1
            AND b.SubscriberKey IN (
                SELECT x.SubscriberKey
                FROM ent.[Hard Bounces - Exclusion] x
            )
    ) a
UNION ALL
SELECT a.SubscriberKey,
       a.reason
FROM (
        SELECT b.SubscriberKey,
            'Cat Agency Exclusion' as reason
        FROM [Test_Retail_TA_News_2024_INCLUDE] b
        WHERE 1 = 1
            AND LOWER(
                RIGHT (
                    b.EmailAddress,
                    LEN(b.EmailAddress) - CHARINDEX('@', b.EmailAddress)
                )
            ) IN (
                SELECT LOWER(x.Domain)
                FROM ent.[Cat_Agency_Domains] x
            )
    ) a
UNION ALL
SELECT a.SubscriberKey,
       a.reason
FROM (
        SELECT b.SubscriberKey,
            'Competitor Exclusion' as reason
        FROM [Test_Retail_TA_News_2024_INCLUDE] b
        WHERE 1 = 1
            AND LOWER(
                RIGHT (
                    b.EmailAddress,
                    LEN(b.EmailAddress) - CHARINDEX('@', b.EmailAddress)
                )
            ) IN (
                SELECT LOWER(x.Domain)
                FROM ent.[Competitor Domains] x
            )
    ) a 
    
    UNION ALL
SELECT a.SubscriberKey,
       a.reason
FROM (
        SELECT b.SubscriberKey,
            'AMC Status' as reason
        FROM [Test_Retail_TA_News_2024_INCLUDE] b
        WHERE 1 = 1
         AND   b.AMC_Status__c IN ('Inactive', 'Expired')
    ) a 

       UNION ALL
SELECT a.SubscriberKey,
       a.reason
FROM (
        SELECT b.SubscriberKey,
            'AMC Not Marketable' as reason
        FROM [Test_Retail_TA_News_2024_INCLUDE] b
        WHERE 1 = 1
         AND   b.AMC_Last_Activity_Record_ID__c LIKE 'Not Marketable' 
         AND (b.AMC_Status__c LIKE 'Active' OR b.AMC_Status__c IS NULL)
    ) a 
SUM(IF((((ca.value2 = 6 AND ca.value4 = 12) OR (ca.value2 = 3 AND ca.value4 = 8) OR (ca.value2 = 3 AND ca.value4 = 9)) AND (CA.value3 = 1 AND CA.value5 = 1)),1,0))
function remove_gf_menu_page() {
    $current_user = wp_get_current_user();
    if ($current_user && $current_user->user_login === 'Atmos@vl') {
        remove_menu_page( 'index.php' );
		remove_menu_page( 'edit-comments.php' );
		remove_menu_page( 'options-general.php' );
		remove_menu_page( 'themes.php' );
		remove_menu_page( 'plugins.php' );
		remove_menu_page( 'users.php' );
		remove_menu_page( 'tools.php' );
		remove_menu_page( 'edit.php?post_type=woodmart_sidebar' );
		remove_menu_page( 'edit.php?post_type=portfolio' );
		remove_menu_page( 'edit.php?post_type=woodmart_layout' );
		remove_menu_page( 'vc-general' );
		remove_menu_page( 'getwooplugins' );
		remove_menu_page( 'xts_theme_settings' );
		remove_menu_page( 'xts_dashboard' );
		remove_action('admin_footer', 'wp_admin_footer');
		remove_action('wp_footer', 'wp_generator');
		remove_filter('update_footer', 'core_update_footer');
		add_filter('admin_footer_text', '__return_empty_string');
    }
}
add_action('admin_menu', 'remove_gf_menu_page', 9999 );

======================================================================
LIMITED ACCESS DENA HOTO
======================================================================
  
// Custom capability modification for specific user
function restrict_shop_manager_capabilities_for_ahmed() {
    // Get the user by username
    $user = get_user_by('login', 'ahmed');

    if ($user && user_can($user, 'shop_manager')) {
        // Get the user's role
        $user_roles = $user->roles;

        if (in_array('shop_manager', $user_roles)) {
            $user_id = $user->ID;

            // Remove 'edit' and 'delete' rights for WooCommerce orders
            $user->remove_cap('edit_shop_orders');
            $user->remove_cap('delete_shop_orders');

            // Add 'view' rights only
            $user->add_cap('view_woocommerce_reports'); // Example if needed
        }
    }
}
add_action('init', 'restrict_shop_manager_capabilities_for_ahmed');
import { Client, GatewayIntentBits, Partials, PermissionsBitField, ChannelType, EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle } from 'discord.js';
import fs from 'fs';
import path from 'path';
import { fileURLToPath } from 'url';
import dotenv from 'dotenv';

dotenv.config();

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

const prefix = process.env.DISCORD_PREFIX || '!';
const dataFilePath = new URL('data.json', import.meta.url).pathname;
let { playersELO = {}, playerWarnings = {}, karma = {}, playerStats = {} } = JSON.parse(fs.readFileSync(dataFilePath, 'utf-8') || "{}");

let queue = [];
let matchCounter = 1;
let matches = {};

const maps = ['BW', 'SB', 'PORT', 'COMP', 'ANK', 'MEX', 'EE'];

const client = new Client({
  intents: [
    GatewayIntentBits.Guilds,
    GatewayIntentBits.GuildMessages,
    GatewayIntentBits.MessageContent,
    GatewayIntentBits.GuildMembers,
    GatewayIntentBits.GuildVoiceStates,
    GatewayIntentBits.GuildPresences,
    GatewayIntentBits.GuildMessageReactions
  ],
  partials: [Partials.Channel, Partials.Message, Partials.Reaction]
});

client.once('ready', async () => {
  console.log(`Bot is ready! Logged in as ${client.user.tag}`);
  await setupQueueMessage();
});

client.on('messageCreate', async (message) => {
  if (!message.content.startsWith(prefix) || message.author.bot) return;
  const args = message.content.slice(prefix.length).trim().split(/ +/);
  const command = args.shift().toLowerCase();

  try {
    switch (command) {
      case 'report': await reportCommand(message, args); break;
      case 'clearqueue': await clearQueueCommand(message); break;
      case 'resetelo': await resetEloCommand(message); break;
      case 'giveelo': await giveEloCommand(message, args); break;
      case 'setmatchlogchannel': await setMatchLogChannelCommand(message, args); break;
      case 'profile': await profileCommand(message, args); break;
      case 'lb': case 'leaderboard': await leaderboardCommand(message); break;
      case 'elo': await eloCommand(message, args); break;
      case 'pick': await pickCommand(message, args); break;
      case 'needsub': await needSubCommand(message, args); break;
      case 'replace': await replaceCommand(message, args); break;
      case 'pt': await ptCommand(message, args); break;
      case 'cooldown': await suspendUserCommand(message, args); break;
      case 'removecd': await unSuspendUserCommand(message, args); break;
      case 'cancel': await cancelMatchCommand(message, args); break;
      case 'warn': await warnCommand(message, args); break;
      case 'warns': await warnsCommand(message, args); break;
      case 'warningsreset': await warningResetCommand(message); break;
    }
  } catch (error) {
    console.error(`Error executing command ${command}:`, error);
    message.reply('There was an error executing that command.');
  }
});

client.on('interactionCreate', async interaction => {
  try {
    if (interaction.isButton()) {
      await handleButtonInteraction(interaction);
    } else if (interaction.isCommand()) {
      const command = interaction.commandName;
      switch (command) {
        case 'setupreaction':
          await setupQueueMessage(interaction);
          break;
        case 'eloreset':
          await eloresetCommand(interaction);
          break;
        case 'warningreset':
          await warningresetCommand(interaction);
          break;
        case 'leaderboard':
          await leaderboardCommand(interaction);
          break;
        default:
          await interaction.reply({ content: 'Unknown command interaction.', ephemeral: true });
          break;
      }
    }
  } catch (error) {
    console.error('Error handling interaction:', error);
    if (interaction.isCommand() || interaction.isButton()) {
      await interaction.reply({ content: 'There was an error handling this interaction.', ephemeral: true });
    }
  }
});


const setupQueueMessage = async () => {
  try {
    const channel = await client.channels.fetch(process.env.QUEUE_CHANNEL_ID);
    const embed = new EmbedBuilder()
      .setColor('#00ff26') // Set a custom color for the embed
      .setTitle('🎮 CSL West Competitive Queue 🎮')
      .setDescription('Use the buttons below to join or leave the queue.\n\n**Current Queue:**\nNo one in the queue (0/10)')
      .setFooter({ text: 'Powered by Maverick', iconURL: 'https://i.imgur.com/wTF3RuJ.png' }); // Set an icon for the footer if you have one

    const row = new ActionRowBuilder()
      .addComponents(
        new ButtonBuilder()
          .setCustomId('join_queue')
          .setLabel('Join Queue')
          .setStyle(ButtonStyle.Success)
          .setEmoji('✅'), // Add an emoji to the button
        new ButtonBuilder()
          .setCustomId('leave_queue')
          .setLabel('Leave Queue')
          .setStyle(ButtonStyle.Danger)
          .setEmoji('❌') // Add an emoji to the button
      );

    await channel.send({ embeds: [embed], components: [row] });
  } catch (error) {
    console.error('Error setting up queue message:', error);
  }
};

const joinQueue = async (interaction) => {
  try {
    await interaction.deferReply({ ephemeral: true });

    const user = interaction.user;
    if (!queue.includes(user.id)) {
      queue.push(user.id);
      await updateQueueMessage();
      if (queue.length === 10) {
        await createMatch(interaction.guild);
      }
      await interaction.editReply({ content: 'You have joined the queue!' });
    } else {
      await interaction.editReply({ content: 'You are already in the queue!' });
    }
  } catch (error) {
    console.error('Error joining queue:', error);
    if (!interaction.replied) {
      await interaction.editReply({ content: 'There was an error joining the queue.' });
    }
  }
};

const leaveQueue = async (interaction) => {
  try {
    await interaction.deferReply({ ephemeral: true });

    const user = interaction.user;
    const index = queue.indexOf(user.id);
    if (index > -1) {
      queue.splice(index, 1);
      await updateQueueMessage();
      await interaction.editReply({ content: 'You have left the queue!' });
    } else {
      await interaction.editReply({ content: 'You are not in the queue!' });
    }
  } catch (error) {
    console.error('Error leaving queue:', error);
    if (!interaction.replied) {
      await interaction.editReply({ content: 'There was an error leaving the queue.' });
    }
  }
};

const updateQueueMessage = async () => {
  try {
    const channel = await client.channels.fetch(process.env.QUEUE_CHANNEL_ID);
    const messages = await channel.messages.fetch({ limit: 10 });
    const queueMessage = messages.find(msg => msg.embeds[0]?.title === '🎮 CSL West Competitive Queue 🎮');

    if (queueMessage) {
      const description = queue.length > 0 
        ? `${queue.map(id => `<@${id}>`).join('\n')}\n\n**(${queue.length}/10)**`
        : 'No one in the queue (0/10)';

      const embed = new EmbedBuilder()
        .setColor('#00ff26')
        .setTitle('🎮 CSL West Competitive Queue 🎮')
        .setDescription(`Use the buttons below to join or leave the queue.\n\n**Current Queue:**\n${description}`)
        .setFooter({ text: 'Powered by Maverick', iconURL: 'https://i.imgur.com/wTF3RuJ.png' });

      const row = new ActionRowBuilder()
        .addComponents(
          new ButtonBuilder()
            .setCustomId('join_queue')
            .setLabel('Join Queue')
            .setStyle(ButtonStyle.Success)
            .setEmoji('✅'),
          new ButtonBuilder()
            .setCustomId('leave_queue')
            .setLabel('Leave Queue')
            .setStyle(ButtonStyle.Danger)
            .setEmoji('❌')
        );

      await queueMessage.edit({ embeds: [embed], components: [row] });
    }
  } catch (error) {
    console.error('Error updating queue message:', error);
  }
};

const createMatch = async (guild) => {
  try {
    const matchCategory = guild.channels.cache.get(process.env.MATCH_CATEGORY_ID);
    const team1Voice = await guild.channels.create({
      name: `Match ${matchCounter} - Team 1`,
      type: ChannelType.GuildVoice,
      parent: matchCategory,
      userLimit: 6,
      permissionOverwrites: [
        {
          id: guild.roles.everyone.id,
          allow: [PermissionsBitField.Flags.Connect],
        },
      ],
    });
    const team2Voice = await guild.channels.create({
      name: `Match ${matchCounter} - Team 2`,
      type: ChannelType.GuildVoice,
      parent: matchCategory,
      userLimit: 6,
      permissionOverwrites: [
        {
          id: guild.roles.everyone.id,
          allow: [PermissionsBitField.Flags.Connect],
        },
      ],
    });
    const matchText = await guild.channels.create({
      name: `match-${matchCounter}`,
      type: ChannelType.GuildText,
      parent: matchCategory,
      permissionOverwrites: [
        {
          id: guild.roles.everyone.id,
          allow: [PermissionsBitField.Flags.ViewChannel, PermissionsBitField.Flags.SendMessages],
        },
      ],
    });

    const team1Captain = queue.shift();
    const team2Captain = queue.shift();
    const remainingPlayers = queue.splice(0, 8);
    const randomMap = maps[Math.floor(Math.random() * maps.length)];
    matches[matchCounter] = {
      team1: [team1Captain],
      team2: [team2Captain],
      remaining: remainingPlayers,
      pickingOrder: ['team1', 'team2', 'team2', 'team1', 'team1', 'team2', 'team1'],
      currentPick: 0,
      mapVotes: {}, // Ensure mapVotes is initialized
      chosenMap: randomMap
    };

    console.log(`Match ${matchCounter} created with map ${randomMap}`);

    await updateQueueMessage();
    await updateMatchMessage(matchCounter);

    // Start voting timer
    setTimeout(async () => {
      if (!matches[matchCounter]) return; // Match might have ended or been cancelled
      const mostVotedMap = Object.entries(matches[matchCounter].mapVotes)
        .reduce((max, entry) => entry[1] > max[1] ? entry : max, ['', 0])[0];
      if (mostVotedMap) {
        matches[matchCounter].chosenMap = mostVotedMap;
      }
      await updateMatchMessage(matchCounter);
    }, 5 * 60 * 1000); // 5 minutes

    matchCounter++;
  } catch (error) {
    console.error('Error creating match:', error);
  }
};

const updateMatchMessage = async (matchNumber) => {
  try {
    const match = matches[matchNumber];
    const matchText = client.channels.cache.find(channel => channel.name === `match-${matchNumber}`);
    if (!matchText) return;

    const team1 = match.team1.map(id => `<@${id}>`).join('\n') || 'No players yet';
    const team2 = match.team2.map(id => `<@${id}>`).join('\n') || 'No players yet';
    const embed = new EmbedBuilder()
      .setTitle(`🎮 Match ${matchNumber} 🎮`)
      .setColor('#ff4500')
      .setDescription('**Match Details**')
      .addFields(
        { name: '🏆 Team 1 Captain', value: `<@${match.team1[0]}>`, inline: true },
        { name: '🏆 Team 2 Captain', value: `<@${match.team2[0]}>`, inline: true },
        { name: '\u200B', value: '\u200B', inline: true },
        { name: '👥 Team 1', value: team1, inline: true },
        { name: '👥 Team 2', value: team2, inline: true },
        { name: '🗺️ Map', value: `**${match.chosenMap}**`, inline: true }
      )
      .setThumbnail('https://i.imgur.com/xfe96CL.png')
      .setImage('https://i.imgur.com/jyuglDa.png')
      .setFooter({ text: 'Powered by Maverick', iconURL: 'https://i.imgur.com/wTF3RuJ.png' })
      .setTimestamp();

    const playerPickRows = [];
    for (let i = 0; i < match.remaining.length; i += 5) {
      const row = new ActionRowBuilder()
        .addComponents(
          await Promise.all(
            match.remaining.slice(i, i + 5).map(async playerId => {
              const member = await client.guilds.cache.get(matchText.guild.id).members.fetch(playerId);
              const nickname = member.nickname || member.user.username;
              return new ButtonBuilder()
                .setCustomId(`pick_${matchNumber}_${playerId}`)
                .setLabel(`Pick ${nickname}`)
                .setStyle(ButtonStyle.Primary);
            })
          )
        );
      playerPickRows.push(row);
    }

    const mapVoteRows = [];
    for (let i = 0; i < maps.length; i += 5) {
      const row = new ActionRowBuilder()
        .addComponents(
          maps.slice(i, i + 5).map(map => new ButtonBuilder()
            .setCustomId(`map_vote_${matchNumber}_${map}`)
            .setLabel(`${map} (${match.mapVotes[map] || 0})`)
            .setStyle(ButtonStyle.Secondary)
          )
        );
      mapVoteRows.push(row);
    }

    const messages = await matchText.messages.fetch({ limit: 10 });
    const matchMessage = messages.find(msg => msg.embeds[0]?.title === `🎮 Match ${matchNumber} 🎮`);
    if (matchMessage) {
      try {
        await matchMessage.delete();
      } catch (error) {
        console.error(`Failed to delete message: ${error.message}`);
      }
    }
    await matchText.send({ embeds: [embed], components: [...playerPickRows, ...mapVoteRows] });
  } catch (error) {
    console.error('Error updating match message:', error);
  }
};

const handleButtonInteraction = async (interaction) => {
  try {
    const customId = interaction.customId;

    if (customId.startsWith('map_vote_')) {
      await voteMap(interaction);
    } else if (customId.startsWith('join_queue')) {
      await joinQueue(interaction);
    } else if (customId.startsWith('leave_queue')) {
      await leaveQueue(interaction);
    } else if (customId.startsWith('pick_')) {
      await handlePick(interaction);
    } else {
      await interaction.reply({ content: 'Unknown button interaction.', ephemeral: true });
    }
  } catch (error) {
    console.error('Error handling button interaction:', error);
    await interaction.reply({ content: 'There was an error handling this button interaction.', ephemeral: true });
  }
};

const handlePick = async (interaction) => {
  try {
    const [_, matchNumber, playerId] = interaction.customId.split('_');
    const match = matches[matchNumber];

    if (!match) {
      await interaction.reply({ content: `Match ${matchNumber} not found.`, ephemeral: true });
      return;
    }

    const user = interaction.user;
    const currentPickTeam = match.pickingOrder[match.currentPick];
    const isCaptain = (user.id === match.team1[0] && currentPickTeam === 'team1') || 
                      (user.id === match.team2[0] && currentPickTeam === 'team2');

    if (!isCaptain) {
      await interaction.reply({ content: 'Only the respective captain can pick for their team on their turn.', ephemeral: true });
      return;
    }

    const team = match.pickingOrder[match.currentPick];
    if (!team) {
      await interaction.reply({ content: 'Invalid picking order.', ephemeral: true });
      return;
    }

    match[team].push(playerId);
    match.remaining = match.remaining.filter(id => id !== playerId);
    match.currentPick++;

    // Automatically assign the last player to team 2
    if (match.currentPick === match.pickingOrder.length && match.remaining.length === 1) {
      match.team2.push(match.remaining[0]);
      match.remaining = [];
    }

    await updateMatchMessage(matchNumber);
    await interaction.reply({ content: `Player <@${playerId}> has been picked for ${team === 'team1' ? 'Team 1' : 'Team 2'}.`, ephemeral: true });
  } catch (error) {
    console.error('Error handling pick:', error);
    await interaction.reply({ content: 'There was an error handling the pick.', ephemeral: true });
  }
};


const voteMap = async (interaction) => {
  try {
    const [_, matchNumber, map] = interaction.customId.split('_');

    if (!matchNumber || isNaN(matchNumber) || matchNumber < 1) {
      console.error(`Invalid matchNumber: ${matchNumber}`);
      await interaction.reply({ content: 'Invalid match number.', ephemeral: true });
      return;
    }

    const match = matches[matchNumber];
    if (!match) {
      console.error(`Match ${matchNumber} not found.`);
      await interaction.reply({ content: `Match ${matchNumber} not found.`, ephemeral: true });
      return;
    }

    if (!match.mapVotes) match.mapVotes = {};
    if (!match.mapVotes[map]) match.mapVotes[map] = 0;
    match.mapVotes[map]++;

    const mostVotedMap = Object.entries(match.mapVotes).reduce((max, entry) => entry[1] > max[1] ? entry : max, ['', 0])[0];
    match.chosenMap = mostVotedMap;

    await interaction.reply({ content: `Your vote for ${map} has been recorded!`, ephemeral: true });
    await updateMatchMessage(matchNumber);
  } catch (error) {
    console.error('Error voting map:', error);
    await interaction.reply({ content: 'There was an error voting for the map.', ephemeral: true });
  }
};

const findUserMatch = (userId) => {
  for (const [id, match] of Object.entries(matches)) {
      if (match.team1.includes(userId) || match.team2.includes(userId) || match.remaining.includes(userId)) {
          return id;
      }
  }
  return null;
};

const reportCommand = async (message, args) => {
  const roles = [PermissionsBitField.Flags.Administrator, '1075756565023445022', '1258877265870192673'];
  if (!message.member.permissions.has(PermissionsBitField.Flags.Administrator) &&
    !message.member.roles.cache.has(roles[1]) &&
    !message.member.roles.cache.has(roles[2])) {
    return message.reply('You do not have permission to use this command.');
  }
  try {
    const matchId = findUserMatch(message.author.id);
    const winningTeamNumber = args[0];
    if (!matchId || !matches[matchId]) {
      return message.reply('You are not in any active match.');
    }
    const match = matches[matchId];
    const team1 = match.team1;
    const team2 = match.team2;
    let winningTeam, losingTeam;
    if (winningTeamNumber === '1') {
      winningTeam = team1;
      losingTeam = team2;
      updateElo(team1, team2);
      updateStats(team1, team2, match.chosenMap, true);
    } else if (winningTeamNumber === '2') {
      winningTeam = team2;
      losingTeam = team1;
      updateElo(team2, team1);
      updateStats(team2, team1, match.chosenMap, true);
    } else {
      return message.reply('Invalid winning team.');
    }

    await message.reply(`Match ${matchId} has been reported and the channels will be deleted.`);

    const guild = message.guild;
    const matchCategory = await guild.channels.fetch(process.env.MATCH_CATEGORY_ID);
    const team1Voice = matchCategory.children.cache.find(c => c.name === `Match ${matchId} - Team 1`);
    const team2Voice = matchCategory.children.cache.find(c => c.name === `Match ${matchId} - Team 2`);
    const matchText = matchCategory.children.cache.find(c => c.name === `match-${matchId}`);
    if (team1Voice) await team1Voice.delete();
    if (team2Voice) await team2Voice.delete();
    if (matchText) await matchText.delete();

    delete matches[matchId];

    const reporter = message.author;
    logMatch(matchId, winningTeam, losingTeam, `Team ${winningTeamNumber}`, reporter);
  } catch (error) {
    console.error('Error reporting match:', error);
    message.reply('There was an error reporting the match.');
  }
};


const updateStats = (winningTeam, losingTeam, map, isWin) => {
  [...winningTeam, ...losingTeam].forEach(player => {
    if (!playerStats[player]) playerStats[player] = { BW: { wins: 0, losses: 0 }, PORT: { wins: 0, losses: 0 }, ANK: { wins: 0, losses: 0 }, COMP: { wins: 0, losses: 0 }, SB: { wins: 0, losses: 0 }, MEX: { wins: 0, losses: 0 }, EE: { wins: 0, losses: 0 } };

    if (winningTeam.includes(player)) {
      playerStats[player][map].wins++;
    } else {
      playerStats[player][map].losses++;
    }
  });

  saveData();
};



const clearQueueCommand = async (message) => {
  if (!message.member.permissions.has(PermissionsBitField.Flags.Administrator)) {
    return message.reply('You do not have permission to use this command.');
  }

  try {
    queue = [];
    await updateQueueMessage();
    message.reply('The queue has been cleared.');
  } catch (error) {
    console.error('Error clearing queue:', error);
    message.reply('There was an error clearing the queue.');
  }
};

const resetEloCommand = async (message) => {
  if (!message.member.permissions.has(PermissionsBitField.Flags.Administrator)) {
    return message.reply('You do not have permission to use this command.');
  }

  try {
    playersELO = {};
    saveData();
    message.reply('All ELO has been reset.');
  } catch (error) {
    console.error('Error resetting ELO:', error);
    message.reply('There was an error resetting the ELO.');
  }
};

const warningResetCommand = async (message) => {
  if (!message.member.permissions.has(PermissionsBitField.Flags.Administrator)) {
    return message.reply('You do not have permission to use this command.');
  }

  try {
    playerWarnings = {};
    saveData();
    message.reply('All warnings have been reset.');
  } catch (error) {
    console.error('Error resetting warnings:', error);
    message.reply('There was an error resetting the warnings.');
  }
};

const setMatchLogChannelCommand = async (message, args) => {
  if (!message.member.permissions.has(PermissionsBitField.Flags.Administrator)) {
    return message.reply('You do not have permission to use this command.');
  }

  try {
    const channelId = args[0];
    process.env.MATCH_LOG_CHANNEL_ID = channelId;
    message.reply('Match log channel set.');
  } catch (error) {
    console.error('Error setting match log channel:', error);
    message.reply('There was an error setting the match log channel.');
  }
};

const giveEloCommand = async (message, args) => {
  if (!message.member.permissions.has(PermissionsBitField.Flags.Administrator)) {
    return message.reply('You do not have permission to use this command.');
  }

  try {
    const userId = args[0].replace('<@', '').replace('>', '');
    const eloChange = parseInt(args[1], 10);

    if (!playersELO[userId]) playersELO[userId] = 0;
    playersELO[userId] += eloChange;

    saveData();
    message.reply(`ELO for <@${userId}> has been changed by ${eloChange}. New ELO: ${playersELO[userId]}`);
  } catch (error) {
    console.error('Error giving ELO:', error);
    message.reply('There was an error changing the ELO.');
  }
};

const warnCommand = async (message, args) => {
  const roles = [PermissionsBitField.Flags.Administrator, '1075756565023445022'];
  if (!message.member.permissions.has(PermissionsBitField.Flags.Administrator) &&
    !message.member.roles.cache.has(roles[1])) {
    return message.reply('You do not have permission to use this command.');
  }

  try {
    // Check if a user is mentioned and extract the user ID
    if (!args[0] || !args[0].match(/^<@!?(\d+)>$/)) {
      return message.reply('Please mention a valid user to warn.');
    }

    const userId = args[0].replace('<@', '').replace('>', '');
    const reason = args.slice(1).join(' ') || 'No reason provided';

    // Initialize warnings if the user has none
    if (!playerWarnings[userId]) {
      playerWarnings[userId] = { count: 0, reasons: [] };
    }

    // Increment the warning count and add the reason
    playerWarnings[userId].count += 1;
    playerWarnings[userId].reasons.push(reason);
    saveData();

    const embed = new EmbedBuilder()
      .setColor('#ff4500') // Orange-red color suitable for a competitive FPS theme
      .setTitle('User Warned')
      .addFields(
        { name: 'User', value: `<@${userId}>`, inline: true },
        { name: 'Warnings', value: playerWarnings[userId].count.toString(), inline: true },
        { name: 'Reason', value: reason, inline: true }
      )
      .setThumbnail('https://i.imgur.com/wTF3RuJ.png') // Placeholder thumbnail, replace with relevant image
      .setFooter({ text: 'Stay in line, soldier!', iconURL: 'https://i.imgur.com/wTF3RuJ.png' })
      .setTimestamp();

    message.reply({ embeds: [embed] });
  } catch (error) {
    console.error('Error warning user:', error);
    message.reply('There was an error warning the user.');
  }
};


const warnsCommand = async (message, args) => {
  const roles = [PermissionsBitField.Flags.Administrator, '1075756565023445022'];
  if (!message.member.permissions.has(PermissionsBitField.Flags.Administrator) &&
    !message.member.roles.cache.has(roles[1])) {
    return message.reply('You do not have permission to use this command.');
  }
  try {
    const userId = args[0] ? args[0].replace('<@', '').replace('>', '') : message.author.id;
    const userWarnings = playerWarnings[userId] ? playerWarnings[userId].count : 0;
    const reasons = playerWarnings[userId] ? playerWarnings[userId].reasons : [];
    const username = message.mentions.users.first() ? message.mentions.users.first().username : message.author.username;

    const embed = new EmbedBuilder()
      .setColor('#ff4500') // Orange-red color suitable for a competitive FPS theme
      .setTitle(`${username}'s Warnings`)
      .addFields(
        { name: 'Warnings', value: userWarnings.toString(), inline: true },
        { name: 'Reasons', value: reasons.length > 0 ? reasons.join('\n') : 'No warnings', inline: true }
      )
      .setThumbnail('https://i.imgur.com/wTF3RuJ.png') // Placeholder thumbnail, replace with relevant image
      .setFooter({ text: 'Stay in line, soldier!', iconURL: 'https://i.imgur.com/wTF3RuJ.png' })
      .setTimestamp();

    message.reply({ embeds: [embed] });
  } catch (error) {
    console.error('Error fetching warnings:', error);
    message.reply('There was an error fetching the warnings.');
  }
};

const profileCommand = async (message, args) => {
  const userId = args[0] ? args[0].replace('<@', '').replace('>', '') : message.author.id;
  const user = await message.guild.members.fetch(userId);
  const username = user.nickname || user.user.username;
  const elo = playersELO[userId] || 0;
  const userKarma = karma[userId] || 0;
  const stats = playerStats[userId] || {};

  const defaultMapStats = { wins: 0, losses: 0 };
  const maps = {
    BW: stats.BW || defaultMapStats,
    PORT: stats.PORT || defaultMapStats,
    ANK: stats.ANK || defaultMapStats,
    COMP: stats.COMP || defaultMapStats,
    SB: stats.SB || defaultMapStats,
    MEX: stats.MEX || defaultMapStats,
    EE: stats.EE || defaultMapStats
  };

  const totalWins = Object.values(maps).reduce((acc, map) => acc + map.wins, 0);
  const totalLosses = Object.values(maps).reduce((acc, map) => acc + map.losses, 0);

  const embed = new EmbedBuilder()
    .setTitle(`${username}'s Profile`)
    .setThumbnail(user.user.displayAvatarURL({ dynamic: true }))
    .addFields(
      { name: 'ELO', value: elo.toString(), inline: true },
      { name: 'Karma', value: userKarma.toString(), inline: true },
      { name: '\u200B', value: '\u200B', inline: true }
    )
    .addFields(
      { name: 'Map Stats:', value: '\u200B' },
      { name: 'Black Widow', value: `${maps.BW.wins} wins ${maps.BW.losses} losses`, inline: true },
      { name: 'Port', value: `${maps.PORT.wins} wins ${maps.PORT.losses} losses`, inline: true },
      { name: 'Ankara', value: `${maps.ANK.wins} wins ${maps.ANK.losses} losses`, inline: true },
      { name: 'Compound', value: `${maps.COMP.wins} wins ${maps.COMP.losses} losses`, inline: true },
      { name: 'Sub Base', value: `${maps.SB.wins} wins ${maps.SB.losses} losses`, inline: true },
      { name: 'Mexico', value: `${maps.MEX.wins} wins ${maps.MEX.losses} losses`, inline: true },
      { name: 'Eagle Eye', value: `${maps.EE.wins} wins ${maps.EE.losses} losses`, inline: true },
      { name: 'Total Wins', value: totalWins.toString(), inline: true },
      { name: 'Total Losses', value: totalLosses.toString(), inline: true }
    )
    .setColor('#ff4500')
    .setFooter({ text: 'FPS Game Stats', iconURL: 'https://i.imgur.com/wTF3RuJ.png' })
    .setTimestamp();

  message.reply({ embeds: [embed] });
};

const leaderboardCommand = async (message) => {
  try {
    const sortedPlayers = Object.entries(playersELO).sort((a, b) => b[1] - a[1]).slice(0, 25);
    const leaderboard = await Promise.all(
      sortedPlayers.map(async ([userId, elo], index) => {
        const user = await message.guild.members.fetch(userId).catch(() => null);
        return `#${index + 1}  |  ${elo}  |  ${user ? `<@${user.id}>` : `Unknown User`}`;
      })
    );

    if (leaderboard.length === 0) {
      leaderboard.push('No players available');
    }

    const embed = new EmbedBuilder()
      .setColor('#00ff26') // Set a custom color for the embed
      .setTitle('Top 25 Pug Players')
      .addFields({ name: 'Rank | Elo | Player', value: leaderboard.join('\n') })
      .setFooter({ text: 'Use .lb or .leaderboard to see the leaderboard at any time', iconURL: 'https://i.imgur.com/wTF3RuJ.png' })
      .setTimestamp();

    message.reply({ embeds: [embed] });
  } catch (error) {
    console.error('Error fetching leaderboard:', error);
    message.reply('There was an error fetching the leaderboard.');
  }
};

const eloCommand = async (message, args) => {
  try {
    const userId = args[0] ? args[0].replace('<@', '').replace('>', '') : message.author.id;
    const elo = playersELO[userId] || 0;
    message.reply(`<@${userId}> has ${elo} ELO.`);
  } catch (error) {
    console.error('Error fetching ELO:', error);
    message.reply('There was an error fetching the ELO.');
  }
};

const pickCommand = async (message, args) => {
  try {
    if (!args[0] || !args[0].match(/^<@!?(\d+)>$/)) {
      return message.reply('Please mention a valid user to pick.');
    }

    const playerId = args[0].replace('<@', '').replace('>', '');
    const userId = message.author.id;
    const matchId = findUserMatch(userId);

    if (!matchId) {
      return message.reply('You are not part of any active matches.');
    }

    const match = matches[matchId];
    const currentPickIndex = match.team1.length + match.team2.length - 2;

    if (currentPickIndex >= match.pickingOrder.length) {
      return message.reply('All picks have already been made.');
    }

    const pickingTeam = match.pickingOrder[currentPickIndex] === 'team1' ? 'team1' : 'team2';

    if (!match.remaining.includes(playerId)) {
      return message.reply('Invalid player ID for picking.');
    }

    match[pickingTeam].push(playerId);
    match.remaining = match.remaining.filter(id => id !== playerId);

    await updateMatchMessage(matchId);

    message.reply(`Player <@${playerId}> picked for ${pickingTeam === 'team1' ? 'Team 1' : 'Team 2'}.`);
  } catch (error) {
    console.error('Error picking player:', error);
    message.reply('There was an error picking the player.');
  }
};

const needSubCommand = async (message, args) => {
  const roles = ['1255072045574652035', '1075756565023445022', '1258877265870192673'];
  if (!message.member.permissions.has(PermissionsBitField.Flags.Administrator) &&
      !roles.some(role => message.member.roles.cache.has(role))) {
    return message.reply('You do not have permission to use this command.');
  }

  try {
    if (!args[0] || !args[0].match(/^<@!?(\d+)>$/)) {
      return message.reply('Please mention a valid user to sub.');
    }

    const userId = message.author.id;
    const playerId = args[0].replace('<@', '').replace('>', '');
    const matchId = findUserMatch(userId);

    if (!matchId) {
      return message.reply('You are not part of any active matches.');
    }

    const match = matches[matchId];
    const team = match.team1.includes(playerId) ? 'team1' : 'team2';
    const playerIndex = match[team].indexOf(playerId);

    if (playerIndex === -1) {
      return message.reply('Player not found in any team.');
    }

    const subMessage = await message.channel.send(`<@${playerId}> has requested a substitution. React with ❌ within 2 minutes if you are still here.`);
    await subMessage.react('❌');

    const filter = (reaction, user) => reaction.emoji.name === '❌' && user.id === playerId;
    const collector = subMessage.createReactionCollector({ filter, time: 120000 });

    collector.on('collect', () => {
      subMessage.edit(`<@${playerId}> is still active.`);
      collector.stop();
    });

    collector.on('end', async collected => {
      if (collected.size === 0) {
        const newPlayerId = queue.shift();
        if (!newPlayerId) {
          return message.channel.send('No available substitutes in the queue.');
        }

        match[team][playerIndex] = newPlayerId;
        await updateMatchMessage(matchId);

        message.channel.send(`<@${playerId}> has been substituted by <@${newPlayerId}> in ${team === 'team1' ? 'Team 1' : 'Team 2'}.`);
      }
    });
  } catch (error) {
    console.error('Error handling substitution:', error);
    message.reply('There was an error handling the substitution.');
  }
};

const replaceCommand = async (message, args) => {
  const roles = [PermissionsBitField.Flags.Administrator, '1075756565023445022'];
  if (!message.member.permissions.has(PermissionsBitField.Flags.Administrator) &&
    !message.member.roles.cache.has(roles[1])) {
    return message.reply('You do not have permission to use this command.');
  }
  try {
    if (args.length < 2 || !args[0].match(/^<@!?(\d+)>$/) || !args[1].match(/^<@!?(\d+)>$/)) {
      return message.reply('Please mention the old player and the new player in the correct format.');
    }

    const oldPlayerId = args[0].replace('<@', '').replace('>', '');
    const newPlayerId = args[1].replace('<@', '').replace('>', '');
    const userId = message.author.id;
    const matchId = findUserMatch(userId);

    if (!matchId) {
      return message.reply('You are not part of any active matches.');
    }

    const match = matches[matchId];
    const team = match.team1.includes(oldPlayerId) ? 'team1' : match.team2.includes(oldPlayerId) ? 'team2' : null;

    if (!team) {
      return message.reply('Old player is not found in any team.');
    }

    const playerIndex = match[team].indexOf(oldPlayerId);

    if (playerIndex === -1) {
      return message.reply('Old player not found in the team.');
    }

    match[team][playerIndex] = newPlayerId;

    await updateMatchMessage(matchId);

    message.reply(`Player <@${oldPlayerId}> has been replaced by <@${newPlayerId}> in ${team === 'team1' ? 'Team 1' : 'Team 2'}.`);
  } catch (error) {
    console.error('Error replacing player:', error);
    message.reply('There was an error replacing the player.');
  }
};

const ptCommand = async (message, args) => {
  const roles = [PermissionsBitField.Flags.Administrator, '1075756565023445022', '1258877265870192673'];
  if (!message.member.permissions.has(PermissionsBitField.Flags.Administrator) &&
    !message.member.roles.cache.has(roles[1]) &&
    !message.member.roles.cache.has(roles[2])) {
    return message.reply('You do not have permission to use this command.');
  }
  try {
    if (args.length < 1) {
      return message.reply('Please specify the team number (1, 2, or 0) and an optional message.');
    }

    const userId = message.author.id;
    const teamNumber = parseInt(args[0]);

    if (isNaN(teamNumber) || (teamNumber < 0 || teamNumber > 2)) {
      return message.reply('Invalid team number. Use 1 for Team 1, 2 for Team 2, or 0 for both teams.');
    }

    const additionalMessage = args.slice(1).join(' ');

    const matchId = findUserMatch(userId);

    if (!matchId) {
      return message.reply('You are not part of any active matches.');
    }

    const match = matches[matchId];
    let teamMentions = '';

    if (teamNumber === 0) {
      const allTeams = [...match.team1, ...match.team2];
      teamMentions = allTeams.map(id => `<@${id}>`).join(' ');
    } else if (teamNumber === 1) {
      teamMentions = match.team1.map(id => `<@${id}>`).join(' ');
    } else if (teamNumber === 2) {
      teamMentions = match.team2.map(id => `<@${id}>`).join(' ');
    }

    const finalMessage = `${teamMentions} ${additionalMessage}`;

    try {
      const matchCategory = await message.client.channels.fetch(process.env.MATCH_CATEGORY_ID);
      const matchText = matchCategory.children.cache.find(c => c.name === `match-${matchId}`);
      if (!matchText) {
        return message.reply('Match text channel not found.');
      }
      await matchText.send(finalMessage);
      message.reply('Message sent.');
    } catch (error) {
      console.error('Error sending message:', error);
      message.reply('There was an error sending the message. Please try again later.');
    }
  } catch (error) {
    console.error('Error in PT command:', error);
    message.reply('There was an error executing the PT command.');
  }
};

const cancelMatchCommand = async (message) => {
  const roles = [PermissionsBitField.Flags.Administrator, '1075756565023445022', '1258877265870192673'];
  if (!message.member.permissions.has(PermissionsBitField.Flags.Administrator) &&
      !roles.some(role => message.member.roles.cache.has(role))) {
    return message.reply('You do not have permission to use this command.');
  }

  try {
    const userId = message.author.id;
    const matchId = findUserMatch(userId);

    if (!matchId) {
      return message.reply('You are not part of any active matches.');
    }

    const match = matches[matchId];
    delete matches[matchId];

    const guild = message.guild;
    const matchCategory = guild.channels.cache.get(process.env.MATCH_CATEGORY_ID);

    const team1Voice = matchCategory.children.cache.find(c => c.name === `Match ${matchId} - Team 1`);
    const team2Voice = matchCategory.children.cache.find(c => c.name === `Match ${matchId} - Team 2`);
    const matchText = matchCategory.children.cache.find(c => c.name === `match-${matchId}`);

    if (team1Voice) await team1Voice.delete();
    if (team2Voice) await team2Voice.delete();
    if (matchText) await matchText.delete();

    message.reply(`Match ${matchId} has been canceled.`);
  } catch (error) {
    console.error('Error canceling match:', error);
    message.reply('There was an error canceling the match.');
  }
};


const suspendUserCommand = async (message, args) => {
  try {
    const userId = args[0].replace('<@', '').replace('>', '');
    const duration = parseInt(args[1]); // Duration in minutes
    const reason = args.slice(2).join(' ');

    if (!karma[userId]) karma[userId] = {};
    karma[userId].suspendedUntil = Date.now() + duration * 60000;
    karma[userId].reason = reason;
    saveData();

    message.reply(`<@${userId}> has been suspended for ${duration} minutes. Reason: ${reason}`);
  } catch (error) {
    console.error('Error suspending user:', error);
    message.reply('There was an error suspending the user.');
  }
};

const unSuspendUserCommand = async (message, args) => {
  const roles = [PermissionsBitField.Flags.Administrator, '1075756565023445022'];
  if (!message.member.permissions.has(PermissionsBitField.Flags.Administrator) &&
    !message.member.roles.cache.has(roles[1])) {
    return message.reply('You do not have permission to use this command.');
  }
  try {
    const userId = args[0].replace('<@', '').replace('>', '');

    if (karma[userId] && karma[userId].suspendedUntil) {
      delete karma[userId].suspendedUntil;
      delete karma[userId].reason;
      saveData();
      message.reply(`<@${userId}>'s suspension has been lifted.`);
    } else {
      message.reply(`<@${userId}> is not currently suspended.`);
    }
  } catch (error) {
    console.error('Error unsuspending user:', error);
    message.reply('There was an error lifting the suspension.');
  }
};

const saveData = () => {
  const data = { playersELO, playerWarnings, karma, playerStats };
  fs.writeFileSync(dataFilePath, JSON.stringify(data, null, 2), 'utf-8');
};

const logMatch = (matchId, winningTeam, losingTeam, result, reporter) => {
  const logChannel = client.channels.cache.get(process.env.MATCH_LOG_CHANNEL_ID);

  if (!logChannel) {
    console.error('Match log channel not found');
    return;
  }

  const embed = new EmbedBuilder()
    .setTitle(`Match #${matchId} Log`)
    .setColor('#ff4500') // Orange-red color suitable for a competitive FPS theme
    .addFields(
      { name: 'Winners | Team 1', value: winningTeam.map(id => `<@${id}>`).join(' '), inline: true },
      { name: 'Losers | Team 2', value: losingTeam.map(id => `<@${id}>`).join(' '), inline: true },
      { name: 'Reported by', value: `${reporter.username}#${reporter.discriminator} (${reporter.id})` }
    )
    .setFooter({ text: 'Powered by Maverick', iconURL: 'https://i.imgur.com/wTF3RuJ.png' })
    .setTimestamp();

  logChannel.send({ embeds: [embed] });
};

const updateElo = (winningTeam, losingTeam) => {
  winningTeam.forEach(player => {
    if (!playersELO[player]) playersELO[player] = 50;
    playersELO[player] += 6;
  });

  losingTeam.forEach(player => {
    if (!playersELO[player]) playersELO[player] = 50;
    playersELO[player] -= 5;
  });

  saveData();
};

const registerCommands = () => {
  const commands = [
    {
      name: 'setupreaction',
      description: 'Recreates the reaction message to join the queue',
      type: 1,
    },
    {
      name: 'eloreset',
      description: 'Resets all ELO, must be superuser',
      type: 1,
    },
    {
      name: 'warningreset',
      description: 'Resets all warnings, must be admin',
      type: 1,
    },
    {
      name: 'leaderboard',
      description: 'Leaderboard in the stats channel',
      type: 1,
    }
  ];

  const guild = client.guilds.cache.first();
  guild.commands.set(commands).then(() => console.log('Commands registered'));
};

client.login(process.env.DISCORD_TOKEN);
$ snap install hello-world
hello-world 6.4 from Canonical✓ installed
$ hello-world
Hello World!
const user = {
  
  "intro":  {
    "name" : "Saud",
    "age" : 20,
    "qualification": "BS Computer"
  },
  
  "address": {
    "country" : "Pakistan",
    "province" : "KP",
    "city" : "Mardan"
  },
  
  userIntro(){
    return `Name: ${this.intro.name}, age: ${this.intro.age}, qualification: ${this.intro.qualification}`;
  },

  userAddress(){
    return `country: ${this.address.country}, province: ${this.address.province}, city: ${this.address.city}`
  }
}

// let name = user.intro.name;
// console.log(name);

let userData = user.userIntro();
console.log(userData);

let addressData = user.userAddress()
console.log(addressData);

  content: ["./app/**/*.{js,jsx,ts,tsx}", "./components/**/*.{js,jsx,ts,tsx}"],

   
   
   
   
   da babelshi es --> 
     
  plugins: ["nativewind/babel"],
a=str(input("enter name"))
b=str(input("enter address"))
c=str(input("enter gmail"))
d=int(input("enter phone number"))
print(a,b,c,d)
import math
x1=int(input("enter x1"))
y1=int(input("enter y1"))
x2=int(input("enter x2"))
y2=int(input("enter y2"))
d=math.sqrtd=math.sqrt((x1-x2)**2+(y1-y2)**2)
print (d)
principal=int(input("enter principal"))
rate=int(input("enter rate"))
time=int(input("enter time"))
a=principal*((1+rate)/100**time)
print(a)
a=int(input("enter a"))
b=int(input("enter b"))
o=input("enter the o")
if(o=='+'):
    print(a+b)
if(o=='-'):
    print(a-b)
if(o=='/'):
    print(a/b)
if(o=='*'):
    print(a*b)
 npx expo install expo-router react-native-safe-area-context react-native-screens expo-linking expo-constants expo-status-bar
import { Client, GatewayIntentBits, Partials, PermissionsBitField, ChannelType, EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle } from 'discord.js';
import fs from 'fs';
import path from 'path';
import { fileURLToPath } from 'url';
import dotenv from 'dotenv';

dotenv.config();

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

const prefix = process.env.DISCORD_PREFIX || '!';
const dataFilePath = new URL('data.json', import.meta.url).pathname;
let { playersELO = {}, playerWarnings = {}, karma = {}, playerStats = {} } = JSON.parse(fs.readFileSync(dataFilePath, 'utf-8') || "{}");

let queue = [];
let matchCounter = 1;
let matches = {};

const maps = ['BW', 'SB', 'PORT', 'COMP', 'ANK', 'MEX', 'EE'];

const client = new Client({
  intents: [
    GatewayIntentBits.Guilds,
    GatewayIntentBits.GuildMessages,
    GatewayIntentBits.MessageContent,
    GatewayIntentBits.GuildMembers,
    GatewayIntentBits.GuildVoiceStates,
    GatewayIntentBits.GuildPresences,
    GatewayIntentBits.GuildMessageReactions
  ],
  partials: [Partials.Channel, Partials.Message, Partials.Reaction]
});

client.once('ready', async () => {
  console.log(`Bot is ready! Logged in as ${client.user.tag}`);
  await setupQueueMessage();
});

client.on('messageCreate', async (message) => {
  if (!message.content.startsWith(prefix) || message.author.bot) return;
  const args = message.content.slice(prefix.length).trim().split(/ +/);
  const command = args.shift().toLowerCase();

  try {
    switch (command) {
      case 'report': await reportCommand(message, args); break;
      case 'clearqueue': await clearQueueCommand(message); break;
      case 'resetelo': await resetEloCommand(message); break;
      case 'giveelo': await giveEloCommand(message, args); break;
      case 'setmatchlogchannel': await setMatchLogChannelCommand(message, args); break;
      case 'profile': await profileCommand(message, args); break;
      case 'lb': case 'leaderboard': await leaderboardCommand(message); break;
      case 'elo': await eloCommand(message, args); break;
      case 'pick': await pickCommand(message, args); break;
      case 'needsub': await needSubCommand(message, args); break;
      case 'replace': await replaceCommand(message, args); break;
      case 'pt': await ptCommand(message, args); break;
      case 'cooldown': await suspendUserCommand(message, args); break;
      case 'removecd': await unSuspendUserCommand(message, args); break;
      case 'cancel': await cancelMatchCommand(message, args); break;
      case 'warn': await warnCommand(message, args); break; // Register the warn command handler
      case 'warns': await warnsCommand(message, args); break; // Register the warns command handler
    }
  } catch (error) {
    console.error(`Error executing command ${command}:`, error);
    message.reply('There was an error executing that command.');
  }
});

client.on('interactionCreate', async interaction => {
  try {
    if (interaction.isButton()) {
      if (interaction.customId === 'join_queue') {
        await joinQueue(interaction);
      } else if (interaction.customId === 'leave_queue') {
        await leaveQueue(interaction);
      } else if (interaction.customId.startsWith('map_vote')) {
        await voteMap(interaction);
      } else if (interaction.customId.startsWith('pick_')) {
        await handlePick(interaction);
      }
    } else if (interaction.isCommand()) {
      const command = interaction.commandName;
      switch (command) {
        case 'setupreaction': await setupQueueMessage(); await interaction.reply({ content: 'Queue message setup.', ephemeral: true }); break;
        case 'eloreset': if (interaction.member.permissions.has(PermissionsBitField.Flags.Administrator)) playersELO = {}; saveData(); await interaction.reply({ content: 'All ELO has been reset.', ephemeral: true }); break;
        case 'warningreset': if (interaction.member.permissions.has(PermissionsBitField.Flags.Administrator)) playerWarnings = {}; saveData(); await interaction.reply({ content: 'All warnings have been reset.', ephemeral: true }); break;
        case 'leaderboard': await leaderboardCommand(interaction); break;
      }
    }
  } catch (error) {
    console.error('Error handling interaction:', error);
    interaction.reply({ content: 'There was an error handling this interaction.', ephemeral: true });
  }
});

const setupQueueMessage = async () => {
  try {
    const channel = await client.channels.fetch(process.env.QUEUE_CHANNEL_ID);
    const embed = new EmbedBuilder()
      .setColor('#00ff26') // Set a custom color for the embed
      .setTitle('🎮 CSL West Competitive Queue 🎮')
      .setDescription('Use the buttons below to join or leave the queue.\n\n**Current Queue:**\nNo one in the queue (0/10)')
      .setFooter({ text: 'Powered by Maverick', iconURL: 'https://i.imgur.com/wTF3RuJ.png' }); // Set an icon for the footer if you have one

    const row = new ActionRowBuilder()
      .addComponents(
        new ButtonBuilder()
          .setCustomId('join_queue')
          .setLabel('Join Queue')
          .setStyle(ButtonStyle.Success)
          .setEmoji('✅'), // Add an emoji to the button
        new ButtonBuilder()
          .setCustomId('leave_queue')
          .setLabel('Leave Queue')
          .setStyle(ButtonStyle.Danger)
          .setEmoji('❌') // Add an emoji to the button
      );

    await channel.send({ embeds: [embed], components: [row] });
  } catch (error) {
    console.error('Error setting up queue message:', error);
  }
};

const joinQueue = async (interaction) => {
  try {
    await interaction.deferReply({ ephemeral: true });

    const user = interaction.user;
    if (!queue.includes(user.id)) {
      queue.push(user.id);
      await updateQueueMessage();
      if (queue.length === 10) {
        await createMatch(interaction.guild);
      }
    } else {
      await interaction.editReply({ content: 'You are already in the queue!' });
      return;
    }

    await interaction.editReply({ content: 'You have joined the queue!' });
  } catch (error) {
    console.error('Error joining queue:', error);
    await interaction.editReply({ content: 'There was an error joining the queue.' });
  }
};

const leaveQueue = async (interaction) => {
  try {
    await interaction.deferReply({ ephemeral: true });

    const user = interaction.user;
    const index = queue.indexOf(user.id);
    if (index > -1) {
      queue.splice(index, 1);
      await updateQueueMessage();
      await interaction.editReply({ content: 'You have left the queue!' });
    } else {
      await interaction.editReply({ content: 'You are not in the queue!' });
    }
  } catch (error) {
    console.error('Error leaving queue:', error);
    await interaction.editReply({ content: 'There was an error leaving the queue.' });
  }
};

const updateQueueMessage = async () => {
  try {
    const channel = await client.channels.fetch(process.env.QUEUE_CHANNEL_ID);
    const messages = await channel.messages.fetch({ limit: 10 });
    const queueMessage = messages.find(msg => msg.embeds[0]?.title === '🎮 CSL West Competitive Queue 🎮');

    if (queueMessage) {
      const description = queue.length > 0 
        ? `${queue.map(id => `<@${id}>`).join('\n')}\n\n**(${queue.length}/10)**`
        : 'No one in the queue (0/10)';

      const embed = new EmbedBuilder()
        .setColor('#00ff26')
        .setTitle('🎮 CSL West Competitive Queue 🎮')
        .setDescription(`Use the buttons below to join or leave the queue.\n\n**Current Queue:**\n${description}`)
        .setFooter({ text: 'Powered by Maverick', iconURL: 'https://i.imgur.com/wTF3RuJ.png' });

      const row = new ActionRowBuilder()
        .addComponents(
          new ButtonBuilder()
            .setCustomId('join_queue')
            .setLabel('Join Queue')
            .setStyle(ButtonStyle.Success)
            .setEmoji('✅'),
          new ButtonBuilder()
            .setCustomId('leave_queue')
            .setLabel('Leave Queue')
            .setStyle(ButtonStyle.Danger)
            .setEmoji('❌')
        );

      await queueMessage.edit({ embeds: [embed], components: [row] });
    }
  } catch (error) {
    console.error('Error updating queue message:', error);
  }
};


const createMatch = async (guild) => {
  try {
    const matchCategory = guild.channels.cache.get(process.env.MATCH_CATEGORY_ID);

    const team1Voice = await guild.channels.create({
      name: `Match ${matchCounter} - Team 1`,
      type: ChannelType.GuildVoice,
      parent: matchCategory,
      userLimit: 6,
      permissionOverwrites: [
        {
          id: guild.roles.everyone.id,
          allow: [PermissionsBitField.Flags.Connect],
        },
      ],
    });

    const team2Voice = await guild.channels.create({
      name: `Match ${matchCounter} - Team 2`,
      type: ChannelType.GuildVoice,
      parent: matchCategory,
      userLimit: 6,
      permissionOverwrites: [
        {
          id: guild.roles.everyone.id,
          allow: [PermissionsBitField.Flags.Connect],
        },
      ],
    });

    const matchText = await guild.channels.create({
      name: `match-${matchCounter}`,
      type: ChannelType.GuildText,
      parent: matchCategory,
      permissionOverwrites: [
        {
          id: guild.roles.everyone.id,
          allow: [PermissionsBitField.Flags.ViewChannel, PermissionsBitField.Flags.SendMessages],
        },
      ],
    });

    const team1Captain = queue.shift();
    const team2Captain = queue.shift();
    const remainingPlayers = queue.splice(0, 8);

    const randomMap = maps[Math.floor(Math.random() * maps.length)];

    matches[matchCounter] = {
      team1: [team1Captain],
      team2: [team2Captain],
      remaining: remainingPlayers,
      pickingOrder: ['team1', 'team2', 'team2', 'team1', 'team1', 'team2', 'team2'],
      currentPick: 0,
      mapVotes: {}, // Ensure mapVotes is initialized
      chosenMap: randomMap
    };

    await updateQueueMessage();
    await updateMatchMessage(matchCounter);

    matchCounter++;
  } catch (error) {
    console.error('Error creating match:', error);
  }
};

const updateMatchMessage = async (matchNumber) => {
  try {
    const match = matches[matchNumber];
    const matchText = client.channels.cache.find(channel => channel.name === `match-${matchNumber}`);

    if (!matchText) return;

    const team1 = match.team1.map(id => `<@${id}>`).join('\n') || 'No players yet';
    const team2 = match.team2.map(id => `<@${id}>`).join('\n') || 'No players yet';

    const embed = new EmbedBuilder()
      .setTitle(`🎮 Match ${matchNumber} 🎮`)
      .setColor('#ff4500') // Orange-red color suitable for a competitive FPS theme
      .setDescription('**Match Details**')
      .addFields(
        { name: '🏆 Team 1 Captain', value: `<@${match.team1[0]}>`, inline: true },
        { name: '🏆 Team 2 Captain', value: `<@${match.team2[0]}>`, inline: true },
        { name: '\u200B', value: '\u200B', inline: true },
        { name: '👥 Team 1', value: team1, inline: true },
        { name: '👥 Team 2', value: team2, inline: true },
        { name: '🗺️ Map', value: `**${match.chosenMap}**`, inline: true } // Show the chosen map
      )
      .setThumbnail('https://i.imgur.com/xfe96CL.png') // Crossfire game logo or relevant image
      .setImage('https://i.imgur.com/jyuglDa.png') // An action-packed image related to Crossfire
      .setFooter({ text: 'Powered by Maverick', iconURL: 'https://i.imgur.com/wTF3RuJ.png' })
      .setTimestamp();

    const playerPickRows = [];
    for (let i = 0; i < match.remaining.length; i += 5) {
      const row = new ActionRowBuilder()
        .addComponents(
          await Promise.all(match.remaining.slice(i, i + 5).map(async playerId => {
            const player = await client.users.fetch(playerId);
            return new ButtonBuilder()
              .setCustomId(`pick_${matchNumber}_${playerId}`)
              .setLabel(`Pick ${player.username}`)
              .setStyle(ButtonStyle.Primary);
          }))
        );
      playerPickRows.push(row);
    }

    const mapVoteRow1 = new ActionRowBuilder()
      .addComponents(
        new ButtonBuilder().setCustomId(`map_vote_${matchNumber}_BW`).setLabel('BW').setStyle(ButtonStyle.Secondary),
        new ButtonBuilder().setCustomId(`map_vote_${matchNumber}_SB`).setLabel('SB').setStyle(ButtonStyle.Secondary),
        new ButtonBuilder().setCustomId(`map_vote_${matchNumber}_PORT`).setLabel('PORT').setStyle(ButtonStyle.Secondary),
        new ButtonBuilder().setCustomId(`map_vote_${matchNumber}_COMP`).setLabel('COMP').setStyle(ButtonStyle.Secondary),
        new ButtonBuilder().setCustomId(`map_vote_${matchNumber}_ANK`).setLabel('ANK').setStyle(ButtonStyle.Secondary)
      );

    const mapVoteRow2 = new ActionRowBuilder()
      .addComponents(
        new ButtonBuilder().setCustomId(`map_vote_${matchNumber}_MEX`).setLabel('MEX').setStyle(ButtonStyle.Secondary),
        new ButtonBuilder().setCustomId(`map_vote_${matchNumber}_EE`).setLabel('EE').setStyle(ButtonStyle.Secondary)
      );

    const messages = await matchText.messages.fetch({ limit: 10 });
    const matchMessage = messages.find(msg => msg.embeds[0]?.title === `🎮 Match ${matchNumber} 🎮`);

    if (matchMessage) {
      try {
        await matchMessage.delete();
      } catch (error) {
        console.error(`Failed to delete message: ${error.message}`);
      }
    }

    await matchText.send({ embeds: [embed], components: [...playerPickRows, mapVoteRow1, mapVoteRow2] });
  } catch (error) {
    console.error('Error updating match message:', error);
  }
};

const handlePick = async (interaction) => {
  try {
    const [_, matchNumber, playerId] = interaction.customId.split('_');
    const match = matches[matchNumber];

    if (!match) {
      await interaction.reply({ content: `Match ${matchNumber} not found.`, ephemeral: true });
      return;
    }

    const user = interaction.user;
    const currentPickTeam = match.pickingOrder[match.currentPick];
    const isCaptain = (user.id === match.team1[0] && currentPickTeam === 'team1') || 
                      (user.id === match.team2[0] && currentPickTeam === 'team2');

    if (!isCaptain) {
      await interaction.reply({ content: 'Only the respective captain can pick for their team on their turn.', ephemeral: true });
      return;
    }

    const team = match.pickingOrder[match.currentPick];
    if (!team) {
      await interaction.reply({ content: 'Invalid picking order.', ephemeral: true });
      return;
    }

    match[team].push(playerId);
    match.remaining = match.remaining.filter(id => id !== playerId);
    match.currentPick = (match.currentPick + 1) % match.pickingOrder.length;

    if (match.currentPick === 0 && match.remaining.length === 1) {
      match.team1.push(match.remaining[0]);
      match.remaining = [];
    }

    await updateMatchMessage(matchNumber);
    await interaction.reply({ content: `Player <@${playerId}> has been picked for ${team === 'team1' ? 'Team 1' : 'Team 2'}.`, ephemeral: true });
  } catch (error) {
    console.error('Error handling pick:', error);
    await interaction.reply({ content: 'There was an error handling the pick.', ephemeral: true });
  }
};

const voteMap = async (interaction) => {
  try {
    const [_, matchNumber, map] = interaction.customId.split('_');
    const match = matches[matchNumber];

    if (!match) {
      console.error(`Match ${matchNumber} not found.`);
      await interaction.reply({ content: `Match ${matchNumber} not found.`, ephemeral: true });
      return;
    }

    if (!match.mapVotes) match.mapVotes = {};
    if (!match.mapVotes[map]) match.mapVotes[map] = 0;
    match.mapVotes[map]++;

    if (match.mapVotes[map] >= 7) {  // Adjust the voting threshold as needed
      match.chosenMap = map;

      const matchText = client.channels.cache.find(channel => channel.name === `match-${matchNumber}`);
      const messages = await matchText.messages.fetch({ limit: 10 });
      const matchMessage = messages.find(msg => msg.embeds[0]?.title === `🎮 Match ${matchNumber} 🎮`);

      if (matchMessage) {
        const embed = EmbedBuilder.from(matchMessage.embeds[0]);
        embed.addFields({ name: 'Chosen Map', value: map });
        await matchMessage.edit({ embeds: [embed] });
      }
      await interaction.reply({ content: `Map has been changed to ${map}`, ephemeral: true });
    } else {
      await interaction.reply({ content: `Your vote for ${map} has been recorded!`, ephemeral: true });
    }

    await updateMatchMessage(matchNumber);
  } catch (error) {
    console.error('Error voting map:', error);
    await interaction.reply({ content: 'There was an error voting for the map.', ephemeral: true });
  }
};

const findUserMatch = (userId) => {
  for (const [id, match] of Object.entries(matches)) {
      if (match.team1.includes(userId) || match.team2.includes(userId) || match.remaining.includes(userId)) {
          return id;
      }
  }
  return null;
};

const reportCommand = async (message, args) => {
  try {
 v
    const matchId = findUserMatch(message.author.id);
    const winningTeamNumber = args[0];

    if (!matchId || !matches[matchId]) {
      return message.reply('You are not in any active match.');
    }

    const match = matches[matchId];
    const team1 = match.team1;
    const team2 = match.team2;
    let winningTeam, losingTeam;

    if (winningTeamNumber === '1') {
      winningTeam = team1;
      losingTeam = team2;
      updateElo(team1, team2);
    } else if (winningTeamNumber === '2') {
      winningTeam = team2;
      losingTeam = team1;
      updateElo(team2, team1);
    } else {
      return message.reply('Invalid winning team.');
    }

    // Delete match channels
    const guild = message.guild;
    const matchCategory = guild.channels.cache.get(process.env.MATCH_CATEGORY_ID);

    const team1Voice = matchCategory.children.cache.find(c => c.name === `Match ${matchId} - Team 1`);
    const team2Voice = matchCategory.children.cache.find(c => c.name === `Match ${matchId} - Team 2`);
    const matchText = matchCategory.children.cache.find(c => c.name === `match-${matchId}`);

    if (team1Voice) await team1Voice.delete();
    if (team2Voice) await team2Voice.delete();
    if (matchText) await matchText.delete();

    delete matches[matchId];
    message.reply(`Match ${matchId} has been reported and the channels have been deleted.`);

    const reporter = message.author;
    logMatch(matchId, winningTeam, losingTeam, `Team ${winningTeamNumber}`, reporter);
  } catch (error) {
    console.error('Error reporting match:', error);
    message.reply('There was an error reporting the match.');
  }
};

const clearQueueCommand = async (message) => {
  try {
    queue = [];
    await updateQueueMessage();
    message.reply('The queue has been cleared.');
  } catch (error) {
    console.error('Error clearing queue:', error);
    message.reply('There was an error clearing the queue.');
  }
};

const resetEloCommand = async (message) => {
  try {
    if (message.member.permissions.has(PermissionsBitField.Flags.Administrator)) {
      playersELO = {};
      saveData();
      message.reply('All ELO has been reset.');
    } else {
      message.reply('You do not have permission to use this command.');
    }
  } catch (error) {
    console.error('Error resetting ELO:', error);
    message.reply('There was an error resetting the ELO.');
  }
};

const giveEloCommand = async (message, args) => {
  try {
    if (message.member.permissions.has(PermissionsBitField.Flags.Administrator)) {
      const [userId, elo] = args;
      if (!playersELO[userId]) playersELO[userId] = 0;
      playersELO[userId] += parseInt(elo, 10);
      saveData();
      message.reply(`ELO given to <@${userId}>.`);
    } else {
      message.reply('You do not have permission to use this command.');
    }
  } catch (error) {
    console.error('Error giving ELO:', error);
    message.reply('There was an error giving the ELO.');
  }
};

const setMatchLogChannelCommand = async (message, args) => {
  try {
    const channelId = args[0];
    if (message.member.permissions.has(PermissionsBitField.Flags.Administrator)) {
      process.env.MATCH_LOG_CHANNEL_ID = channelId;
      message.reply('Match log channel set.');
    } else {
      message.reply('You do not have permission to use this command.');
    }
  } catch (error) {
    console.error('Error setting match log channel:', error);
    message.reply('There was an error setting the match log channel.');
  }
};
const warnCommand = async (message, args) => {
  try {
    // Check if the user has the administrator permission
    if (!message.member.permissions.has(PermissionsBitField.Flags.Administrator)) {
      return message.reply('You do not have permission to use this command.');
    }

    // Check if a user is mentioned and extract the user ID
    if (!args[0] || !args[0].match(/^<@!?(\d+)>$/)) {
      return message.reply('Please mention a valid user to warn.');
    }

    const userId = args[0].replace('<@', '').replace('>', '');
    const reason = args.slice(1).join(' ') || 'No reason provided';

    // Initialize warnings if the user has none
    if (!playerWarnings[userId]) {
      playerWarnings[userId] = { count: 0, reasons: [] };
    }

    // Increment the warning count and add the reason
    playerWarnings[userId].count += 1;
    playerWarnings[userId].reasons.push(reason);
    saveData();

    const embed = new EmbedBuilder()
      .setColor('#ff4500') // Orange-red color suitable for a competitive FPS theme
      .setTitle('User Warned')
      .addFields(
        { name: 'User', value: `<@${userId}>`, inline: true },
        { name: 'Warnings', value: playerWarnings[userId].count.toString(), inline: true },
        { name: 'Reason', value: reason, inline: true }
      )
      .setThumbnail('https://i.imgur.com/wTF3RuJ.png') // Placeholder thumbnail, replace with relevant image
      .setFooter({ text: 'Stay in line, soldier!', iconURL: 'https://i.imgur.com/wTF3RuJ.png' })
      .setTimestamp();

    message.reply({ embeds: [embed] });
  } catch (error) {
    console.error('Error warning user:', error);
    message.reply('There was an error warning the user.');
  }
};

const warnsCommand = async (message, args) => {
  try {
    const userId = args[0] ? args[0].replace('<@', '').replace('>', '') : message.author.id;
    const userWarnings = playerWarnings[userId] ? playerWarnings[userId].count : 0;
    const reasons = playerWarnings[userId] ? playerWarnings[userId].reasons : [];
    const username = message.mentions.users.first() ? message.mentions.users.first().username : message.author.username;

    const embed = new EmbedBuilder()
      .setColor('#ff4500') // Orange-red color suitable for a competitive FPS theme
      .setTitle(`${username}'s Warnings`)
      .addFields(
        { name: 'Warnings', value: userWarnings.toString(), inline: true },
        { name: 'Reasons', value: reasons.length > 0 ? reasons.join('\n') : 'No warnings', inline: true }
      )
      .setThumbnail('https://i.imgur.com/wTF3RuJ.png') // Placeholder thumbnail, replace with relevant image
      .setFooter({ text: 'Stay in line, soldier!', iconURL: 'https://i.imgur.com/wTF3RuJ.png' })
      .setTimestamp();

    message.reply({ embeds: [embed] });
  } catch (error) {
    console.error('Error fetching warnings:', error);
    message.reply('There was an error fetching the warnings.');
  }
};

const profileCommand = async (message, args) => {
  const userId = args[0] ? args[0].replace('<@', '').replace('>', '') : message.author.id;
  const username = message.mentions.users.first() ? message.mentions.users.first().username : message.author.username;
  const elo = playersELO[userId] || 0;
  const userKarma = karma[userId] || 0;
  const stats = playerStats[userId] || {};

  // Default map stats if not present
  const defaultMapStats = { wins: 0, losses: 0 };
  const maps = {
    BW: stats.BW || defaultMapStats,
    PORT: stats.PORT || defaultMapStats,
    ANK: stats.ANK || defaultMapStats,
    COMP: stats.COMP || defaultMapStats,
    SB: stats.SB || defaultMapStats,
    MEX: stats.MEX || defaultMapStats,
    EE: stats.EE || defaultMapStats
  };

  // Calculate total wins and losses
  const totalWins = Object.values(maps).reduce((acc, map) => acc + map.wins, 0);
  const totalLosses = Object.values(maps).reduce((acc, map) => acc + map.losses, 0);

  // Create embed message
  const embed = new EmbedBuilder()
    .setTitle(`${username}'s Profile`)
    .addFields(
      { name: 'ELO', value: elo.toString(), inline: true },
      { name: 'Karma', value: userKarma.toString(), inline: true },
      { name: '\u200B', value: '\u200B', inline: true }
    )
    .addFields(
      { name: 'Map Stats:', value: '\u200B' },
      { name: 'Black Widow', value: `${maps.BW.wins} wins ${maps.BW.losses} losses`, inline: true },
      { name: 'Port', value: `${maps.PORT.wins} wins ${maps.PORT.losses} losses`, inline: true },
      { name: 'Ankara', value: `${maps.ANK.wins} wins ${maps.ANK.losses} losses`, inline: true },
      { name: 'Compound', value: `${maps.COMP.wins} wins ${maps.COMP.losses} losses`, inline: true },
      { name: 'Sub Base', value: `${maps.SB.wins} wins ${maps.SB.losses} losses`, inline: true },
      { name: 'Mexico', value: `${maps.MEX.wins} wins ${maps.MEX.losses} losses`, inline: true },
      { name: 'Eagle Eye', value: `${maps.EE.wins} wins ${maps.EE.losses} losses`, inline: true },
      { name: 'Total Wins', value: totalWins.toString(), inline: true },
      { name: 'Total Losses', value: totalLosses.toString(), inline: true }
    );

  message.reply({ embeds: [embed] });
};

const leaderboardCommand = async (message) => {
  try {
    const sortedPlayers = Object.entries(playersELO).sort((a, b) => b[1] - a[1]).slice(0, 25);
    const leaderboard = await Promise.all(
      sortedPlayers.map(async ([userId, elo], index) => {
        const user = await message.guild.members.fetch(userId).catch(() => null);
        return `#${index + 1}  |  ${elo}  |  ${user ? `<@${user.id}>` : `Unknown User`}`;
      })
    );

    if (leaderboard.length === 0) {
      leaderboard.push('No players available');
    }

    const embed = new EmbedBuilder()
      .setColor('#00ff26') // Set a custom color for the embed
      .setTitle('Top 25 Pug Players')
      .addFields({ name: 'Rank | Elo | Player', value: leaderboard.join('\n') })
      .setFooter({ text: 'Use .lb or .leaderboard to see the leaderboard at any time', iconURL: 'https://i.imgur.com/wTF3RuJ.png' })
      .setTimestamp();

    message.reply({ embeds: [embed] });
  } catch (error) {
    console.error('Error fetching leaderboard:', error);
    message.reply('There was an error fetching the leaderboard.');
  }
};




const eloCommand = async (message, args) => {
  try {
    const userId = args[0] ? args[0].replace('<@', '').replace('>', '') : message.author.id;
    const elo = playersELO[userId] || 0;
    message.reply(`<@${userId}> has ${elo} ELO.`);
  } catch (error) {
    console.error('Error fetching ELO:', error);
    message.reply('There was an error fetching the ELO.');
  }
};

const pickCommand = async (message, args) => {
  try {
    if (!args[0] || !args[0].match(/^<@!?(\d+)>$/)) {
      return message.reply('Please mention a valid user to pick.');
    }

    const playerId = args[0].replace('<@', '').replace('>', '');
    const userId = message.author.id;
    const matchId = findUserMatch(userId);

    if (!matchId) {
      return message.reply('You are not part of any active matches.');
    }

    const match = matches[matchId];
    const currentPickIndex = match.team1.length + match.team2.length - 2;

    if (currentPickIndex >= match.pickingOrder.length) {
      return message.reply('All picks have already been made.');
    }

    const pickingTeam = match.pickingOrder[currentPickIndex] === 'team1' ? 'team1' : 'team2';

    if (!match.remaining.includes(playerId)) {
      return message.reply('Invalid player ID for picking.');
    }

    match[pickingTeam].push(playerId);
    match.remaining = match.remaining.filter(id => id !== playerId);

    await updateMatchMessage(matchId);

    message.reply(`Player <@${playerId}> picked for ${pickingTeam === 'team1' ? 'Team 1' : 'Team 2'}.`);
  } catch (error) {
    console.error('Error picking player:', error);
    message.reply('There was an error picking the player.');
  }
};

const needSubCommand = async (message, args) => {
  try {
    if (!args[0] || !args[0].match(/^<@!?(\d+)>$/)) {
      return message.reply('Please mention a valid user to sub.');
    }

    const userId = message.author.id;
    const playerId = args[0].replace('<@', '').replace('>', '');
    const matchId = findUserMatch(userId);

    if (!matchId) {
      return message.reply('You are not part of any active matches.');
    }

    const match = matches[matchId];
    const team = match.team1.includes(playerId) ? 'team1' : 'team2';
    const playerIndex = match[team].indexOf(playerId);

    if (playerIndex === -1) {
      return message.reply('Player not found in any team.');
    }

    const subMessage = await message.channel.send(`<@${playerId}> has requested a substitution. React with ❌ within 2 minutes if you are still here.`);
    await subMessage.react('❌');

    const filter = (reaction, user) => reaction.emoji.name === '❌' && user.id === playerId;
    const collector = subMessage.createReactionCollector({ filter, time: 120000 });

    collector.on('collect', () => {
      subMessage.edit(`<@${playerId}> is still active.`);
      collector.stop();
    });

    collector.on('end', async collected => {
      if (collected.size === 0) {
        const newPlayerId = queue.shift();
        if (!newPlayerId) {
          return message.channel.send('No available substitutes in the queue.');
        }

        match[team][playerIndex] = newPlayerId;
        await updateMatchMessage(matchId);

        message.channel.send(`<@${playerId}> has been substituted by <@${newPlayerId}> in ${team === 'team1' ? 'Team 1' : 'Team 2'}.`);
      }
    });
  } catch (error) {
    console.error('Error handling substitution:', error);
    message.reply('There was an error handling the substitution.');
  }
};


const replaceCommand = async (message, args) => {
  try {
    if (args.length < 2 || !args[0].match(/^<@!?(\d+)>$/) || !args[1].match(/^<@!?(\d+)>$/)) {
      return message.reply('Please mention the old player and the new player in the correct format.');
    }

    const oldPlayerId = args[0].replace('<@', '').replace('>', '');
    const newPlayerId = args[1].replace('<@', '').replace('>', '');
    const userId = message.author.id;
    const matchId = findUserMatch(userId);

    if (!matchId) {
      return message.reply('You are not part of any active matches.');
    }

    const match = matches[matchId];
    const team = match.team1.includes(oldPlayerId) ? 'team1' : match.team2.includes(oldPlayerId) ? 'team2' : null;

    if (!team) {
      return message.reply('Old player is not found in any team.');
    }

    const playerIndex = match[team].indexOf(oldPlayerId);

    if (playerIndex === -1) {
      return message.reply('Old player not found in the team.');
    }

    match[team][playerIndex] = newPlayerId;

    await updateMatchMessage(matchId);

    message.reply(`Player <@${oldPlayerId}> has been replaced by <@${newPlayerId}> in ${team === 'team1' ? 'Team 1' : 'Team 2'}.`);
  } catch (error) {
    console.error('Error replacing player:', error);
    message.reply('There was an error replacing the player.');
  }
};


const ptCommand = async (message, args) => {
  try {
    if (args.length < 1) {
      return message.reply('Please specify the team number (1, 2, or 0) and an optional message.');
    }

    const userId = message.author.id;
    const teamNumber = parseInt(args[0]);

    if (isNaN(teamNumber) || (teamNumber < 0 || teamNumber > 2)) {
      return message.reply('Invalid team number. Use 1 for Team 1, 2 for Team 2, or 0 for both teams.');
    }

    const additionalMessage = args.slice(1).join(' ');

    const matchId = findUserMatch(userId);

    if (!matchId) {
      return message.reply('You are not part of any active matches.');
    }

    const match = matches[matchId];
    let teamMentions = '';

    if (teamNumber === 0) {
      const allTeams = [...match.team1, ...match.team2];
      teamMentions = allTeams.map(id => `<@${id}>`).join(' ');
    } else if (teamNumber === 1) {
      teamMentions = match.team1.map(id => `<@${id}>`).join(' ');
    } else if (teamNumber === 2) {
      teamMentions = match.team2.map(id => `<@${id}>`).join(' ');
    }

    const finalMessage = `${teamMentions} ${additionalMessage}`;

    try {
      const matchCategory = await message.client.channels.fetch(process.env.MATCH_CATEGORY_ID);
      const matchText = matchCategory.children.find(c => c.name === `match-${matchId}`);
      if (!matchText) {
        return message.reply('Match text channel not found.');
      }

      await matchText.send(finalMessage);
      message.reply('Message sent.');
    } catch (error) {
      console.error('Error sending message:', error);
      message.reply('There was an error sending the message. Please try again later.');
    }
  } catch (error) {
    console.error('Error in PT command:', error);
    message.reply('There was an error executing the PT command.');
  }
};


const cancelMatchCommand = async (message, args) => {
  try {
    const userId = message.author.id;
    const matchId = findUserMatch(userId);

    if (!matchId) {
      return message.reply('You are not part of any active matches.');
    }

    const match = matches[matchId];
    delete matches[matchId];

    const guild = message.guild;
    const matchCategory = guild.channels.cache.get(process.env.MATCH_CATEGORY_ID);

    const team1Voice = matchCategory.children.find(c => c.name === `Match ${matchId} - Team 1`);
    const team2Voice = matchCategory.children.find(c => c.name === `Match ${matchId} - Team 2`);
    const matchText = matchCategory.children.find(c => c.name === `match-${matchId}`);

    if (team1Voice) await team1Voice.delete();
    if (team2Voice) await team2Voice.delete();
    if (matchText) await matchText.delete();

    message.reply(`Match ${matchId} has been canceled.`);
  } catch (error) {
    console.error('Error canceling match:', error);
    message.reply('There was an error canceling the match.');
  }
};

const suspendUserCommand = async (message, args) => {
  try {
    const userId = args[0].replace('<@', '').replace('>', '');
    const duration = parseInt(args[1]); // Duration in minutes
    const reason = args.slice(2).join(' ');

    if (!karma[userId]) karma[userId] = {};
    karma[userId].suspendedUntil = Date.now() + duration * 60000;
    karma[userId].reason = reason;
    saveData();

    message.reply(`<@${userId}> has been suspended for ${duration} minutes. Reason: ${reason}`);
  } catch (error) {
    console.error('Error suspending user:', error);
    message.reply('There was an error suspending the user.');
  }
};

const unSuspendUserCommand = async (message, args) => {
  try {
    const userId = args[0].replace('<@', '').replace('>', '');

    if (karma[userId] && karma[userId].suspendedUntil) {
      delete karma[userId].suspendedUntil;
      delete karma[userId].reason;
      saveData();
      message.reply(`<@${userId}>'s suspension has been lifted.`);
    } else {
      message.reply(`<@${userId}> is not currently suspended.`);
    }
  } catch (error) {
    console.error('Error unsuspending user:', error);
    message.reply('There was an error lifting the suspension.');
  }
};

const saveData = () => {
  const data = { playersELO, playerWarnings, karma, playerStats };
  fs.writeFileSync(dataFilePath, JSON.stringify(data, null, 2), 'utf-8');
};

const logMatch = (matchId, winningTeam, losingTeam, result, reporter) => {
  const logChannel = client.channels.cache.get(process.env.MATCH_LOG_CHANNEL_ID);

  if (!logChannel) {
    console.error('Match log channel not found');
    return;
  }

  const embed = new EmbedBuilder()
    .setTitle(`Match #${matchId} Log`)
    .setColor('#ff4500') // Orange-red color suitable for a competitive FPS theme
    .addFields(
      { name: 'Winners | Team 1', value: winningTeam.map(id => `<@${id}>`).join(' '), inline: true },
      { name: 'Losers | Team 2', value: losingTeam.map(id => `<@${id}>`).join(' '), inline: true },
      { name: 'Reported by', value: `${reporter.username}#${reporter.discriminator} (${reporter.id})` }
    )
    .setFooter({ text: 'Powered by Maverick', iconURL: 'https://i.imgur.com/wTF3RuJ.png' })
    .setTimestamp();

  logChannel.send({ embeds: [embed] });
};

const updateElo = (winningTeam, losingTeam) => {
  winningTeam.forEach(player => {
    if (!playersELO[player]) playersELO[player] = 50;
    playersELO[player] += 6;
  });

  losingTeam.forEach(player => {
    if (!playersELO[player]) playersELO[player] = 50;
    playersELO[player] -= 5;
  });

  saveData();
};

const registerCommands = () => {
  const commands = [
    {
      name: 'setupreaction',
      description: 'Recreates the reaction message to join the queue',
      type: 1,
    },
    {
      name: 'eloreset',
      description: 'Resets all ELO, must be superuser',
      type: 1,
    },
    {
      name: 'warningreset',
      description: 'Resets all warnings, must be admin',
      type: 1,
    },
    {
      name: 'leaderboard',
      description: 'Leaderboard in the stats channel',
      type: 1,
    }
  ];

  const guild = client.guilds.cache.first();
  guild.commands.set(commands).then(() => console.log('Commands registered'));
};

client.login(process.env.DISCORD_TOKEN);
<div class="page-breadcrumb">
                                        <ul>
                                            <li><a href="https://www.lundbergroofing.com">Home</a></li>
                                            <li>About Us</li>
                                        </ul>
                                    </div>


.page-breadcrumb ul { display: flex; padding: 0px; margin-left: 0px; list-style: none; gap: 16px; }
.page-breadcrumb ul li a { font-size: 14px; color: rgb(161, 161, 161); }
.page-breadcrumb ul li { position: relative; font-size: 14px; font-weight: 600; color: rgb(161, 161, 161); text-transform: uppercase; }
.page-breadcrumb ul li::after { content: ""; width: 13px; height: 1.5px; background: rgb(161, 161, 161); position: absolute; rotate: -74deg; bottom: 9px; right: -14px; }
.page-breadcrumb { border: 1px solid rgb(238, 238, 238); border-radius: 2px; margin-bottom: 16px; padding: 4px 8px; }
.page-breadcrumb ul li:last-child::after { display: none; }
.page-breadcrumb ul li a:hover { color: rgb(126, 44, 33); }
star

Thu Jul 11 2024 09:27:07 GMT+0000 (Coordinated Universal Time) https://www.kali.org/docs/introduction/download-official-kali-linux-images/

@Dewaldt

star

Thu Jul 11 2024 09:07:53 GMT+0000 (Coordinated Universal Time) https://platform.openai.com/

@shookthacr3ator

star

Thu Jul 11 2024 07:46:10 GMT+0000 (Coordinated Universal Time) https://ehubsoft.herokuapp.com/golang/

@shookthacr3ator #undefined

star

Thu Jul 11 2024 05:51:56 GMT+0000 (Coordinated Universal Time) https://learn.microsoft.com/en-za/powershell/module/microsoft.powershell.core/get-help?view

@Dewaldt

star

Thu Jul 11 2024 05:09:46 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/22743457/how-can-i-change-the-size-of-a-bootstrap-checkbox

@xsirlalo #php

star

Thu Jul 11 2024 04:07:33 GMT+0000 (Coordinated Universal Time)

@davidmchale #svg #use

star

Thu Jul 11 2024 02:51:16 GMT+0000 (Coordinated Universal Time)

@Xeno_SSY #c++

star

Thu Jul 11 2024 01:58:55 GMT+0000 (Coordinated Universal Time)

@gbritgs

star

Wed Jul 10 2024 20:25:27 GMT+0000 (Coordinated Universal Time) https://docs.anaconda.com/anaconda/install/linux/

@Spsypg

star

Wed Jul 10 2024 20:19:28 GMT+0000 (Coordinated Universal Time) https://docs.anaconda.com/anaconda/install/linux/

@Spsypg

star

Wed Jul 10 2024 19:26:10 GMT+0000 (Coordinated Universal Time)

@Crumbum

star

Wed Jul 10 2024 19:16:04 GMT+0000 (Coordinated Universal Time)

@mbarcomb

star

Wed Jul 10 2024 18:41:58 GMT+0000 (Coordinated Universal Time) https://docs.anaconda.com/anaconda-notebooks/notebook-environments/

@Spsypg

star

Wed Jul 10 2024 18:39:58 GMT+0000 (Coordinated Universal Time) https://docs.anaconda.com/anaconda-notebooks/notebook-environments/

@Spsypg

star

Wed Jul 10 2024 18:39:06 GMT+0000 (Coordinated Universal Time) https://docs.anaconda.com/anaconda-notebooks/notebook-environments/

@Spsypg

star

Wed Jul 10 2024 18:37:52 GMT+0000 (Coordinated Universal Time) https://docs.anaconda.com/anaconda-notebooks/notebook-environments/

@Spsypg

star

Wed Jul 10 2024 14:06:22 GMT+0000 (Coordinated Universal Time) https://www.markhendriksen.com/ultimate-guide-for-divi-fonts/

@suzieelles #fonts

star

Wed Jul 10 2024 14:04:27 GMT+0000 (Coordinated Universal Time) https://maticz.com/nft-game-development

@Ameliasebastian #nftgamedevelopment

star

Wed Jul 10 2024 14:03:26 GMT+0000 (Coordinated Universal Time) https://ask.replit.com/t/clear-console-in-python/65265

@Nadia

star

Wed Jul 10 2024 13:37:15 GMT+0000 (Coordinated Universal Time) https://maticz.com/bitstamp-clone-script

@Ameliasebastian #bitstampclonescript

star

Wed Jul 10 2024 13:10:43 GMT+0000 (Coordinated Universal Time) https://maticz.com/bc-game-clone-script

@Ameliasebastian #bcgameclonescript

star

Wed Jul 10 2024 12:51:40 GMT+0000 (Coordinated Universal Time)

@Shira

star

Wed Jul 10 2024 10:13:06 GMT+0000 (Coordinated Universal Time)

@miskat80

star

Wed Jul 10 2024 09:25:46 GMT+0000 (Coordinated Universal Time) https://www.pyramidions.com/mobile-app-development-chennai.html

@Steve_1

star

Wed Jul 10 2024 09:13:18 GMT+0000 (Coordinated Universal Time) https://community.brave.com/t/ads-on-youtube-even-when-shields-is-turned-on/552421/5

@Curable1600 #windows #browsers #youtube

star

Wed Jul 10 2024 06:27:44 GMT+0000 (Coordinated Universal Time)

@NoFox420 #javascript

star

Wed Jul 10 2024 06:12:41 GMT+0000 (Coordinated Universal Time)

@miskat80

star

Wed Jul 10 2024 02:26:18 GMT+0000 (Coordinated Universal Time)

@jhayeong

star

Wed Jul 10 2024 00:43:52 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/22404601/merging-pdf-files-with-php-fpdi

@xsirlalo #php

star

Tue Jul 09 2024 20:07:28 GMT+0000 (Coordinated Universal Time)

@Samuel1347 #flutter #dart #firebase

star

Tue Jul 09 2024 20:06:40 GMT+0000 (Coordinated Universal Time)

@Samuel1347 #flutter #dart #firebase

star

Tue Jul 09 2024 20:02:37 GMT+0000 (Coordinated Universal Time)

@shirnunn

star

Tue Jul 09 2024 19:29:24 GMT+0000 (Coordinated Universal Time)

@zmark #mysql

star

Tue Jul 09 2024 18:37:51 GMT+0000 (Coordinated Universal Time)

@chaim

star

Tue Jul 09 2024 18:20:35 GMT+0000 (Coordinated Universal Time)

@wasim_mm1

star

Tue Jul 09 2024 18:20:33 GMT+0000 (Coordinated Universal Time)

@FRTZ

star

Tue Jul 09 2024 17:49:17 GMT+0000 (Coordinated Universal Time) https://snapcraft.io/docs/installing-snap-on-linux-mint

@thuston88

star

Tue Jul 09 2024 17:47:00 GMT+0000 (Coordinated Universal Time)

@Muhammad_saud #javascript

star

Tue Jul 09 2024 17:13:15 GMT+0000 (Coordinated Universal Time)

@AC3AK1 #javascript

star

Tue Jul 09 2024 17:11:46 GMT+0000 (Coordinated Universal Time)

@AC3AK1 #javascript

star

Tue Jul 09 2024 17:10:46 GMT+0000 (Coordinated Universal Time)

@AC3AK1 #javascript

star

Tue Jul 09 2024 14:49:40 GMT+0000 (Coordinated Universal Time)

@pvignesh

star

Tue Jul 09 2024 14:44:01 GMT+0000 (Coordinated Universal Time)

@pvignesh

star

Tue Jul 09 2024 14:32:17 GMT+0000 (Coordinated Universal Time)

@pvignesh

star

Tue Jul 09 2024 14:14:58 GMT+0000 (Coordinated Universal Time)

@pvignesh

star

Tue Jul 09 2024 13:18:36 GMT+0000 (Coordinated Universal Time)

@AC3AK1 #javascript

star

Tue Jul 09 2024 13:17:01 GMT+0000 (Coordinated Universal Time)

@AC3AK1 #javascript

star

Tue Jul 09 2024 12:28:47 GMT+0000 (Coordinated Universal Time)

@FRTZ

star

Tue Jul 09 2024 11:49:48 GMT+0000 (Coordinated Universal Time)

@alamin005 #html

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension