ALERT!
Click here to register with a few steps and explore all our cool stuff we have to offer!

Jump to content



Photo

Discord bot for Sellix


  • Please log in to reply
Discord bot for Sellix

#1

3xodus
3xodus
    Offline
    0
    Rep
    15
    Likes

    Junkie

Posts: 281
Threads: 11
Joined: Aug 20, 2020
Credits: 0
Three years registered
#1

PAID LEAKSellix bot in py for discord, take sellix payments thru your channel/discord server!

#!/usr/bin/env python
# -*- coding: utf-8 -*-
import discord
from discord.ext import commands
from discord.ext import tasks
import json
import datetime
import requests
TOKEN = ""
PREFIX = ""
API_KEY = ""
ROLES = []
orders = []
feedback = []
stock_list = dict()
with open('config.json') as json_file:
    data = json.load(json_file)
    TOKEN = data["token"]
    PREFIX = data["prefix"]
    ROLES = data["permission_roles"]
    API_KEY = data["sellix_api_key"]
    CUSTOMER_ROLE = data["customer_role"]

header = {
    'Authorization': 'Bearer '+API_KEY,
    'User-Agent': 'Sellix-Bot'
}

client = commands.Bot(command_prefix=PREFIX)
client.remove_command("help")

@tasks.loop(seconds=60)
async def update():
    global stock_list
    with open('config.json') as json_file:
        data = json.load(json_file)
        restock_channel = data["restock_channel"]
    print("=> Updating...")
    products = get_products()
    for product in products:
        if product["uniqid"] in stock_list:
            if stock_list[product["uniqid"]] != int(product["stock"]):
                stock_list[product["uniqid"]] = int(product["stock"])
                if int(product["stock"]) == 1:
                    embed = discord.Embed(title="Stock warning", description=product["title"] + " is low on stock", color=discord.Color.orange())
                    await client.get_channel(restock_channel).send(embed=embed)
                elif int(product["stock"]) == 0:
                    embed = discord.Embed(title="Empty Stock", description=product["title"] + " is empty on stock",
                                          color=discord.Color.red())
                    await client.get_channel(restock_channel).send(embed=embed)
                else:
                    embed = discord.Embed(title="Product restocked", description=product["title"] + " was restocked",
                                          color=discord.Color.purple())
                    if product["stock"] == -1:
                        stock = "Service"
                    else:
                        stock = str(product["stock"])
                    embed.add_field(name="Stock", value=stock)
                    await client.get_channel(restock_channel).send(embed=embed)
        else:
            stock_list[product["uniqid"]] = int(product["stock"])
    print("=> Update finished ")

@Client.command(name="help")
async def help(ctx):
    embed = discord.Embed(title="Help", description="See all Commands for "+client.user.name, color=discord.Color.blue())
    embed.add_field(name=PREFIX+"help", value="Displays the help", inline=False)
    embed.add_field(name=PREFIX+"stock", value="Displays the current stock", inline=False)
    embed.add_field(name=PREFIX+"verify <order_id>", value="Adds customer role to an user", inline=False)
    if has_permissions(ctx):
        embed.add_field(name=PREFIX+"checkorder <order_id>", value="Prints all information about an order", inline=False)
        embed.add_field(name=PREFIX+"replace <order_id> <amount>", value="Replace account from shoppy stock", inline=False)
    await ctx.send(embed=embed)

@Client.command(name="verify")
async def verify(ctx, order_id):
    user = ctx.message.author
    order_information = get_order_information(order_id)
    if "status" in order_information and order_information["status"] is False:
        embed = discord.Embed(title="Order not found",
                              description="This order was not found",
                              color=discord.Color.red())
        await ctx.send(embed=embed)
        await ctx.message.delete()
        return
    order_information = order_information["data"]["order"]
    if order_information["status"] != 1:
        embed = discord.Embed(title="Order not confirmed",
                              description="This order is not confirmed yet. Please try again later",
                              color=discord.Color.orange())
        await ctx.send(embed=embed)
        await ctx.message.delete()
        return
    await user.add_roles(discord.utils.get(ctx.message.guild.roles, id=CUSTOMER_ROLE))
    embed = discord.Embed(title="Success", description="You should have received the customer role now!",
                          color=discord.Color.green())
    await ctx.send(embed=embed)
    await ctx.message.delete()

@Client.command(name="checkorder")
async def checkorder(ctx, order_id):
    if not has_permissions(ctx):
        embed = discord.Embed(title="No permission",
                              description="You don't have the permissions to execute this command",
                              color=discord.Color.red())
        await ctx.send(embed=embed)
        return
    order_information = get_order_information(order_id)
    if "status" in order_information and order_information["status"] == 404:
        embed = discord.Embed(title="Order not found",
                              description="This order was not found",
                              color=discord.Color.red())
        await ctx.send(embed=embed)
        return
    order_information = order_information["data"]["order"]
    embed = discord.Embed(title="Order information", description="Order ID: "+order_information["uniqid"], color=discord.Color.purple())
    embed.add_field(name="Email", value=order_information["customer_email"], inline=False)
    embed.add_field(name="Product Name", value=order_information["product_title"], inline=False)
    embed.add_field(name="Price", value=str(order_information["total_display"])+str(order_information["currency"]), inline=False)
    embed.add_field(name="Created at", value=order_information["created_at"], inline=False)
    embed.add_field(name="Gateway", value=order_information["gateway"], inline=False)
    embed.add_field(name="Quantity", value=order_information["quantity"], inline=False)
    if order_information["status"] == 1:
        status = "Completed"
    elif order_information["status"] == 2:
        status = "Cancelled"
    elif order_information["status"] == 3:
        status = "Waiting for confirmation"
    elif order_information["status"] == 4:
        status = "Partial Payment"
    else:
        status = "Pending"
    embed.add_field(name="Status", value=status, inline=False)
    if order_information["crypto_address"]:
        embed.add_field(name="Crypto Address", value=order_information["crypto_address"], inline=False)
    await ctx.send(embed=embed)
    embed = discord.Embed(title="Delivered Goods", description="Order ID: "+order_information["uniqid"], color=discord.Color.purple())
    count = 0
    for account in order_information["serials"]:
        if count % 25 == 0 and count / 25 != 0:
            await ctx.send(embed=embed)
            embed = discord.Embed(title="Delivered Goods", description="Page " + str(round(count / 25) + 1),
                                  color=discord.Color.blue())
        embed.add_field(name="`" + str(count) + "`", value=str(account), inline=False)
        count = count + 1
    await ctx.send(embed=embed)

@Client.command(name="stock")
async def stock(ctx):
    embed = discord.Embed(title="Stock", color=discord.Color.purple())
    count = 0
    for product in get_products():
        if count % 25 == 0 and count / 25 != 0:
            await ctx.send(embed=embed)
            embed = discord.Embed(title="Stock", description="Page " + str(round(count / 25) + 1),
                                  color=discord.Color.green())
        if product["stock"] == -1:
            stock = "Service"
        else:
            stock = str(product["stock"])
        embed.add_field(name=product["title"], value=stock, inline=False)
    await ctx.send(embed=embed)

@Client.command(name="replace")
async def replace(ctx, order_id, amount : int):
    if not has_permissions(ctx):
        embed = discord.Embed(title="No permission",
                              description="You don't have the permissions to execute this command",
                              color=discord.Color.red())
        await ctx.send(embed=embed)
        return
    order_information = get_order_information(order_id)
    if "status" in order_information and order_information["status"] == 404:
        embed = discord.Embed(title="Order not found",
                              description="This order was not found",
                              color=discord.Color.red())
        await ctx.send(embed=embed)
        return
    order_information = order_information["data"]["order"]
    product_info = order_information["product"]
    replacement =[]
    stock = product_info["serials"]
    new_stock = []
    count = 0
    for i in range(len(stock)):
        if count < amount:
            replacement.append(stock[i])
        else:
            new_stock.append(stock[i])
        count = count+1
    data = {
        "title": product_info["title"],
        "price": product_info["price"],
        "type": product_info["type"],
        "currency": product_info["currency"],
        "serials": new_stock
    }
    up_header = {
        'Authorization': 'Bearer '+API_KEY,
        'Accept': 'application/json',
        'Content-Type': 'application/json',
        'User-Agent': 'Sellix-Bot'
    }
    r = requests.put("https://dev.sellix.io/v1/products/"+product_info["uniqid"], json=data, headers=up_header,
                      verify=False)
    embed = discord.Embed(title="Replaced Order", description="Amount: "+str(amount), color=discord.Color.green())
    embed_c = 0
    for account in replacement:
        if embed_c % 25 == 0 and embed_c / 25 != 0:
            await ctx.send(embed=embed)
            embed = discord.Embed(title="Delivered Goods", description="Page " + str(round(embed_c / 25) + 1),
                                  color=discord.Color.blue())
        embed.add_field(name="Replaced Account", value=str(account), inline=False)
        embed_c = embed_c + 1
    await ctx.send(embed=embed)

@Client.event
async def on_ready():
    printBanner()
    print("=> Command Prefix is " + PREFIX)
    print('=> Logged in as {0.user}'.format(client))
    game = discord.Game(name=PREFIX+"help")
    await client.change_presence(status=discord.Status.online, activity=game)
    set_default()
    update.start()

# Helper Functions
def printBanner():
    print("-------------------------------------------")
    print("SELLIX BOT")
    print("-------------------------------------------")
    print("=> Started Sellix Bot by Nergon#4972")

def set_default():
    global stock_list
    for product in get_products():
        stock_list[product["uniqid"]] = int(product["stock"])

def has_permissions(ctx):
    for role_id in ROLES:
        role = discord.utils.get(ctx.guild.roles, id=role_id)
        if role in ctx.author.roles:
            return True
    return False

def get_order_information(order_id):
    r = requests.get(url="https://dev.sellix.io/v1/orders/"+order_id, headers=header, verify=False)
    return json.loads(r.text)

def get_products():
    r = requests.get(url="https://dev.sellix.io/v1/products", headers=header, verify=False)
    return json.loads(r.text)["data"]["products"]

client.run(TOKEN)

 Screen-Shot-2021-03-06-at-10-33-21-PM.pn

Hidden Content
You'll be able to see the hidden content once you reply to this topic or upgrade your account.


Edited by 3xodus, 30 March 2021 - 09:03 PM.

  • 0

#2

WikiBoy
WikiBoy
    Offline
    0
    Rep
    10
    Likes

    Addicted

Posts: 159
Threads: 3
Joined: Feb 17, 2017
Credits: 0

Seven years registered
#2

Lemme check this out!


  • 0

#3

Schmelman
Schmelman
    Offline
    1
    Rep
    1
    Likes

    Advanced Member

Posts: 137
Threads: 0
Joined: Jul 12, 2020
Credits: 0
Three years registered
#3

looks good, ill try it out!


  • 0

#4

sKage
sKage
    Offline
    0
    Rep
    17
    Likes

    sin#7788

Posts: 52
Threads: 2
Joined: Feb 23, 2021
Credits: 0

Three years registered
#4

 

PAID LEAKSellix bot in py for discord, take sellix payments thru your channel/discord server!

#!/usr/bin/env python
# -*- coding: utf-8 -*-
import discord
from discord.ext import commands
from discord.ext import tasks
import json
import datetime
import requests
TOKEN = ""
PREFIX = ""
API_KEY = ""
ROLES = []
orders = []
feedback = []
stock_list = dict()
with open('config.json') as json_file:
    data = json.load(json_file)
    TOKEN = data["token"]
    PREFIX = data["prefix"]
    ROLES = data["permission_roles"]
    API_KEY = data["sellix_api_key"]
    CUSTOMER_ROLE = data["customer_role"]

header = {
    'Authorization': 'Bearer '+API_KEY,
    'User-Agent': 'Sellix-Bot'
}

client = commands.Bot(command_prefix=PREFIX)
client.remove_command("help")

@tasks.loop(seconds=60)
async def update():
    global stock_list
    with open('config.json') as json_file:
        data = json.load(json_file)
        restock_channel = data["restock_channel"]
    print("=> Updating...")
    products = get_products()
    for product in products:
        if product["uniqid"] in stock_list:
            if stock_list[product["uniqid"]] != int(product["stock"]):
                stock_list[product["uniqid"]] = int(product["stock"])
                if int(product["stock"]) == 1:
                    embed = discord.Embed(title="Stock warning", description=product["title"] + " is low on stock", color=discord.Color.orange())
                    await client.get_channel(restock_channel).send(embed=embed)
                elif int(product["stock"]) == 0:
                    embed = discord.Embed(title="Empty Stock", description=product["title"] + " is empty on stock",
                                          color=discord.Color.red())
                    await client.get_channel(restock_channel).send(embed=embed)
                else:
                    embed = discord.Embed(title="Product restocked", description=product["title"] + " was restocked",
                                          color=discord.Color.purple())
                    if product["stock"] == -1:
                        stock = "Service"
                    else:
                        stock = str(product["stock"])
                    embed.add_field(name="Stock", value=stock)
                    await client.get_channel(restock_channel).send(embed=embed)
        else:
            stock_list[product["uniqid"]] = int(product["stock"])
    print("=> Update finished ")

@Client.command(name="help")
async def help(ctx):
    embed = discord.Embed(title="Help", description="See all Commands for "+client.user.name, color=discord.Color.blue())
    embed.add_field(name=PREFIX+"help", value="Displays the help", inline=False)
    embed.add_field(name=PREFIX+"stock", value="Displays the current stock", inline=False)
    embed.add_field(name=PREFIX+"verify <order_id>", value="Adds customer role to an user", inline=False)
    if has_permissions(ctx):
        embed.add_field(name=PREFIX+"checkorder <order_id>", value="Prints all information about an order", inline=False)
        embed.add_field(name=PREFIX+"replace <order_id> <amount>", value="Replace account from shoppy stock", inline=False)
    await ctx.send(embed=embed)

@Client.command(name="verify")
async def verify(ctx, order_id):
    user = ctx.message.author
    order_information = get_order_information(order_id)
    if "status" in order_information and order_information["status"] is False:
        embed = discord.Embed(title="Order not found",
                              description="This order was not found",
                              color=discord.Color.red())
        await ctx.send(embed=embed)
        await ctx.message.delete()
        return
    order_information = order_information["data"]["order"]
    if order_information["status"] != 1:
        embed = discord.Embed(title="Order not confirmed",
                              description="This order is not confirmed yet. Please try again later",
                              color=discord.Color.orange())
        await ctx.send(embed=embed)
        await ctx.message.delete()
        return
    await user.add_roles(discord.utils.get(ctx.message.guild.roles, id=CUSTOMER_ROLE))
    embed = discord.Embed(title="Success", description="You should have received the customer role now!",
                          color=discord.Color.green())
    await ctx.send(embed=embed)
    await ctx.message.delete()

@Client.command(name="checkorder")
async def checkorder(ctx, order_id):
    if not has_permissions(ctx):
        embed = discord.Embed(title="No permission",
                              description="You don't have the permissions to execute this command",
                              color=discord.Color.red())
        await ctx.send(embed=embed)
        return
    order_information = get_order_information(order_id)
    if "status" in order_information and order_information["status"] == 404:
        embed = discord.Embed(title="Order not found",
                              description="This order was not found",
                              color=discord.Color.red())
        await ctx.send(embed=embed)
        return
    order_information = order_information["data"]["order"]
    embed = discord.Embed(title="Order information", description="Order ID: "+order_information["uniqid"], color=discord.Color.purple())
    embed.add_field(name="Email", value=order_information["customer_email"], inline=False)
    embed.add_field(name="Product Name", value=order_information["product_title"], inline=False)
    embed.add_field(name="Price", value=str(order_information["total_display"])+str(order_information["currency"]), inline=False)
    embed.add_field(name="Created at", value=order_information["created_at"], inline=False)
    embed.add_field(name="Gateway", value=order_information["gateway"], inline=False)
    embed.add_field(name="Quantity", value=order_information["quantity"], inline=False)
    if order_information["status"] == 1:
        status = "Completed"
    elif order_information["status"] == 2:
        status = "Cancelled"
    elif order_information["status"] == 3:
        status = "Waiting for confirmation"
    elif order_information["status"] == 4:
        status = "Partial Payment"
    else:
        status = "Pending"
    embed.add_field(name="Status", value=status, inline=False)
    if order_information["crypto_address"]:
        embed.add_field(name="Crypto Address", value=order_information["crypto_address"], inline=False)
    await ctx.send(embed=embed)
    embed = discord.Embed(title="Delivered Goods", description="Order ID: "+order_information["uniqid"], color=discord.Color.purple())
    count = 0
    for account in order_information["serials"]:
        if count % 25 == 0 and count / 25 != 0:
            await ctx.send(embed=embed)
            embed = discord.Embed(title="Delivered Goods", description="Page " + str(round(count / 25) + 1),
                                  color=discord.Color.blue())
        embed.add_field(name="`" + str(count) + "`", value=str(account), inline=False)
        count = count + 1
    await ctx.send(embed=embed)

@Client.command(name="stock")
async def stock(ctx):
    embed = discord.Embed(title="Stock", color=discord.Color.purple())
    count = 0
    for product in get_products():
        if count % 25 == 0 and count / 25 != 0:
            await ctx.send(embed=embed)
            embed = discord.Embed(title="Stock", description="Page " + str(round(count / 25) + 1),
                                  color=discord.Color.green())
        if product["stock"] == -1:
            stock = "Service"
        else:
            stock = str(product["stock"])
        embed.add_field(name=product["title"], value=stock, inline=False)
    await ctx.send(embed=embed)

@Client.command(name="replace")
async def replace(ctx, order_id, amount : int):
    if not has_permissions(ctx):
        embed = discord.Embed(title="No permission",
                              description="You don't have the permissions to execute this command",
                              color=discord.Color.red())
        await ctx.send(embed=embed)
        return
    order_information = get_order_information(order_id)
    if "status" in order_information and order_information["status"] == 404:
        embed = discord.Embed(title="Order not found",
                              description="This order was not found",
                              color=discord.Color.red())
        await ctx.send(embed=embed)
        return
    order_information = order_information["data"]["order"]
    product_info = order_information["product"]
    replacement =[]
    stock = product_info["serials"]
    new_stock = []
    count = 0
    for i in range(len(stock)):
        if count < amount:
            replacement.append(stock[i])
        else:
            new_stock.append(stock[i])
        count = count+1
    data = {
        "title": product_info["title"],
        "price": product_info["price"],
        "type": product_info["type"],
        "currency": product_info["currency"],
        "serials": new_stock
    }
    up_header = {
        'Authorization': 'Bearer '+API_KEY,
        'Accept': 'application/json',
        'Content-Type': 'application/json',
        'User-Agent': 'Sellix-Bot'
    }
    r = requests.put("https://dev.sellix.io/v1/products/"+product_info["uniqid"], json=data, headers=up_header,
                      verify=False)
    embed = discord.Embed(title="Replaced Order", description="Amount: "+str(amount), color=discord.Color.green())
    embed_c = 0
    for account in replacement:
        if embed_c % 25 == 0 and embed_c / 25 != 0:
            await ctx.send(embed=embed)
            embed = discord.Embed(title="Delivered Goods", description="Page " + str(round(embed_c / 25) + 1),
                                  color=discord.Color.blue())
        embed.add_field(name="Replaced Account", value=str(account), inline=False)
        embed_c = embed_c + 1
    await ctx.send(embed=embed)

@Client.event
async def on_ready():
    printBanner()
    print("=> Command Prefix is " + PREFIX)
    print('=> Logged in as {0.user}'.format(client))
    game = discord.Game(name=PREFIX+"help")
    await client.change_presence(status=discord.Status.online, activity=game)
    set_default()
    update.start()

# Helper Functions
def printBanner():
    print("-------------------------------------------")
    print("SELLIX BOT")
    print("-------------------------------------------")
    print("=> Started Sellix Bot by Nergon#4972")

def set_default():
    global stock_list
    for product in get_products():
        stock_list[product["uniqid"]] = int(product["stock"])

def has_permissions(ctx):
    for role_id in ROLES:
        role = discord.utils.get(ctx.guild.roles, id=role_id)
        if role in ctx.author.roles:
            return True
    return False

def get_order_information(order_id):
    r = requests.get(url="https://dev.sellix.io/v1/orders/"+order_id, headers=header, verify=False)
    return json.loads(r.text)

def get_products():
    r = requests.get(url="https://dev.sellix.io/v1/products", headers=header, verify=False)
    return json.loads(r.text)["data"]["products"]

client.run(TOKEN)

Damn this is an epic release


  • 1

#5

Matalie200O
Matalie200O
    Offline
    0
    Rep
    2
    Likes

    Advanced Member

  • PipPipPipPip
Posts: 128
Threads: 0
Joined: Oct 19, 2020
Credits: 0

Three years registered
#5

woah


  • 0

#6

johnathnaB
johnathnaB
    Offline
    0
    Rep
    0
    Likes

    Member

Posts: 46
Threads: 0
Joined: Mar 17, 2020
Credits: 0
Four years registered
#6

thanks sir


  • 0

#7

Peurbleue
Peurbleue
    Offline
    0
    Rep
    0
    Likes

    Lurker

Posts: 4
Threads: 0
Joined: Sep 16, 2021
Credits: 0
Two years registered
#7

PAID LEAKSellix bot in py for discord, take sellix payments thru your channel/discord server!

#!/usr/bin/env python
# -*- coding: utf-8 -*-
import discord
from discord.ext import commands
from discord.ext import tasks
import json
import datetime
import requests
TOKEN = ""
PREFIX = ""
API_KEY = ""
ROLES = []
orders = []
feedback = []
stock_list = dict()
with open('config.json') as json_file:
    data = json.load(json_file)
    TOKEN = data["token"]
    PREFIX = data["prefix"]
    ROLES = data["permission_roles"]
    API_KEY = data["sellix_api_key"]
    CUSTOMER_ROLE = data["customer_role"]

header = {
    'Authorization': 'Bearer '+API_KEY,
    'User-Agent': 'Sellix-Bot'
}

client = commands.Bot(command_prefix=PREFIX)
client.remove_command("help")

@tasks.loop(seconds=60)
async def update():
    global stock_list
    with open('config.json') as json_file:
        data = json.load(json_file)
        restock_channel = data["restock_channel"]
    print("=> Updating...")
    products = get_products()
    for product in products:
        if product["uniqid"] in stock_list:
            if stock_list[product["uniqid"]] != int(product["stock"]):
                stock_list[product["uniqid"]] = int(product["stock"])
                if int(product["stock"]) == 1:
                    embed = discord.Embed(title="Stock warning", description=product["title"] + " is low on stock", color=discord.Color.orange())
                    await client.get_channel(restock_channel).send(embed=embed)
                elif int(product["stock"]) == 0:
                    embed = discord.Embed(title="Empty Stock", description=product["title"] + " is empty on stock",
                                          color=discord.Color.red())
                    await client.get_channel(restock_channel).send(embed=embed)
                else:
                    embed = discord.Embed(title="Product restocked", description=product["title"] + " was restocked",
                                          color=discord.Color.purple())
                    if product["stock"] == -1:
                        stock = "Service"
                    else:
                        stock = str(product["stock"])
                    embed.add_field(name="Stock", value=stock)
                    await client.get_channel(restock_channel).send(embed=embed)
        else:
            stock_list[product["uniqid"]] = int(product["stock"])
    print("=> Update finished ")

@Client.command(name="help")
async def help(ctx):
    embed = discord.Embed(title="Help", description="See all Commands for "+client.user.name, color=discord.Color.blue())
    embed.add_field(name=PREFIX+"help", value="Displays the help", inline=False)
    embed.add_field(name=PREFIX+"stock", value="Displays the current stock", inline=False)
    embed.add_field(name=PREFIX+"verify <order_id>", value="Adds customer role to an user", inline=False)
    if has_permissions(ctx):
        embed.add_field(name=PREFIX+"checkorder <order_id>", value="Prints all information about an order", inline=False)
        embed.add_field(name=PREFIX+"replace <order_id> <amount>", value="Replace account from shoppy stock", inline=False)
    await ctx.send(embed=embed)

@Client.command(name="verify")
async def verify(ctx, order_id):
    user = ctx.message.author
    order_information = get_order_information(order_id)
    if "status" in order_information and order_information["status"] is False:
        embed = discord.Embed(title="Order not found",
                              description="This order was not found",
                              color=discord.Color.red())
        await ctx.send(embed=embed)
        await ctx.message.delete()
        return
    order_information = order_information["data"]["order"]
    if order_information["status"] != 1:
        embed = discord.Embed(title="Order not confirmed",
                              description="This order is not confirmed yet. Please try again later",
                              color=discord.Color.orange())
        await ctx.send(embed=embed)
        await ctx.message.delete()
        return
    await user.add_roles(discord.utils.get(ctx.message.guild.roles, id=CUSTOMER_ROLE))
    embed = discord.Embed(title="Success", description="You should have received the customer role now!",
                          color=discord.Color.green())
    await ctx.send(embed=embed)
    await ctx.message.delete()

@Client.command(name="checkorder")
async def checkorder(ctx, order_id):
    if not has_permissions(ctx):
        embed = discord.Embed(title="No permission",
                              description="You don't have the permissions to execute this command",
                              color=discord.Color.red())
        await ctx.send(embed=embed)
        return
    order_information = get_order_information(order_id)
    if "status" in order_information and order_information["status"] == 404:
        embed = discord.Embed(title="Order not found",
                              description="This order was not found",
                              color=discord.Color.red())
        await ctx.send(embed=embed)
        return
    order_information = order_information["data"]["order"]
    embed = discord.Embed(title="Order information", description="Order ID: "+order_information["uniqid"], color=discord.Color.purple())
    embed.add_field(name="Email", value=order_information["customer_email"], inline=False)
    embed.add_field(name="Product Name", value=order_information["product_title"], inline=False)
    embed.add_field(name="Price", value=str(order_information["total_display"])+str(order_information["currency"]), inline=False)
    embed.add_field(name="Created at", value=order_information["created_at"], inline=False)
    embed.add_field(name="Gateway", value=order_information["gateway"], inline=False)
    embed.add_field(name="Quantity", value=order_information["quantity"], inline=False)
    if order_information["status"] == 1:
        status = "Completed"
    elif order_information["status"] == 2:
        status = "Cancelled"
    elif order_information["status"] == 3:
        status = "Waiting for confirmation"
    elif order_information["status"] == 4:
        status = "Partial Payment"
    else:
        status = "Pending"
    embed.add_field(name="Status", value=status, inline=False)
    if order_information["crypto_address"]:
        embed.add_field(name="Crypto Address", value=order_information["crypto_address"], inline=False)
    await ctx.send(embed=embed)
    embed = discord.Embed(title="Delivered Goods", description="Order ID: "+order_information["uniqid"], color=discord.Color.purple())
    count = 0
    for account in order_information["serials"]:
        if count % 25 == 0 and count / 25 != 0:
            await ctx.send(embed=embed)
            embed = discord.Embed(title="Delivered Goods", description="Page " + str(round(count / 25) + 1),
                                  color=discord.Color.blue())
        embed.add_field(name="`" + str(count) + "`", value=str(account), inline=False)
        count = count + 1
    await ctx.send(embed=embed)

@Client.command(name="stock")
async def stock(ctx):
    embed = discord.Embed(title="Stock", color=discord.Color.purple())
    count = 0
    for product in get_products():
        if count % 25 == 0 and count / 25 != 0:
            await ctx.send(embed=embed)
            embed = discord.Embed(title="Stock", description="Page " + str(round(count / 25) + 1),
                                  color=discord.Color.green())
        if product["stock"] == -1:
            stock = "Service"
        else:
            stock = str(product["stock"])
        embed.add_field(name=product["title"], value=stock, inline=False)
    await ctx.send(embed=embed)

@Client.command(name="replace")
async def replace(ctx, order_id, amount : int):
    if not has_permissions(ctx):
        embed = discord.Embed(title="No permission",
                              description="You don't have the permissions to execute this command",
                              color=discord.Color.red())
        await ctx.send(embed=embed)
        return
    order_information = get_order_information(order_id)
    if "status" in order_information and order_information["status"] == 404:
        embed = discord.Embed(title="Order not found",
                              description="This order was not found",
                              color=discord.Color.red())
        await ctx.send(embed=embed)
        return
    order_information = order_information["data"]["order"]
    product_info = order_information["product"]
    replacement =[]
    stock = product_info["serials"]
    new_stock = []
    count = 0
    for i in range(len(stock)):
        if count < amount:
            replacement.append(stock[i])
        else:
            new_stock.append(stock[i])
        count = count+1
    data = {
        "title": product_info["title"],
        "price": product_info["price"],
        "type": product_info["type"],
        "currency": product_info["currency"],
        "serials": new_stock
    }
    up_header = {
        'Authorization': 'Bearer '+API_KEY,
        'Accept': 'application/json',
        'Content-Type': 'application/json',
        'User-Agent': 'Sellix-Bot'
    }
    r = requests.put("https://dev.sellix.io/v1/products/"+product_info["uniqid"], json=data, headers=up_header,
                      verify=False)
    embed = discord.Embed(title="Replaced Order", description="Amount: "+str(amount), color=discord.Color.green())
    embed_c = 0
    for account in replacement:
        if embed_c % 25 == 0 and embed_c / 25 != 0:
            await ctx.send(embed=embed)
            embed = discord.Embed(title="Delivered Goods", description="Page " + str(round(embed_c / 25) + 1),
                                  color=discord.Color.blue())
        embed.add_field(name="Replaced Account", value=str(account), inline=False)
        embed_c = embed_c + 1
    await ctx.send(embed=embed)

@Client.event
async def on_ready():
    printBanner()
    print("=> Command Prefix is " + PREFIX)
    print('=> Logged in as {0.user}'.format(client))
    game = discord.Game(name=PREFIX+"help")
    await client.change_presence(status=discord.Status.online, activity=game)
    set_default()
    update.start()

# Helper Functions
def printBanner():
    print("-------------------------------------------")
    print("SELLIX BOT")
    print("-------------------------------------------")
    print("=> Started Sellix Bot by Nergon#4972")

def set_default():
    global stock_list
    for product in get_products():
        stock_list[product["uniqid"]] = int(product["stock"])

def has_permissions(ctx):
    for role_id in ROLES:
        role = discord.utils.get(ctx.guild.roles, id=role_id)
        if role in ctx.author.roles:
            return True
    return False

def get_order_information(order_id):
    r = requests.get(url="https://dev.sellix.io/v1/orders/"+order_id, headers=header, verify=False)
    return json.loads(r.text)

def get_products():
    r = requests.get(url="https://dev.sellix.io/v1/products", headers=header, verify=False)
    return json.loads(r.text)["data"]["products"]

client.run(TOKEN)

 Screen-Shot-2021-03-06-at-10-33-21-PM.pn

damn thx


  • 0

#8

Askarm
Askarm
    Offline
    0
    Rep
    0
    Likes

    Member

Posts: 74
Threads: 0
Joined: Aug 14, 2018
Credits: 0

Five years registered
#8
Thanks for this leak

  • 0

#9

TheMasked
TheMasked
    Offline
    0
    Rep
    0
    Likes

    Member

Posts: 73
Threads: 0
Joined: Nov 27, 2021
Credits: 0
Two years registered
#9

Thanks!


  • 0

ESHOP: [WILL BE BACK]
DISCORD: The Masked SSD#1127


#10

cr4ptoverse
cr4ptoverse
    Offline
    0
    Rep
    3
    Likes

    cr4ptoverse

Posts: 36
Threads: 12
Joined: Dec 10, 2021
Credits: 0
Two years registered
#10

let me check


  • 0


 Users browsing this thread: