Skip to content

Instantly share code, notes, and snippets.

View SoursopID's full-sized avatar

SoursopID SoursopID

View GitHub Profile
@SoursopID
SoursopID / config.go
Last active March 11, 2025 10:46
Simple multi type config data with autosave
// Copyright(C) 2025 soursop
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at <https://mozilla.org/MPL/2.0/>.
// soursop is a WhatsApp bot based on whatsmeow (github.com/tulir/whatsmeow)
package config
import {
makeWASocket,
DisconnectReason,
useMultiFileAuthState,
WASocket,
ConnectionState,
AuthenticationState,
WAMessage,
MessageUpsertType
} from 'baileys';
{
"Info": {
"Chat": "<groupid>@g.us",
"Sender": "<userid>:[email protected]",
"IsFromMe": false,
"IsGroup": true,
"BroadcastListOwner": "",
"ID": "3EB0F29CD941ED17B1AD6D",
"ServerID": 0,
"Type": "text",
@SoursopID
SoursopID / cmd-handler.js
Last active February 3, 2025 13:53
Contoh sederhana pembuatan handler bebasis pattern / cmd yg didaftarkan.
// Copyright(C) 2025 SoursopID
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at <https://mozilla.org/MPL/2.0/>.
const DEFAULT_PREFIX = "/.";
// Kumpulan command yang terdaftar
let commands = {};
@SoursopID
SoursopID / .tmux.conf
Last active February 19, 2025 00:45
Make tmux scroll able with mouse wheel without pressing ctrl+b [
set -g mouse on
// Copyright(C) 2024 soursop
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at <https://mozilla.org/MPL/2.0/>.
// list based on https://cloud.google.com/translate/docs/languages
package lang
@SoursopID
SoursopID / worker.go
Created October 28, 2024 08:42
Go Worker, menjalankan thread (goroutine) dengan limiter dan blocker
package main
import (
"sync"
"time"
)
type Worker struct {
Limiter chan bool
Grouper sync.WaitGroup
@SoursopID
SoursopID / bot-detector.js
Last active February 2, 2025 12:52
Detect bot by qoute ID, sender device ID and participant zero.
/*
* Copyright(C) 2025 SoursopID
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at <https://mozilla.org/MPL/2.0/>.
*
* */
/* Cautions :
@SoursopID
SoursopID / menu-list.json
Created September 6, 2024 07:00
Menu list whatsapp
{
"Info": {
"Chat": "<redacted>@s.whatsapp.net",
"Sender": "<redacted>:[email protected]",
"IsFromMe": true,
"IsGroup": false,
"BroadcastListOwner": "",
"ID": "3EB0A313559160010253BC",
"ServerID": 0,
"Type": "media",
@SoursopID
SoursopID / emoji_to_golang.py
Last active September 11, 2024 05:51
Scrape emoji and create a golang file.
import requests
import json
sesi = requests.session()
site_uri = "https://unicode.org/Public/emoji/latest/emoji-test.txt"
resp = sesi.get(site_uri)
def array_included(string, array):