Conditions | 3 |
Total Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | import requests |
||
20 | def handle(self, event): |
||
21 | try: |
||
22 | target = re.search("https?://[\S]+", event.line).group(0) |
||
23 | if len(target) > 60: |
||
24 | url = 'https://is.gd/create.php' |
||
25 | payload = {'format':'simple', 'url':target} |
||
26 | r = requests.get(url, params=payload) |
||
27 | self.say(event.channel, r.text) |
||
28 | |||
29 | except requests.exceptions.HTTPError as e: |
||
30 | self.bot.debug_print("HTTPError") |
||
31 | self.bot.debug_print(str(e)) |
||
32 | |||
33 |