Skip to main content

UniqueBot python SDK

Project description

UBPY

UniqueBots 파이썬 비공식 SDK입니다.

공식 SDK- 출시되었습니다. URL

SaidBySolo님의 KoreanBots비공식 sdk레포의 일부를 사용해 제작되었습니다. URL

현재는 길드수업데이트, 투표여부 모듈만 존재합니다,

길드수업데이트 모듈은 자동으로 30분마다 자동으로 길드수를 비교해 요청을 보냅니다.

파이썬 3.6이상을 필요로 합니다.

pip install UBPY --upgrade

길드 수 업데이트

Use not Cogs

import discord
from discord.ext import commands
import UBPY
bot = commands.Bot(command_prefix='!')
#or
bot = discord.Client()

UBPY.Client(bot,token='UniqueBots TOKEN',bot_id="BOT ID")

@bot.event
async def on_ready():
    print(f"{bot.user.name} 준비 완료.")

bot.run('Discord TOKEN')

Using Cogs

import UBPY
import discord
from discord.ext import commands

class GuildCount(commands.Cog):

    def __init__(self, bot):
        self.bot = bot
        self.token = "UniqueBots TOKEN"
        self.id = "Bot ID"
        UBPY.Client(self.bot,self.token,self.id)

def setup(bot):
    bot.add_cog(GuildCount(bot))

유저 봇 투표여부

Cogs

import UBPY
import discord
from discord.ext import commands

class CheckVote(commands.Cog):

    def __init__(self, bot):
        self.bot = bot
        self.token = "UniqueBots TOKEN"
        self.id = "Bot ID"

    @commands.command(name="투표확인")
    async def _checkvote(self,ctx):
        VOTE = UBPY.UBPYvote(ctx, self.token, bot_id=self.id)
        check = await VOTE.vote()
        if check == True:
            print('TRUE')
        elif check == False:
            print('FALSE')
        else:
            print('ERROR')

def setup(bot):
    bot.add_cog(CheckVote(bot))

검색

cogs

import UBPY
import discord
from discord.ext import commands

class Search(commands.Cog):

    def __init__(self, bot):
        self.bot = bot
        self.token = "UniqueBots TOKEN"

    @commands.command(name="봇리스트")
    async def _searchlist(self,ctx,page=1):
        """
        리스트에서 불러올수있는 봇정보:
        tag, heartCount, discordVerified, guilds, id, status, brief, avatar, prefix, invite, locked, library
        """
        ser = UBPY.UBPYsearch(self.token)
        res = await ser.List(page)
        if res == False:
            print('error')
        else:
            for i in res:
                print(i["tag"])

    @commands.command(name="봇검색")
    async def _searchlist(self,ctx,ID):
        """
        불러올수있는 봇정보:
        tag, heartCount, discordVerified, guilds, id, status, brief, avatar, prefix, invite, locked, library
        """
        ser = UBPY.UBPYsearch(self.token)
        res = await ser.search(ID=ID)
        if res == False:
            print('error')
        else:
            print(res["tag"])


def setup(bot):
    bot.add_cog(Search(bot))

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

UBPY-3.3.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

UBPY-3.3-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file UBPY-3.3.tar.gz.

File metadata

  • Download URL: UBPY-3.3.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.6rc1

File hashes

Hashes for UBPY-3.3.tar.gz
Algorithm Hash digest
SHA256 6c227c2e1b5c2a34b54daf8e9ee57ecabb205358e5b49b9f267359bbd804f3de
MD5 5ec81bcf3b557152f7aaff53de167c45
BLAKE2b-256 2206985eb866b1f9b90553e33d11ed17e7d7539fc0d2d587db0d95c3c5aed490

See more details on using hashes here.

File details

Details for the file UBPY-3.3-py3-none-any.whl.

File metadata

  • Download URL: UBPY-3.3-py3-none-any.whl
  • Upload date:
  • Size: 6.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.6rc1

File hashes

Hashes for UBPY-3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 aff37b46abbacd8a2cff06d34aff8eb7a8c7a65327de075e47d44cc386dea0e0
MD5 aa6530467beda8f5cabc4a3c0fcb16e1
BLAKE2b-256 8d6a0c0f6b3de02990f2c4628ea135bd439877741428facc1b44bcfff301a31c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page