Untitled

By Soiled Crocodile, 5 Years ago, written in Python, viewed 115 times.
URL http://pb.stoleyour.com/view/558b76ce Embed
Download Paste or View RawExpand paste to full width of browser
  1. import discord
  2. import asyncio
  3. import urllib.request
  4. import requests
  5. from discord.ext import commands
  6.  
  7. class Shorten:
  8.  
  9.     def __init__(self, bot):
  10.         self.bot = bot
  11.  
  12.     @commands.command(pass_context=True)
  13.     async def ouo(self, ctx):
  14.         if "467711093888909334" in [role.id for role in ctx.message.author.roles]:
  15.                         await self.bot.say("I have the role")
  16.             if "71597167550144512" == ctx.message.author.id:
  17.                 url = ("http://ouo.io/api/B3Nm9g8L?s=" + ctx.message.content)
  18.                 handle = urllib.request.Request(url, headers={'User-Agent': 'Mozilla/5.0'})
  19.                 html = urllib.request.urlopen(handle).read().decode('utf-8')
  20.                 await self.bot.say("Here you go :link: " + html)
  21.             elif "129360731085864961" == ctx.message.author.id:
  22.                 await self.bot.say("user2")
  23.         else:
  24.             await self.bot.say("nein " + ctx.message.author.id)
  25.  
  26. def setup(bot):
  27.     bot.add_cog(Shorten(bot))

Reply to "Untitled"

Here you can reply to the paste above