text: import discord
  from discord.ext import commands,tasks
  from colorama import Fore
  import json
  import requests
  
  import eewdata
  import webserver
  
  with open('config.json','r') as f:
    config = json.load(f)
  
  bot = commands.Bot(
    command_prefix=config['prefix'],
    help_command=None
  )
  
  if config['token'] == "":
    print(Fore.RED + "Botのトークンを入力してください" + Fore.RESET)
    exit()
  if config['eew_channel'] == "":
    print(Fore.RED + "地震情報を送信するチャンネルのIDを指定してください" + Fore.RED)
    exit()
  
  @bot.event
  async def on_ready():
    print(Fore.GREEN + f"正常に起動しました\nBot:{bot.user}" + Fore.RESET)
    eew_check.start()
  
  @bot.command()
  async def help(ctx):
    embed=discord.Embed(title="ヘルプ",description=f"コマンド\n`{config['prefix']}eew`")
    await ctx.send(embed=embed)
    
  @bot.command()
  async def eew(ctx):
    request = requests.get("https://api.p2pquake.net/v2/history?codes=551&limit=1")
    response = request.json()[0]
    if request.status_code == 200:
      embed=eewdata.eew_embed(response)
      await ctx.send(embed=embed)
    else:
      await ctx.send("APIリクエストでエラーが発生しました")
  
  @tasks.loop(minutes=1)
  async def eew_check():
    with open('data/cache.json','r') as f:
      eew_updatekey = json.load(f)['eew_updatekey']
    request = requests.get("https://api.p2pquake.net/v2/history?codes=551&limit=1")
    response = request.json()[0]
    if not (response['earthquake']['maxScale']/10) <= int(config['notify_scale']):
      if request.status_code == 200:
        if eew_updatekey != response['id']:
          print(Fore.MAGENTA + "地震情報の更新を確認しました" + Fore.RESET)
          with open('config.json','r') as f:
            channel_id = int(json.load(f)['eew_channel'])
          channel = bot.get_channel(channel_id)
          embed=eewdata.eew_embed(response)
          await channel.send(embed=embed)
          print(Fore.MAGENTA + f"地震情報を{channel.name}へ送信しました" + Fore.RESET)
          with open('data/cache.json','r') as f:
            eew_updatekey = json.load(f)
            eew_updatekey['eew_updatekey'] = response['id']
          with open('data/cache.json','w') as f:
            json.dump(eew_updatekey,f,indent=4)
      else:
        return
  
  webserver.open()
  bot.run(config['token'])  
  