Esempio n. 1
0
import discord
from discord.ext import commands
import asyncio
from pokemonlist import pokemon, pokejson, pokejson_by_name
from cspm_utils import find_pokemon_id, get_team_id, get_team_name, get_team_color, get_egg_url, get_time
from config import admin_channel, log_channel2, admin_role_id, bot_channel, token, host, user, password, database, website, log_channel, instance_id, legendary_id, curfew
import datetime
import calendar
import time
import threading

bot = commands.Bot(command_prefix='!')  # Set prefix to !
bot.remove_command('help')
database = MySQLdb.connect(host, user, password, database)

cursor = database.cursor()

print('CSPM Started at ' + str(
    time.strftime(
        '%I:%M %p on %m.%d.%y',
        time.localtime(calendar.timegm(
            datetime.datetime.utcnow().timetuple())))) + ' for ' +
      str(instance_id))


async def incubate(ctx, gym_id, remaining_time):
    channel = discord.Object(id=bot_channel)
    current_time = datetime.datetime.utcnow()
    current_epoch_time = calendar.timegm(current_time.timetuple())
    sleep_time = remaining_time - current_epoch_time
    await bot.send_message(
Esempio n. 2
0
import MySQLdb
import discord
from discord.ext import commands
import asyncio
from pokemonlist import pokemon, pokejson
from config import bot_channel, token, host, user, password, database, website, log_channel
import datetime
import calendar

bot = commands.Bot(command_prefix = '.')#set prefix to .

database = MySQLdb.connect(host,user,password,database)

cursor = database.cursor()

def find_pokemon_id(name):
    if name == 'Nidoran-F':
        return 29
    elif name == 'Nidoran-M':
        return 32
    elif name == 'Mr-Mime':
        return 122
    elif name == 'Ho-Oh':
        return 250
    elif name == 'Mime-Jr':
        return 439
    else:
        name = name.split('-')[0]
        for k in pokejson.keys():
            v = pokejson[k]
            if v == name: