Exemplo n.º 1
0
    def __init__(self, bot):
        self.bot = bot
        self.rpc = rpc.Rpc()

        # parse the config file
        config = parsing.parse_json('config.json')
        self.currency_symbol = config["currency_symbol"]
        self.stakeflake = config["stake_bal"]
        self.treasurer = config["treasurer"]
        self.donate = config["donation"]
        self.game_id = config["game_bal"]
        self.coin_name = config["currency_name"]
        self.bot_name = config["description"]

        # parse the embed section of the config file
        embed_config = parsing.parse_json('config.json')["embed_msg"]
        self.thumb_embed = embed_config["thumb_embed_url"]
        self.footer_text = embed_config["footer_msg_text"]
        self.embed_color = int(embed_config["color"], 16)

        # parse the getstakingstatus from rpc wallet
        stake_info = self.rpc.getstakingstatus()
        self.is_enabled = stake_info["enabled"]
        self.staking_status = stake_info["staking"]
        self.have_errors = stake_info["errors"]
        self.difficulty = stake_info["difficulty"]
        self.weight = stake_info["weight"]
        self.net_staking_weight = stake_info["netstakeweight"]
        self.expected_time = stake_info["expectedtime"]
 def __init__(self, bot):
     self.bot = bot
     self.rpc = rpc.Rpc()
     config = parsing.parse_json('config.json')
     self.currency_symbol = config["currency_symbol"]
     self.stake_id = config["stake_bal"]
     self.coin_name = config["currency_name"]
     self.bot_name = config["description"]
     # parse the embed section of the config file
     embed_config = parsing.parse_json('config.json')["embed_msg"]
     self.thumb_embed = embed_config["thumb_embed_url"]
     self.footer_text = embed_config["footer_msg_text"]
     self.embed_color = int(embed_config["color"], 16)
Exemplo n.º 3
0
    def __init__(self, bot):
        self.bot = bot
        self.rpc = rpc.Rpc()

        config = parsing.parse_json('config.json')
        self.bot_name = config["description"]

        # Coin attributes (BitGreen/BITG)
        self.coin_name = config["currency_name"]
        self.currency_symbol = config["currency_symbol"]

        # Wallets
        self.treasurer = config["treasurer"]
        self.stake_bal = config["stake_bal"]
        self.donation = config["donation"]
        self.game_bal = config["game_bal"]
        self.airdrop = config["airdrop"]

        # Parse the embed section of the config file
        embed_config = parsing.parse_json('config.json')["embed_msg"]
        self.thumb_embed = embed_config["thumb_embed_url"]
        self.footer_text = embed_config["footer_msg_text"]
        self.embed_color = int(embed_config["color"], 16)
Exemplo n.º 4
0
 def __init__(self, bot):
     self.bot = bot
     self.rpc = rpc.Rpc()
Exemplo n.º 5
0
import discord, json, requests, pymysql.cursors
from discord.ext import commands
from utils import rpc_module, mysql_module, parsing, checks

rpc = rpc_module.Rpc()
mysql = mysql_module.Mysql()


class Tip:
    def __init__(self, bot):
        self.bot = bot

    @commands.command(pass_context=True)
    @commands.check(checks.in_server)
    async def tip(self, ctx, user: discord.Member, amount: float):
        """Tip a user coins"""
        snowflake = ctx.message.author.id
        self.tipfee = parsing.parse_json('config.json')["tipfee"]
        self.owner = parsing.parse_json('config.json')["owner"]
        tip_user = user.id
        if snowflake == tip_user:
            await self.bot.say(
                "{} **:warning:You cannot tip yourself!:warning:**".format(
                    ctx.message.author.mention))
            return

        if amount <= 0.0:
            await self.bot.say(
                "{} **:warning:You cannot tip <= 0!:warning:**".format(
                    ctx.message.author.mention))
            return
Exemplo n.º 6
0
import discord
from discord.ext import commands
from utils import checks
from utils import mysql_module
from utils import parsing
from utils import rpc_module as rpc

rpc = rpc.Rpc()
mysql = mysql_module.Mysql()


class Tip(commands.Cog):
    """Tip users"""
    def __init__(self, bot):
        self.bot = bot
        config = parsing.parse_json('config.json')
        self.currency_symbol = config["currency_symbol"]
        self.treasurer_id = config["treasurer"]
        self.stake_bal_id = config["stake_bal"]
        self.donation_id = config["donation"]
        self.game_bal = config["game_bal"]
        # parse the embed section of the config file
        embed_config = parsing.parse_json('config.json')["embed_msg"]
        self.thumb_embed = embed_config["thumb_embed_url"]
        self.footer_text = embed_config["footer_msg_text"]
        self.embed_color = int(embed_config["color"], 16)

    @commands.command()
    @commands.check(checks.in_server)
    async def tip(self, ctx, amount: float):
        """Tip users coins. You can tip multiple users. Amount is per user!"""
 def __init__(self, bot):
     self.bot = bot
     self.rpc = rpc.Rpc()
     config = parsing.parse_json('config.json')        
     self.currency_symbol = config["currency_symbol"]     
import json
import codecs
from utils import rpc_module, parsing

RPC = rpc_module.Rpc()


# pick the last UTXO visible on listunspend
def txid_vout(address: str = ''):
    unspentTx = RPC.listunspent(address)
    tUTXO = len(unspentTx)
    return parsing.parse2json(unspentTx[tUTXO - 1])


def hexify_message(msg):
    return codecs.encode(msg.encode(), 'hex')


if __name__ == '__main__':
    print("""
 ____  ____   ___   ___  _____       ___  _____        ___ __ __ ____ ___________  ____ ____     __   ___ 
|    \|    \ /   \ /   \|     |     /   \|     |      /  _|  T  l    / ___|      T/    |    \   /  ] /  _]
|  o  |  D  Y     Y     |   __j    Y     |   __j     /  [_|  |  ||  (   \_|      Y  o  |  _  Y /  / /  [_ 
|   _/|    /|  O  |  O  |  l_      |  O  |  l_      Y    _l_   _j|  |\__  l_j  l_|     |  |  |/  / Y    _]
|  |  |    \|     |     |   _]     |     |   _]     |   [_|     ||  |/  \ | |  | |  _  |  |  /   \_|   [_ 
|  |  |  .  l     l     |  T       l     |  T       |     |  |  |j  l\    | |  | |  |  |  |  \     |     T
l__j  l__j\_j\___/ \___/l__j        \___/l__j       l_____|__j__|____j\___j l__j l__j__l__j__j\____l_____j
PoE is a utility built into most blockchains that allow anyone to store records in an immutable fashion.
    """)
    write2block = input('OP_Return Message: ')