示例#1
0
    def __init__(self, test_mode: bool = False, **options):
        """
        Initialize `Latte` instance.
        :param test_mode: boolean value which indicates whether latte should run as test mode.
        :param args: arguments which is required to call superclass`s __init__() method.
        :param kwargs: keyword-arguments which is required to call superclass`s __init__() method.
        """
        if "command_prefix" in options.keys():
            options.pop("command_prefix")
        if "help_command" in options.keys():
            options.pop("help_command")

        # Set bot`s test mode
        self.test_mode = test_mode

        # Set discord & bot`s logger
        self._set_logger(discord_level=logging.INFO)
        self.logger = self.get_logger()

        # Initialize bot`s service instance
        # self.service = LatteService(bot=self)

        # Setup bot
        self._setup()
        super(Latte, self).__init__(command_prefix=self.get_guild_prefix,
                                    help_command=None,
                                    **options)

        self.db = DBWrapper(id=self.config["database"]["id"],
                            pw=self.config["database"]["pw"],
                            host=self.config["database"]["host"],
                            port=self.config["database"]["port"])
        self.koreanbot = koreanbots.Client(
            self, self.config.config["api"]["koreanbots"], postCount=True)
示例#2
0
 def __init__(self, *args, **kwargs):
     super().__init__(*args, **kwargs)
     self.debug = self.get_settings("debug")
     self.slash = SlashCommand(self, auto_register=True)
     self.db = SQLiteDB("main")
     self.logger = logging.getLogger("cork")
     self.koreanbots = koreanbots.Client(self,
                                         self.get_settings("kor_token"),
                                         postCount=not self.debug)
示例#3
0
 def __init__(self, *args, **kwargs):
     with open("bot_settings.json", "r") as f:
         bot_settings = json.load(f)
         token = bot_settings["koreanbots_token"]
         debug = bot_settings["debug"]
     super().__init__(*args, **kwargs)
     self.koreanbots = koreanbots.Client(self, token, postCount=False if debug else True)
     self.lavalink: lavalink.Client
     self.jbot_db_global = jbot_db.JBotDB("jbot_db_global")
     self.jbot_db_warns = jbot_db.JBotDB("jbot_db_warns")
     self.jbot_db_level = jbot_db.JBotDB("jbot_db_level")
     self.jbot_db_memory = jbot_db.JBotDB(":memory:")
     self.__stable_token = bot_settings["stable_token"]
     self.__canary_token = bot_settings["canary_token"]
     self.last_stock_change = 0
     self.loop.create_task(self.init_lava())
示例#4
0
from pytz import timezone
from datetime import timedelta
import ast
import koreanbots
from PIL import Image

#기본 변수 설정

prefix = "''"

with open('koreanbots_token.txt', 'r') as a:
    ko_bot_token = a.read()

app = commands.Bot(command_prefix=["''", '"'], intents=Intents.all())
app.remove_command("help")
Bot = koreanbots.Client(app, ko_bot_token)

with open('token.txt', 'r') as a:
    token = a.read()

OWNERS = [
    745848200195473490,  #yswysw
    674813875291422720,  #tim
    441202161481809922  #심심러
]

SpecialDays = [
    '1225',  #크리스마스
    '1224',  #크리스마스 이브
    '0101',  #신정
    '1231',  #신정 연휴
示例#5
0
文件: main.py 项目: geuntae021/Miya
 def __init__(self, *args, **kwargs):
     super().__init__(*args, **kwargs)
     self.koreanbots = koreanbots.Client(self, config.DBKRToken)
示例#6
0
volakey = (os.environ['volatoken'])

response = requests.get(korea + key)
text = response.text
data = json.loads(text)

def RandomColor():
    return randint(0, 0xFFFFFF)

Authorization = (os.environ['pingpongtoken'])
URL = "https://builder.pingpong.us/api/builder/5fed20b6e4b07b8420ab7483/integration/v0.2/custom/{sessionId}"

INTENTS = discord.Intents.all()
bot = commands.Bot(command_prefix=['?', '띵아 '], intents=INTENTS)
Ping = PingPong(URL, Authorization)
KBot = koreanbots.Client(bot, (os.environ['kbtoken']))
slash = SlashCommand(bot)

@bot.event
async def on_ready():
    print(bot.user.name)
    print(bot.user.id)
    print("준비 완료!")
    c = 786076322945564682
    embed = discord.Embed(
            title="띵이봇이 켜졌습니다!!",
            description=f"띵이봇의 전원이 켜졌어요!",
            color=RandomColor()
        )
    await bot.get_channel(int(c)).send(embed=embed)
    messages = ["'?help'을 입력해 띵이봇과 노는법을 알아보세요!","애브리띵#2227","이 메시지는 5초마다 변경됩니다!","https://thinge.teb.kro.kr","TEB 2.41.3",f"유저 {len(bot.users)}명, 길드 {len(bot.guilds)}개에서 함께하는 중!"]
示例#7
0
import asyncio
import random
import os
import requests
from bs4 import BeautifulSoup
import qrcode
from discord.utils import get
from Dtime import Uptime
import time
import typing
import youtube_dl
import re
import koreanbots

client = commands.AutoShardedBot(command_prefix="데쿠야 ")
Bot = koreanbots.Client(client, os.environ['TOKEN2'])
Uptime.uptimeset()
client.remove_command('help')


@client.event
async def on_ready():
    print("다음으로 로그인합니다")
    print(client.user.name)
    print(client.user.id)
    print("================")

    messages = [
        f'{len(client.guilds)}개의 서버 | {len(client.users)}명의 유저',
        (f"{int(client.latency *1000)}ms")
    ]
示例#8
0
import discord
from discord.ext import commands
from discord.ext import tasks
from itertools import cycle
import asyncio
import os
import koreanbots
import cpuinfo

intents = discord.Intents.all()
bot = commands.Bot(command_prefix='.', intents=intents)
bot.remove_command("help")
토큰 = ""
embedcolor = 0xffff33
embederrorcolor = 0xff0000
Bot = koreanbots.Client(bot, '')
cpu = cpuinfo.get_cpu_info()

for filename in os.listdir("Cogs"):
    if filename.endswith(".py"):
        bot.load_extension(f"Cogs.{filename[:-3]}")

@bot.event
async def on_ready():
    print(f'Main\n{bot.user.name}')
    Data = await Bot.getBot('765535083124752394')
    status = cycle(['.help', f'서버:{len(bot.guilds)}개/유저:{len(bot.users)}명이랑 함께', '이 메세지를 10초마다 다르게'])
    @tasks.loop(seconds=10)
    async def change_status():
        await bot.change_presence(status=discord.Status.online,activity=discord.Game(next(status)))
    change_status.start()