Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import requests
- import json
- import datetime
- import discord
- import os
- import time
- from discord.ext import commands
- r = requests.get('https://www.antisocialsocialclub.com/products.json')
- products = json.loads((r.text))['products']
- date = datetime.datetime.today()
- timerugh = datetime.datetime.now()
- time2 = timerugh.strftime("%I:%M:%S")
- producturl = 'https://www.antisocialsocialclub.com/'
- # current = date.strftime("%Y-%m-11T00:56:30-04:00")
- current = date.strftime("%Y-%m-%dT" + time2 + "-12:00")
- print("time2" + " " + time2)
- print("current" + " " + current)
- token = 'NjMyMTA2ODE4NjA0MjM2ODEw.XaQweg.0ibxG1nB0IUFJI96YWat7yhsc8U'
- client = commands.Bot(command_prefix = '.')
- @client.event
- async def on_message(message):
- r = requests.get('https://www.dertbag.us/products.json?limit=10000000000000')
- products = json.loads((r.text))['products']
- date = datetime.datetime.today()
- timerugh = datetime.datetime.now()
- time2 = timerugh.strftime("%I:%M:%S")
- producturl = 'https://www.dertbag.us'
- # current = date.strftime("%Y-%m-11T00:56:30-04:00")
- current = date.strftime("%Y-%m-%dT" + time2 + "-12:00")
- channels = ['monitor']
- if str(message.channel) in channels:
- if message.content.find("power on") != -1:
- print("bot on")
- await message.channel.send("on")
- r = requests.get('https://www.dertbag.us/products.json?limit=10000000000000')
- products = json.loads((r.text))['products']
- date = datetime.datetime.today()
- print('ASSC monitor')
- i = 0
- while i < 6:
- timerugh = datetime.datetime.now()
- time2 = time.strftime("%I:%M:%S")
- for product in products:
- # print(product['updated_at'])
- # print(product['title'])
- restocktime = product['updated_at']
- producturl = 'https://www.dertbag.us/collections/home/products/' + product['handle']
- timerugh = datetime.datetime.now()
- time2 = time.strftime("%I:%M:%S")
- if time2 == timerugh.strftime("12:%M:%S"):
- time2 = timerugh.strftime("00:%M:%S")
- # print(time2 + " " + "time converted")
- current = date.strftime("%Y-%m-%dT" + time2 + "-04:00")
- #print(time2)
- #print(current)
- if restocktime == current:
- await message.channel.send(product['title'] + " " + "Restocked At" + " " + current + " " + "on" + " " + producturl)
- time.sleep(1)
- elif message.content == "!current time":
- print("time shown")
- await message.channel.send(current)
- client.run(token)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement