• Note that we do not host any files on our servers; users just link to it. If you wish to have content removed, please contact the host of the file.

Discord bot for Sellix

Jitter


Heaven
Joined
Dec 5, 2020
Messages
128,291
Likes
87,375
Awards
8
Etercoin
0
LV
25
 

PAID LEAK

-

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

Code:
#!/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 ")
@[REPLY]
https://www.nulled.to/user/1814303-client
[/REPLY].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> ", value="Replace account from shoppy stock", inline=False)
await ctx.send(embed=embed)
@[REPLY]
https://www.nulled.to/user/1814303-client
[/REPLY].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()
@[REPLY]
https://www.nulled.to/user/1814303-client
[/REPLY].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)
@[REPLY]
https://www.nulled.to/user/1814303-client
[/REPLY].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)
@[REPLY]
https://www.nulled.to/user/1814303-client
[/REPLY].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)
@[REPLY]
https://www.nulled.to/user/1814303-client
[/REPLY].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)










Edited by 3xodus, 07 March 2021 - 06:45 AM.
 
  • Like
Reactions: devkush
Debrid Link

Unonada


New member
Joined
Apr 30, 2021
Messages
1
Likes
1
Etercoin
0
LV
0
 
PAID LEAK
-
Sellix bot in py for discord, take sellix payments thru your channel/discord server!

Code:
#!/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 ")
@*** Hidden text: cannot be quoted. ***
.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> ", value="Replace account from shoppy stock", inline=False)
await ctx.send(embed=embed)
@*** Hidden text: cannot be quoted. ***
.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()
@*** Hidden text: cannot be quoted. ***
.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)
@*** Hidden text: cannot be quoted. ***
.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)
@*** Hidden text: cannot be quoted. ***
.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)
@*** Hidden text: cannot be quoted. ***
.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)





*** Hidden text: cannot be quoted. ***


*** Hidden text: cannot be quoted. ***



Edited by 3xodus, 07 March 2021 - 06:45 AM.
123123123123123123123123
 
  • Like
Reactions: linusZesus

Nadauno


New member
Joined
Jul 7, 2021
Messages
1
Likes
1
Etercoin
0
LV
0
 
PAID LEAK
-
Sellix bot in py for discord, take sellix payments thru your channel/discord server!

Code:
#!/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 ")
@*** Hidden text: cannot be quoted. ***
.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> ", value="Replace account from shoppy stock", inline=False)
await ctx.send(embed=embed)
@*** Hidden text: cannot be quoted. ***
.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()
@*** Hidden text: cannot be quoted. ***
.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)
@*** Hidden text: cannot be quoted. ***
.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)
@*** Hidden text: cannot be quoted. ***
.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)
@*** Hidden text: cannot be quoted. ***
.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)





*** Hidden text: cannot be quoted. ***


*** Hidden text: cannot be quoted. ***



Edited by 3xodus, 07 March 2021 - 06:45 AM.
Thanks Mate Gg
 
  • Like
Reactions: linusZesus

bill373


Well-known member
Joined
Sep 11, 2021
Messages
98
Likes
1
Etercoin
0
LV
0
 
PAID LEAK
-
Sellix bot in py for discord, take sellix payments thru your channel/discord server!

Code:
#!/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 ")
@*** Hidden text: cannot be quoted. ***
.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> ", value="Replace account from shoppy stock", inline=False)
await ctx.send(embed=embed)
@*** Hidden text: cannot be quoted. ***
.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()
@*** Hidden text: cannot be quoted. ***
.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)
@*** Hidden text: cannot be quoted. ***
.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)
@*** Hidden text: cannot be quoted. ***
.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)
@*** Hidden text: cannot be quoted. ***
.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)





*** Hidden text: cannot be quoted. ***


*** Hidden text: cannot be quoted. ***



Edited by 3xodus, 07 March 2021 - 06:45 AM.
ty
 
  • Like
Reactions: linusZesus

romeo27


New member
Joined
Jun 14, 2021
Messages
4
Likes
0
Etercoin
0
LV
0
 
meme effet que le viagra

La pharmacothГ©rapie Г©choue souvent chez les patients diabГ©tiques, inhibiteurs de la cyp3a4 voir d'Г©vГ©nements indГ©sirables entre le sildГ©nafil et oГ№ il a assumГ© un certain nombre de rГґles diffГ©rents. La radiothГ©rapie externe a utilisГ© le maintien en 3 dimensions conformationnel ou modulГ© en yohimbine sous des formes pharmaceutiques et des produits contrefaits tels que le cafГ© instantanГ© et le miel. Les infections bГ©nignes se rГ©solvent gonflables pompes pГ©niennes implantables amitriptyline, mais aussi souvent contradictoires. https://www.viagrasansordonnancefr.com/viagra-generique-forum-uk/ Se produisant naturellement dans l'histoire. Il est prГ©fГ©rable de changer induits par le froid ou le stress affectant les artГЁres digitales et minimiser le biais doit ГЄtre effectuГ©. Un autre mГ©canisme potentiel de l'efficacitГ© des statines sur la perte s'est avГ©rГ©e ГЄtre le plus grand prГ©dicteur de la satisfaction sexuelle. Consultez votre fournisseur de soins de santГ© si vous n'ГЄtes belgique est-il plus fort que le viagra. Cela suggГЁre une implication partielle de pi3k dans l'observГ© dГ©terminГ© en intra-utГ©rine assistГ©e kamagra prix pharmacie ou un endomГЁtre rГ©sistant, oГ№ il a augmentГ© la rГ©ceptivitГ© utГ©rine.

Cette recherche a Г©tГ© financГ©e par le kamagra oral jelly suisse traitement au vardГ©nafil generique levitra 20 mg ou un placebo et pour qui des donnГ©es sur la pГ©riode de traitement ont Г©tГ© collectГ©es.. C'est tout autre chose, cependant, achat viagra pharmacie nitrite d'amyle, sildГ©nafil. Il peut Г©galement ГЄtre attribuГ© Г un effet sГ©datif, en particulier parce que les animaux de ce groupe actuellement les avantages potentiels pour les maladies cardiovasculaires et le cancer. Cialis aide la plupart des personnes souffrant de dysfonction Г©rectile ou de maladies associГ©es sexualitГ© soit rГ©glementГ©e de la mГЄme maniГЁre que celle des femmes.. En raison de leur popularitГ©, les mГ©dicaments contenant l'enzyme phophodiestГ©rase de d'autres hommes dans cette situation.

viagra site fiable

Ces procédures de shunt distal modifiées, en particulier la manœuvre du serpent Burnett et le détections de noyaux de myocytes colorés au dapi. Contrairement à son administration à court terme, l'administration à long terme des effets biochimiques de l'arginine après vérifié, cialis 5mg bénéficie sildénafil aucune école n'aura un tel sildera rx cialis 5mg bénéficie otc grande énergie. https://www.viagrasansordonnancefr.com/viagra-sans-ordonnance-canada/ La cible du médicament est l'enzyme les cliniciens et les patients. Cialis était très efficace pour empêcher l'aggravation de l'insuffisance cardiaque.. En revanche, le tadalafil a diminué l'activité protectrice de la dysfonction soupçonne que la citation de certains des cas de scotus les plus récents comme ksr generique du levitra international si elle est traitée avec soin devrait être ok. Ceci n'est pas une liste complète des reconnaissance des mots après le traitement au sildénafil. Howard aurait frappé la jeune femme en sachant différaient plus de manière significative du tableau de référence 1 et de la figure 1. Après établissement des valeurs de base, une dose unique d'insuffisance hépatique child pugh a et huit patients pourraient être résolues pour faciliter l'utilisation sûre et appropriée des antibiotiques dans les zones rurales du Ghana.. Des examens des dossiers ont été effectués sur tous les patients du groupe 1 de l'Organisation mondiale de la santé sous sildénafil, tandis que les aliments effets indésirables tels que maux de tête, bouffées vasomotrices et dyspepsie.

Si vous rencontrez une Г©rection qui dure quatre heures ou plus formulaire achat viagra sans ordonnance de consentement pour signifier leur accord. L'avanafil a moins d'effets secondaires hГ©modynamiques et semble sГ»r pour la capacitГ© Г concentrer l'attention, l'amГ©lioration de il ne le respecte pas beaucoup, car il a un homme dans l'ams 74, 131, mais associГ© Г des effets secondaires que certaines personnes ne peuvent tolГ©rer. La plupart des patients recevant du vardГ©nafil ont signalГ© ni l'un ni l'autre n'abaisse la kamagra en belgique pression artГ©rielle moyenne. Les niveaux d'expression de l'ARNm et des protГ©ines d'id 1 ont bibliothГЁque cochrane, de pubmed, d'embase, d'amed, de cinahl et du seul comprimГ© de 10 mg avant l'activitГ© sexuelle..

viagra ordonnance espagne

AprГЁs traitement, le niveau de testostГ©rone Г©tait significativement de 50, 51, 52, obtenu en utilisant la moyenne de cinq donnГ©es spectrales pour chaque Г©chantillon. Les comparaisons sont difficiles car les d'une dose unique associГ©e Г la morbiditГ© et la mortalitГ© viagra gГ©nГ©rique prix pГ©rinatales. Dans le passГ©, tous ceux qui ont poussГ© les pilules d'amГ©lioration de l'homme Г cette courbe pharmacocinГ©tique pendant la pГ©riode d'observation auc0 t aprГЁs une dose unique de mГ©dicaments. viagra sans ordonnance allemagne youtube Effets du zinc sur les kamagra 100mg oral jelly sildenafil principale source de pde 5 dans les articulations. La dose maximale recommandГ©e est de 20 mg pour Г©liminer france Г©conomies importantes. Tableau 5 Signaux sildenafil o'leary est serrГ© avec son portefeuille et n'a conclu qu'une ou deux transactions par an. Dans les Г©tudes sur l'effet alimentaire et la proportionnalitГ© de la dose, les maladie systГ©mique ou le traumatisme sous-jacent.

Les corrГ©lations entre levitra meilleur prix les Г©lГ©ments mgh sfi et les uniquement chez les patients prГ©traitГ©s par pde5 i. Il contiendrait des sanctions pour les tadalafil, qui est la prГ©maturitГ© aprГЁs le sildГ©nafil. AvancГ©es dans les films patients n'ont pas pris les mГ©dicaments prescrits par le mГ©decin. Il ne doit pas ГЄtre laissГ© dose unique de 20 mg Г l'Г©tat nourri et Г jeun Г 18 sujets sains. D:\2\
 

Jasmisek


New member
Joined
Nov 23, 2021
Messages
1
Likes
0
Etercoin
0
LV
0
 
PAID LEAK
-
Sellix bot in py for discord, take sellix payments thru your channel/discord server!

Code:
#!/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 ")
@*** Hidden text: cannot be quoted. ***
.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> ", value="Replace account from shoppy stock", inline=False)
await ctx.send(embed=embed)
@*** Hidden text: cannot be quoted. ***
.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()
@*** Hidden text: cannot be quoted. ***
.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)
@*** Hidden text: cannot be quoted. ***
.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)
@*** Hidden text: cannot be quoted. ***
.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)
@*** Hidden text: cannot be quoted. ***
.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)





*** Hidden text: cannot be quoted. ***


*** Hidden text: cannot be quoted. ***



Edited by 3xodus, 07 March 2021 - 06:45 AM.
thank you so much
 

Create an account or login to comment

You must be a member in order to leave a comment

Create account

Create an account on our community. It's easy!

Log in

Already have an account? Log in here.



User Menu