This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from __future__ import (absolute_import, division, print_function, unicode_literals) | |
from bothub_client.bot import BaseBot | |
def handle_message(self, event, context): | |
message = event.get('content') | |
if message == '/start': | |
self.send_message('Hello') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from bothub_client.bot import BaseBot | |
from .nmt import Translate | |
class Bot(BaseBot): | |
def handle_message(self, event, context): | |
message = event.get('content') | |
if message == '/start': | |
self.send_start_message() | |
else: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import sys | |
import json | |
from urllib.request import Request | |
from urllib.request import urlopen | |
from urllib.parse import quote | |
class Translate(object): | |
base_url = 'https://openapi.naver.com/v1' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from __future__ import (absolute_import, division, print_function, unicode_literals) | |
from bothub_client.bot import BaseBot | |
from bothub_client.messages import Message | |
from bothub_client.decorators import channel, command | |
from .korbit import coin_detail |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from __future__ import (absolute_import, division, print_function, unicode_literals) | |
from bothub_client.bot import BaseBot | |
import tweepy | |
class Bot(BaseBot): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from __future__ import (absolute_import, division, print_function, unicode_literals) | |
from bothub_client.bot import BaseBot | |
class Bot(BaseBot): | |
def handle_message(self, event, context): | |
message = event.get('content') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from __future__ import (absolute_import, division, print_function, unicode_literals) | |
from bothub_client.bot import BaseBot | |
from bothub_client.messages import Message | |
import re | |
import requests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from __future__ import (absolute_import, division, print_function, unicode_literals) | |
from bothub_client.bot import BaseBot | |
from bothub_client.messages import Message | |
from .weather import get_weather | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import requests | |
base_url = 'http://api.openweathermap.org/data/2.5/weather' | |
def get_weather(lat, lon, appid): | |
url = '{}?lat={}&lon={}&appid={}'.format(base_url, lat, lon, appid) | |
response = requests.get(url) | |
data = response.json() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from __future__ import (absolute_import, division, print_function, unicode_literals) | |
from bothub_client.bot import BaseBot | |
from bothub_client.messages import Message | |
from .korbit import coin_detail | |
class Bot(BaseBot): | |