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, description
        """
        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, description
        """
        ser = UBPY.UBPYsearch(self.token)
        res = await ser.search(ID=ID)
        if res == False:
            print('error')
        else:
            print(res["tag"])

    @commands.command(name="유저검색")
    async def _searchlist(self,ctx,ID,page=1):
        """
        불러올수있는 봇정보:
        tag, heartCount, discordVerified, guilds, id, 
        status, brief, avatar, prefix, invite, locked, library, description
        """
        ser = UBPY.UBPYsearch(self.token)
        res = await ser.searchuser(ID=ID,page)
        if res == False:
            print('error')
        else:
            for i in res:
                print(i["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-4.2.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

UBPY-4.2-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: UBPY-4.2.tar.gz
  • Upload date:
  • Size: 5.3 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-4.2.tar.gz
Algorithm Hash digest
SHA256 2107a8a7998492f0732da4eb51130e468e0f163abe9663c3cd0a89d6c81f4d7c
MD5 c6988929be9dd00839263614d4929125
BLAKE2b-256 1e2f458b3245a2999de7ddb3c0b962b78f64bb9b80fab74c204af55515531ad4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: UBPY-4.2-py3-none-any.whl
  • Upload date:
  • Size: 6.8 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-4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b8ef5c648c1f83e0935a547bcff83e86a2eb3965891111df5550a58423545145
MD5 9c097de07b9a379f2833c3b458e580dd
BLAKE2b-256 cc3c3d55c41619d9c2f9ee8b2c064c3fd26012b6bc53061d30ff2fe97faf3f69

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