def send_embed(link, fields, site, image, product, webhook): ''' (str, str, list, str, str, str) -> None Sends a discord alert based on info provided. ''' embed = Webhook(webhook, color=123123) #if(alert_type == "NEW_SHOPIFY"): desc = product #elif(alert_type == "RESTOCK_SHOPIFY"): #desc = "RESTOCK: " + product embed.set_author(name='coplitshoes', icon='') embed.set_desc(desc) for field in fields: #if(alert_type == "NEW_SHOPIFY" or alert_type == "RESTOCK_SHOPIFY"): cart_link = site + "/cart/" + str(field[1]) + ":1" embed.add_field(name=str(field[0]), value=cart_link) if (image is not None): embed.set_thumbnail(image) embed.set_image(image) embed.set_footer(text='coplitshoes', icon='', ts=True) embed.post()
def EmbedMsg(): global Author global AuthorID global Title global Banner global RankedLink global Length global BPM global GMFormat global GMFormat2 embed = Webhook(webhook, color=0x0098f9) embed.set_author(name='New {} map by {}'.format(GMFormat, Author), icon='https://a.ppy.sh/{}'.format(AuthorID), url='https://osu.ppy.sh/users/{}'.format(AuthorID)) embed.set_title(title='**__{}__**'.format(Title), url=RankedLink) embed.set_thumbnail(Banner) embed.set_desc("""**BPM:** {} **Song Length:** {} **Containing:** {} """.format(BPM, Length, GMFormat2)) embed.set_footer(text='Ranked!', ts=True, icon='https://hypercyte.s-ul.eu/W4GBjy0M') embed.post() NewRanked()
def send_embed(alert_type, link, fields, site, image, product): ''' (str, str, list, str, str, str) -> None Sends a discord alert based on info provided. ''' url = webhook embed = Webhook(url, color=123123) if(alert_type == "NEW_SHOPIFY"): desc = "NEW: " + product elif(alert_type == "RESTOCK_SHOPIFY"): desc = "RESTOCK: " + product embed.set_author(name='StirFry', icon='https://pbs.twimg.com/profile_images/1086659064304676865/oX8NsFC-_400x400.jpg') embed.set_desc(desc) for field in fields: if(alert_type == "NEW_SHOPIFY" or alert_type == "RESTOCK_SHOPIFY"): cart_link = site + "/cart/" + str(field[1]) + ":1" embed.add_field(name=str(field[0]), value=cart_link) if(image is not None): embed.set_thumbnail(image) embed.set_image(image) embed.set_footer(text='StirFry', icon='https://pbs.twimg.com/profile_images/1086659064304676865/oX8NsFC-_400x400.jpg', ts=True) embed.post()
def send_embed(alert_type, product): ''' (str, str, list, str, str, str) -> None Sends a discord alert based on info provided. ''' # Set webhook url = https://discordapp.com/api/webhooks/555053278308859927/D1AsxzUajXuA3fchYuXwq_ib2OHW3S-UpNNYyYanoW7W2Eo9rBb-evVneSeRyPX_SOy7 # Create embed to send to webhook embed = Webhook(url, color=123123) # Set author info embed.set_author(name='NERYS', icon='https://static.zerochan.net/Daenerys.Targaryen.full.2190849.jpg') # Set product details if(alert_type == "RESTOCK"): embed.set_desc("RESTOCK: " + product.title) elif(alert_type == "NEW"): embed.set_desc("NEW: " + product.title) embed.add_field(name="Product", value=product.title) embed.add_field(name="Link", value=product.link) embed.add_field(name="Stock", value=str(product.stock)) # Set product image embed.set_thumbnail(product.image) embed.set_image(product.image) # Set footer embed.set_footer(text='NERYS by @snivynGOD', icon='https://static.zerochan.net/Daenerys.Targaryen.full.2190849.jpg', ts=True) # Send Discord alert embed.post()
def send_embed(alert_type, link, fields, site, image, product): ''' (str, str, list, str, str, str) -> None Sends a discord alert based on info provided. ''' url = webhook embed = Webhook(url, color=123123) if (alert_type == "NEW_SHOPIFY"): desc = "NEW: " + product elif (alert_type == "RESTOCK_SHOPIFY"): desc = "RESTOCK: " + product embed.set_author( name='NERYS', icon='https://static.zerochan.net/Daenerys.Targaryen.full.2190849.jpg') embed.set_desc(desc) for field in fields: if (alert_type == "NEW_SHOPIFY" or alert_type == "RESTOCK_SHOPIFY"): cart_link = site + "/cart/" + str(field[1]) + ":1" embed.add_field(name=str(field[0]), value=cart_link) if (image is not None): embed.set_thumbnail(image) embed.set_image(image) embed.set_footer( text='NERYS by @snivynGOD', icon='https://static.zerochan.net/Daenerys.Targaryen.full.2190849.jpg', ts=True) embed.post()
def error_hooking(base, type): url = "<WEBHOOK>" embed = Webhook(url, color=123123) embed.set_desc(type.strip(':')) embed.add_field(name="Link", value=base) embed.add_field(name="Error", value="Can't get this product. Please contact with developer") embed.set_footer(text='Powered by <COMPANY NAME>', ts=True,icon='<ICON>') embed.post()
def post_to_webhook(self, slug): post = self.get_post_from_server(slug) msg_string = (post['body'][:250] + '...') if len(post['body']) > 250 else post['body'] embed = Webhook(HOOK_URL, color=123123) embed.set_author(name=post['title'], icon='https://cdn6.aptoide.com/imgs/5/1/f/51fc6f8666c50ce7456651810d7a4439_icon.png?w=240') embed.set_desc(msg_string) embed.add_field(name='Read more', value=post['url']) embed.post()
def webhook(link, currency, photo, title, description, ino): link = 'https://www.supremenewyork.com' + link.rstrip() url = "<WEBHOOK>" embed = Webhook(url, color=123123) embed.set_desc("RESTOCK: [{0}]({1})".format(title, link)) embed.add_field(name="Description", value=description) embed.add_field(name="Ino", value=ino) embed.add_field(name="Currency", value=currency) embed.add_field(name="Link", value=link) embed.set_thumbnail(photo) embed.set_footer(text='Powered by <COMPANY NAME>', ts=True, icon='<FOOTER ICON>') embed.post()
def send_embed(alert_type, product): ''' (str, str, list, str, str, str) -> None Sends a discord alert based on info provided. ''' # Set webhook url = discord_webhook # Create embed to send to webhook embed = Webhook(url, color=123123) # Set author info embed.set_author( name='Nike', icon= 'https://static-breeze.nike.co.kr/kr/ko_kr/cmsstatic/theme/52/android-icon-36x36.png' ) # Set product details if (alert_type == "RESTOCK"): embed.set_desc("RESTOCK: " + "title") elif (alert_type == "NEW"): embed.set_desc("NEW: " + product.title) # Name, Code, Color, Date, Price # Early Link # Time embed.add_field(name="Name", value=product.name) embed.add_field(name="Code", value=product.code) embed.add_field(name="Color", value=product.color) embed.add_field(name="Price", value=product.price) embed.add_field(name="Link", value=product.siteLink) embed.add_field(name="Time", value=product.pTime) embed.add_field(name="ImgLink", value=product.imgLink) # Set product image embed.set_thumbnail(product.imgLink) embed.set_image(product.imgLink) # Set footer embed.set_footer( text='Nike by @DevHong', icon= 'https://static-breeze.nike.co.kr/kr/ko_kr/cmsstatic/theme/52/android-icon-36x36.png', ts=True) # Send Discord alert embed.post()
def send_embed(product): ''' (Product) -> None Sends a discord alert based on info provided. ''' url = "https://discord.com/api/webhooks/811178312336277504/ekKQ7L_aSJSbBWRiD7xH9PrcjeibAIG6P-KhMkVCLWDggsgzRSqSljNPQKPFkFSm69Mj" embed = Webhook(url, color=123123) embed.set_author(name='NERYS', icon='https://static.zerochan.net/Daenerys.Targaryen.full.2190849.jpg') embed.set_desc("Found product based on keyword " + product.keyword) embed.add_field(name="Link", value=product.link) embed.set_footer(text='NERYS by @snivynGOD', icon='https://static.zerochan.net/Daenerys.Targaryen.full.2190849.jpg', ts=True) embed.post()
def send_embed(product): ''' (Product) -> None Sends a discord alert based on info provided. ''' url = 'https://discordapp.com/api/webhooks/479049758254825472/kmK_bdEZ_bH_fmDoGJ_rS2AB1Xedn2CHwiviMhzGbaxZ9ES5U8nTCorV6qQnRVd12mp_' embed = Webhook(url, color=123123) embed.set_author(name='Premier Cooks', icon='https://pbs.twimg.com/profile_images/1031725580075585536/s0GlPWIB_400x400.jpg') embed.set_desc("Found product based on keyword " + product.keyword) embed.add_field(name="Link", value=product.link) embed.set_footer(text='Nike Monitor by @PremierCooks', icon='https://pbs.twimg.com/profile_images/1031725580075585536/s0GlPWIB_400x400.jpg', ts=True) embed.post()
def send_embed(product): ''' (Product) -> None Sends a discord alert based on info provided. ''' url = 'WEBHOOK HERE' embed = Webhook(url, color=42320) embed.set_author(name='MY-Monitor') embed.set_desc("Found product based on keyword " + product.keyword) embed.add_field(name="Link", value=product.link) embed.set_footer(text='by keem#0815, Notify Beta', ts=True) embed.post()
def send_embed(product): ''' (Product) -> None Sends a discord alert based on info provided. ''' url = 'https://discordapp.com/api/webhooks/532298624114229268/pgNC5uyKSNOzitqRbm60E7G9p-fcjzhwHsss1biNP9TuxwbqNJbdj5y9HDtISSsf4yCc' embed = Webhook(url, color=123123) embed.set_author(name='NERYS', icon='https://static.zerochan.net/Daenerys.Targaryen.full.2190849.jpg') embed.set_desc("Found product based on keyword " + product.keyword) embed.add_field(name="Link", value=product.link) embed.set_footer(text='NERYS by @snivynGOD', icon='https://static.zerochan.net/Daenerys.Targaryen.full.2190849.jpg', ts=True) embed.post()
def send_embed(product): ''' (Product) -> None Sends a discord alert based on info provided. ''' url = 'INSERT YOUR WEBHOOK HERE' embed = Webhook(url, color=123123) embed.set_author(name='NERYS', icon='https://static.zerochan.net/Daenerys.Targaryen.full.2190849.jpg') embed.set_desc("Found product based on keyword " + product.keyword) embed.add_field(name="Link", value=product.link) embed.set_footer(text='NERYS by @snivynGOD', icon='https://static.zerochan.net/Daenerys.Targaryen.full.2190849.jpg', ts=True) embed.post()
def main(argv): global changelist_icon webhook_url = P4_COMMITS_WEBHOOK_URL change = -1 discord_userid = '-1' # Retrieve input arguments try: opts, args = getopt.getopt(argv, "tc:") except getopt.GetoptError: print( "Invalid arguments! -c ChangeNumber -t (to use TEST_WEBHOOK_URL)") sys.exit(2) for opt, arg in opts: if opt == '-c': change = arg if opt == '-t': webhook_url = TEST_WEBHOOK_URL # If no change was given, simply exit if change == -1: print("No change number supplied!") sys.exit(3) # Function will get description and user info about this change and store in a dictionary change_data = get_change_data(change, P4PORT, P4LOGIN, P4PASS) # Match Perforce user from perforce change info to actual Discord user using pre-set dictionaries discord_userid = discord_userids[change_data["user"]] discord_username = discord_usernames[change_data['user']] # Set up and send the embed embed_title = u'Change %s \u2022 %s (%s) \u2022 %s' % ( change, change_data['user'], discord_username, change_data['client']) embed_description = '%s' % (change_data['desc']) message = Webhook(webhook_url, color=0x10b1df) message.set_author( name=embed_title, icon=changelist_icon ) # Author field is used for smaller/more compact font and inline icon message.set_desc(embed_description) message.post()
def send_embed(alert_type, product): ''' (str, str, list, str, str, str) -> None Sends a discord alert based on info provided. ''' # Set webhook url = webhook_url #url = 'https://discordapp.com/api/webhooks/481411222118465550/8TanFM9unt2Ztf_ySUGlus9MNw9DVDaTKNXAQZpMYvtnoucHevzCYn0gjwV_ZpQmKsTQ' # Create embed to send to webhook embed = Webhook(url, color=123123) # Set author info embed.set_author( name='Mrporter', icon= 'https://previews.123rf.com/images/martialred/martialred1604/martialred160400080/55731598-%EB%A9%94%EC%8B%9C%EC%A7%80-%EC%95%B1%EA%B3%BC-%EC%9B%B9-%EC%82%AC%EC%9D%B4%ED%8A%B8%EC%97%90-%EB%8C%80%ED%95%9C-chatbot-%EC%B1%84%ED%8C%85-%EB%B4%87-%EB%98%90%EB%8A%94-%EC%B1%84%ED%84%B0-%EB%B4%87-%EB%9D%BC%EC%9D%B8-%EC%95%84%ED%8A%B8-%EC%95%84%EC%9D%B4%EC%BD%98.jpg' ) # Set product details if (alert_type == "RESTOCK"): embed.set_desc("RESTOCK: " + "title") elif (alert_type == "NEW"): embed.set_desc("NEW: " + product.name) embed.add_field(name="Product", value=product.name) embed.add_field(name="Brand", value=product.brand) embed.add_field(name="Price", value=product.price) embed.add_field(name="Link", value=product.siteLik) embed.add_field(name="ImgLink", value=product.link) # Set product image #embed.set_thumbnail('https://cache.mrporter.com/images/products/1054353/1054353_mrp_fr_l.jpg') #embed.set_image(product.link) # Set footer embed.set_footer( text='Mrporter by @DevHong', icon='https://static.zerochan.net/Daenerys.Targaryen.full.2190849.jpg', ts=True) # Send Discord alert embed.post()
def Run(): time.sleep(5) print('偵測') artdata = np.load('artdata.npy').item() for lists in data['Item']: for user in lists['Users']: try: arts = pixiv.user(user).works() Userinfo = pixiv.user(user).User() except Exception as e: loginPixiv() continue for art in arts: try: if artdata[user] == art.id: break except Exception: pass embed = Webhook(lists['WebhookURL'], color=123123) embed.set_author( name=Userinfo['name'], url='https://www.pixiv.net/member.php?id=' + user, icon=UrlReplace( Userinfo['profile_image_urls']['px_50x50'])) embed.set_image(UrlReplace(art.image)) embed.set_title(title=art.title, url=art.link) if not art.tags == None: Tag = '' for tags in art.tags: Tag = Tag + tags + '、' embed.add_field(name='標籤(Tags)', value=Tag[:-1]) Tag = '' if not art.caption == None: embed.set_desc(art.caption) embed.set_footer(text=strmd, icon="https://i.imgur.com/UNPFf1f.jpg", ts=True) embed.post() artdata[user] = arts[0].id np.save('artdata.npy', artdata)
def send_embed(alert_type, product): ''' (str, str, list, str, str, str) -> None Sends a discord alert based on info provided. ''' # Set webhook url = discord_webhook # Create embed to send to webhook embed = Webhook(url, color=123123) # Set author info embed.set_author( name='Premier Cooks', icon= 'https://pbs.twimg.com/profile_images/1031725580075585536/s0GlPWIB_400x400.jpg' ) # Set product details if (alert_type == "RESTOCK"): embed.set_desc("RESTOCK: " + product.title) elif (alert_type == "NEW"): embed.set_desc("NEW: " + product.title) embed.add_field(name="Product", value=product.title) embed.add_field(name="Link", value=product.link) embed.add_field(name="Stock", value=str(product.stock)) # Set product image embed.set_thumbnail(product.image) embed.set_image(product.image) # Set footer embed.set_footer( text='Supreme Monitor by @premiercooks', icon= 'https://pbs.twimg.com/profile_images/1031725580075585536/s0GlPWIB_400x400.jpg', ts=True) # Send Discord alert embed.post()
def send_embed(product): url = 'https://discordapp.com/api/webhooks/818881746308169749/TB7nvYzt6A4ZwJPEJzGFVzuRKpYRHR61Ka329pMCwWyF4fFwpV4Lt2lCdy1y8FljjkGz' embed = Webhook(url, color=123123) embed.set_author( name='ARB', icon= 'https://sun9-74.userapi.com/impf/x8e2VAfW-ao86OPcoUeSKpB7sup-dlIC3bT-2g/I3Vwk9su7D8.jpg?size=564x532&quality=96&sign=423037df9ddf5c5400c93844710086c3&type=album' ) embed.set_desc("Found product based on keyword " + product.keyword) embed.add_field(name="Link", value=product.link) embed.set_footer( text='ARB by @JaqueFresco', icon= 'https://sun9-11.userapi.com/impf/DagUwT61wIcd0BeLtPOI3UFtf2nV2ZK9Gh-8NQ/ehNPfNbLWGA.jpg?size=754x750&quality=96&sign=ce4bfc72ef8fdcfbbf3c11dbd8589382&type=album', ts=True) embed.post()
def send_embed(alert_type, product): url = discord_webhook embed = Webhook(url, color=123123) embed.set_author(name='ARB', icon='https://sun9-74.userapi.com/impf/x8e2VAfW-ao86OPcoUeSKpB7sup-dlIC3bT-2g/I3Vwk9su7D8.jpg?size=564x532&quality=96&sign=423037df9ddf5c5400c93844710086c3&type=album') if(alert_type == "RESTOCK"): embed.set_desc("RESTOCK: " + product.title) elif(alert_type == "NEW"): embed.set_desc("NEW: " + product.title) embed.add_field(name="Product", value=product.title) embed.add_field(name="Link", value=product.link) embed.add_field(name="Stock", value=str(product.stock)) # Set product image embed.set_thumbnail(product.image) embed.set_image(product.image) # Set footer embed.set_footer(text='ARB by @JaqueFresco', icon='https://sun9-11.userapi.com/impf/DagUwT61wIcd0BeLtPOI3UFtf2nV2ZK9Gh-8NQ/ehNPfNbLWGA.jpg?size=754x750&quality=96&sign=ce4bfc72ef8fdcfbbf3c11dbd8589382&type=album', ts=True) # Send Discord alert embed.post()
def send_embed(alert_type, link, fields, site, image, product): ''' (str, str, list, str, str, str) -> None Sends a discord alert based on info provided. ''' url = webhook embed = Webhook(url, color=123123) if (alert_type == "NEW_SHOPIFY"): desc = "NEW: " + product elif (alert_type == "RESTOCK_SHOPIFY"): desc = "RESTOCK: " + product embed.set_author( name='ARB', icon= 'https://sun9-74.userapi.com/impf/x8e2VAfW-ao86OPcoUeSKpB7sup-dlIC3bT-2g/I3Vwk9su7D8.jpg?size=564x532&quality=96&sign=423037df9ddf5c5400c93844710086c3&type=album' ) embed.set_desc(desc) for field in fields: if (alert_type == "NEW_SHOPIFY" or alert_type == "RESTOCK_SHOPIFY"): cart_link = site + "/cart/" + str(field[1]) + ":1" embed.add_field(name=str(field[0]), value=cart_link) if (image is not None): embed.set_thumbnail(image) embed.set_image(image) embed.set_footer( text='ARB by @JaqueFresco', icon= 'https://sun9-11.userapi.com/impf/DagUwT61wIcd0BeLtPOI3UFtf2nV2ZK9Gh-8NQ/ehNPfNbLWGA.jpg?size=754x750&quality=96&sign=ce4bfc72ef8fdcfbbf3c11dbd8589382&type=album', ts=True) embed.post()
def send_embed(alert_type, product): ''' (str, str, list, str, str, str) -> None Sends a discord alert based on info provided. ''' # Set webhook url = discord_webhook # Create embed to send to webhook embed = Webhook(url, color=123123) # Set author info embed.set_author( name='NERYS', icon='https://static.zerochan.net/Daenerys.Targaryen.full.2190849.jpg') # Set product details if (alert_type == "RESTOCK"): embed.set_desc("RESTOCK: " + product.title) elif (alert_type == "NEW"): embed.set_desc("NEW: " + product.title) embed.add_field(name="Product", value=product.title) embed.add_field(name="Link", value=product.link) embed.add_field(name="Stock", value=str(product.stock)) # Set product image embed.set_thumbnail(product.image) embed.set_image(product.image) # Set footer embed.set_footer( text='NERYS by @snivynGOD', icon='https://static.zerochan.net/Daenerys.Targaryen.full.2190849.jpg', ts=True) # Send Discord alert embed.post()
def send_embed(product): ''' (Product) -> None Sends a discord alert based on info provided. ''' url = 'https://discordapp.com/api/webhooks/481411222118465550/8TanFM9unt2Ztf_ySUGlus9MNw9DVDaTKNXAQZpMYvtnoucHevzCYn0gjwV_ZpQmKsTQ' embed = Webhook(url, color=123123) embed.set_author( name='NERYS', icon='https://static.zerochan.net/Daenerys.Targaryen.full.2190849.jpg') embed.set_desc("Found product based on keyword " + product.keyword) embed.add_field(name="Link", value=product.link) embed.set_footer( text='NERYS by @snivynGOD', icon='https://static.zerochan.net/Daenerys.Targaryen.full.2190849.jpg', ts=True) embed.post()
def send_embed(product): ''' (Product) -> None Sends a discord alert based on info provided. ''' url = 'https://discordapp.com/api/webhooks/539724977209999370/WhJDAUZX1AqV6WagfJ8PEVIV9FiLjpYrh2zIP6eLu8794S4QF3etmqE22JBVQsn3auPl' embed = Webhook(url, color=123123) embed.set_author( name='NERYS', icon='https://static.zerochan.net/Daenerys.Targaryen.full.2190849.jpg') embed.set_desc("Found product based on keyword " + product.keyword) embed.add_field(name="Link", value=product.link) embed.set_footer( text='NERYS by @snivynGOD', icon='https://static.zerochan.net/Daenerys.Targaryen.full.2190849.jpg', ts=True) embed.post()
def send_embed(product): ''' (Product) -> None Sends a discord alert based on info provided. ''' url = 'https://discordapp.com/api/webhooks/587167482788446210/rWMXZRqEthmb8TZvWIM5MPYytAEkqVPEfmaTs1hu0cQ98qaBKFyg6Wxivk8tMonh9zJO' embed = Webhook(url, color=123123) embed.set_author( name='NERYS', icon='https://static.zerochan.net/Daenerys.Targaryen.full.2190849.jpg') embed.set_desc("Found product based on keyword " + product.keyword) embed.add_field(name="Link", value=product.link) embed.set_footer( text='NERYS by @snivynGOD', icon='https://static.zerochan.net/Daenerys.Targaryen.full.2190849.jpg', ts=True) embed.post()
def send_embed(product): ''' (Product) -> None Sends a discord alert based on info provided. ''' url = 'https://discordapp.com/api/webhooks/609541516377194508/nJqkl98mdg9SvlF0pIZmJ-YY8EePCwQdfLJ-4oB4WJj3WR6Ve0LpzFZGHcOLrvDyxrAT' embed = Webhook(url, color=123123) embed.set_author( name='NERYS', icon='https://static.zerochan.net/Daenerys.Targaryen.full.2190849.jpg') embed.set_desc("Found product based on keyword " + product.keyword) embed.add_field(name="Link", value=product.link) embed.set_footer( text='NERYS by @snivynGOD', icon='https://static.zerochan.net/Daenerys.Targaryen.full.2190849.jpg', ts=True) embed.post()
def send_embed(product): ''' (Product) -> None Sends a discord alert based on info provided. ''' url = 'https://discordapp.com/api/webhooks/467639983512092682/LSRvJNEmNPI4ZBF-Qt0NHcVVmQNRsBwE_3hdJVMDX-kSaNEEU-8UB-nt-yxU5m7n5Qw6' embed = Webhook(url, color=123123) embed.set_author( name='NERYS', icon='https://static.zerochan.net/Daenerys.Targaryen.full.2190849.jpg') embed.set_desc("Found product based on keyword " + product.keyword) embed.add_field(name="Link", value=product.link) embed.set_footer( text='NERYS by @snivynGOD', icon='https://static.zerochan.net/Daenerys.Targaryen.full.2190849.jpg', ts=True) embed.post()
def send_embed(product): ''' (Product) -> None Sends a discord alert based on info provided. ''' url = 'https://discord.com/api/webhooks/728820147346997278/ocPnHwKHaeCLeq1N1UJ7nAmO1qvat3sxr2G5xv72TubAGZWmhajDzknK9CfR6ZpvxA2i' embed = Webhook(url, color=123123) embed.set_author( name='NERYS', icon='https://static.zerochan.net/Daenerys.Targaryen.full.2190849.jpg') embed.set_desc("Found product based on keyword " + product.keyword) embed.add_field(name="Link", value=product.link) embed.set_footer( text='NERYS by @snivynGOD', icon='https://static.zerochan.net/Daenerys.Targaryen.full.2190849.jpg', ts=True) embed.post()
def send_embed(product): ''' (Product) -> None Sends a discord alert based on info provided. ''' url = 'https://discordapp.com/api/webhooks/555053278308859927/D1AsxzUajXuA3fchYuXwq_ib2OHW3S-UpNNYyYanoW7W2Eo9rBb-evVneSeRyPX_SOy7' embed = Webhook(url, color=123123) embed.set_author( name='NERYS', icon='https://static.zerochan.net/Daenerys.Targaryen.full.2190849.jpg') embed.set_desc("Found product based on keyword " + product.keyword) embed.add_field(name="Link", value=product.link) embed.set_footer( text='NERYS by @snivynGOD', icon='https://static.zerochan.net/Daenerys.Targaryen.full.2190849.jpg', ts=True) embed.post()
def on_status(self, status): print("New tweet from monitored handle:") print(status.text) ifvoid = 0 #finds "RT" in first 2 characters of a tweet (retweet) if((str(status.text[:2]).find("RT")) != -1): print("This is a retweet or someone abusing the negative filter, we'll ignore this!") ifvoid = 1 #finds "https://" anywhere in the tweet" elif((str(status.text).find("https://")) != -1 and ifvoid == 0): print("This tweet is an image or link!") #sends tweet contents to discord embed = Webhook(url) embed.set_desc("@everyone - NEW LINK/IMAGE FROM " + handle + ":") embed.add_field(name="Tweet Contents", value=str(status.text)) embed.set_footer(text="Twitter Monitor by @__ized on twitter",ts=True) embed.post() print("Tweet Sent to Discord!") #finds and sends expanded url to discord foundurls = re.findall(r'(https?://\S+)', str(status.text)) urlnumber = len(foundurls) print("Number of URLs in tweet: " + urlnumber) currenturl = 1 while currenturl <= urlnumber: uri = urlexpander.unshorten(foundurls[currenturl - 1]) embed = Webhook(url) embed.set_desc("Expanded URL:") embed.add_field(name="-->", value=uri) embed.set_footer(text="Twitter Monitor by @__ized on twitter",ts=True) embed.post() currenturl = currenturl + 1 print("Expanded URL " + uri + " Sent To Discord!") #finds "@" in the first character of a tweet (reply) elif((str(status.text[:1]).find("@")) == 0 and ifvoid == 0): print("This is likely a reply or other tweet, will not send") else: print("This is a regualr tweet, will send!") embed = Webhook(url) embed.set_desc("New tweet from " + handle + ":") embed.add_field(name="Tweet Contents", value=str(status.text)) embed.set_footer(text="Twitter Monitor by @__ized on twitter",ts=True) embed.post()