Mora Docs
공식홈페이지Mora 상태
  • 환영합니다
  • 고객센터 안내
  • 🤖Team Bot
    • Mora 봇
      • 문의방법
      • 개발팀
        • 봇개발팀
        • 대시보드개발팀
      • 명령어
        • 기본기능
          • 도움말
          • 건의하기
          • 문의하기
          • 신고하기
          • 서포트서버
        • 대화기능
        • 경제기능
        • 오락기능
        • 검색기능
        • 전적기능
        • 뮤직기능
        • 유틸리티
        • 관리기능
    • Mora Music
    • 도박봇
    • 추첨봇
    • 레벨봇
    • 로그봇
    • 관리봇
    • 보안봇
    • 상점봇
  • 📱API
    • API 소개
    • API Status
    • API 가이드
      • Version 1
        • ⌨️ 타자번역
        • 🔒캡챠
        • 깃허브
        • 맞춤법검사
        • 발음번역
        • 랜덤숫자
        • 글자뒤집기
        • URL단축
      • Version 2
        • 검열기
        • 깃허브
        • 날씨
        • 랜덤일러스트
        • 캡챠
        • QR코드
      • Version 3
        • 가사
        • NSFW
  • 📩새로운 소식
    • 업데이트 소식
      • 2023년 9월 23일
      • 2023년 9월 18일
      • 2023년 9월 5일
Powered by GitBook
On this page
  • Templates
  • NodeJS
  • Python

Was this helpful?

Edit on GitHub
  1. API
  2. API 가이드
  3. Version 1

맞춤법검사

Mora Api 맞춤법검사 입니다.

Templates

  • API는 모두 GET 메서드를 사용합니다

  • GET URL : https://mora-bot.kr/api/v1/grammar?string={검사할 문장}

Field
Type
Description

original

String

호출된 문장

wrong

String

호출된 문장의 틀린부분

suggestions

String

호출된 문장의 추천문장

more

String

호출된 문장의 해설

// 응답 내용
{
    "message":"there is nothing wrong",
    "license":"hanspell module used https://www.npmjs.com/package/hanspell",
    "status":200,
    "original":"안녕하세요",
    "errnum":0,
    "success":true
}

NodeJS

// node-fetch
let text = '검사할 문장'
const fetch = require('node-fetch')
fetch(`https://mora-bot.kr/api/v1/grammar?string=${encodeURI(text)}`)
    .then(res => res.json())
    .then(json => {
        console.log(`라이선스 : ${json.license}`)
        console.log(`원래 문장 : ${json.original}`)
        console.log(`틀린 부분 : ${json.wrong}`)
        console.log(`추천 : ${json.suggestions}`)
        console.log(`해설 : ${json.more}`)
    });

// request
let text = '검사할 문장'
let api_url = `https://mora-bot.kr/api/v1/grammar?string=${encodeURI(text)}`
const request = require('request');
let options = {
    url: api_url
}
request.get(options, function (error, response, body) {
    if (!error && response.status == 200) {
        let json = JSON.parse(body)
        console.log(`라이선스 : ${json.license}`)
        console.log(`원래 문장 : ${json.original}`)
        console.log(`틀린 부분 : ${json.wrong || 0}`)
        console.log(`추천 : ${json.suggestions || '틀린 부분 없음'}`)
        console.log(`해설 : ${json.more || '틀린 부분 없음'}`)
    } else {
        console.log('error = ' + response.errorcode);
    }
});

Python

import requests

response = requests.get("https:/mora-bot.kr/api/v1/grammar?string=검사할문장")
result = response.json()

if response.status == 200:
  print(result)
else:
  print(f"Error Code: {response.errorcode}")
Previous깃허브Next발음번역

Last updated 1 year ago

Was this helpful?

📱