npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

kokturk-economy

v0.0.1-beta

Published

Köktürk Ekonomi Modülü. Ekonomi botlarınız için basit ve kolay bir modül.

Downloads

8

Readme

Basit Ekonomi Modülü

Bu modül, ekonomi botu yaparken zorlanmayın diye kodlandı. Umarım işinize yarar.

npm'den indirerek başla:

npm i kokturk-ekonomy

Çalışma Mantığı

Basit. Tüm datalar sqlite3 formatonda quick-db ile saklanır. Ekonomi sisteminde cüzdan ve banka gibi değerler bulunmakta, yani daha fazla özelleştirme yapabilirsin!

Basit Ekonomi Sistemi

Bu kadar basit bir sistem daha önce hiç olmadı. Bu modül şunları destekler: ekle, ayarla, çek, çıkar, ve günlük!

İçerik

Başlamak için modülü indirdikten sonra ekonomi Clienti oluşturmanız gerekli. Örnek:

const Discord = require('discord.js');
const eko = require('kokturk-economy');

const client = new Discord.Client();

client.on('message', async (message) => {
    const ekonomi = new eko.guildUser(message.author, message.guild);
    //örnek kullanıcı oluşturma
});

client.login("token");
  • UNUTMA!: message.author.id yerine message.authoru kullanın(member için) ve message.guild.id yerine message.guildi kullanın(guild için)

Fonksiyon Listesi

| |CÜZDAN |BANKA | |----------------|-------------------------------|-----------------------------| |ekle|ekonomi.ekle(miktar, "cüzdan") |ekonomi.ekle(miktar, "banka")
|ayarla|ekonomi.ayarla(miktar, "cüzdan") |ekonomi.ayarla(miktar, "banka")
|cikar |ekonomi.cikar(miktar, "cüzdan") |ekonomi.cikar(miktar, "banka")
|cek(GET) |ekonomi.cek("cüzdan") |ekonomi.cek("banka") | |gunluk |ekonomi.gunluk(miktar, "cüzdan") |ekonomi.gunluk(miktar, "banka") |

  • miktar mutlaka number tipinde olmak zorunda!

| |KULLANIM | |----------------|-------------------------------| |randomNumara| eko.randomNumara(minNumber, maxNumber) | |tumu|ekonomi.tumu()|

  • Info: randomNumara sadece eko ile çalışır. ekonomi ile çalışmaz!
  • Note: all() methodu size json şeklinde tüm sunucu verilerini döndürür!

Methodlar

Ekle

async function eklefonks(message, miktar, tip){
    await ekonomi.ekle(miktar, tip);
    const amountNow = await ekonomi.get(tip);
    message.reply(`**${amountNow}** miktarında para *${tip}* bölümünde bulunmakta.`);
}

eklefonks(message, 100, "banka");

Tümü

async function tumufunc() {
    const allGuildData = await ekonomi.tumu();
    /*
    dönen veriler:
    {
        "cash": guildUsersCashData,
        "daily": guildUsersDailyData
    }
    */
   console.log(allGuildData);
}

tumufunc();

Günlük

async function gunlukfunc(message, tip) {
    const miktar = eko.randomNumara(1,50);
    const daily = await ekonomi.gunluk(miktar, type);
    if(daily.error == 'zatenAlindi')return message.reply("Zaten günlük ödül alınd.");
    
    message.reply(`Başarıyla **${miktar}** miktarındaki para *${type}* hesabınıza eklendi.`)
}

gunlukfunc(message);

Çek

async function cekfunc(message, tip){
    const miktar = await ekonomi.cek(tip);
    message.reply(`Your miktar of *${tip}* is **${miktar}**.`);
}

cekfunc(message, "banka");

Random Numara

const randomNumber = eko.randomNumara(1,100);

Ayarla

async function ayarlafunc(message, miktar, tip){
    await ekonomi.ayarla(miktar, tip);
    message.reply(`Success. Your miktar of cash in *${tip}* is now **${miktar}**.`);
}

ayarlafunc(message, 60, "banka");

Subtract

async function cikarfunc(message, miktar, tip){
    await ekonomi.subtract(miktar, tip);
    const amountNow = await ekonomi.get(tip);
    message.reply(`**${miktar}** miktarındaki para *${type}* hesabınızdan çıkarıldı. Şu an *${amountNow}* paranız bulunmakta.`);
}

cikarfunc(message, 10, "cüzdan");

Yardım mı lazım?

Instagram