コード例 #1
0
    async def on_ready(self, event):
        await self.bot.update_presence(
            activity=hikari.Activity(
                name=f"{self.bot.prefix}help in {len([server async for server in self.bot.rest.fetch_my_guilds()])} servers | What a drag....",
                type=hikari.ActivityType.WATCHING,
            )
        )
        print("""\n\n
   _____ _                                                                                               
  / ____| |   (_) |                                    (_)                        | |      
 | (___ | |__  _| | ____ _ _ __ ___   __ _ _ __ _   _   _ ___   _ __ ___  __ _  __| |_   _ 
  \___ \| '_ \| | |/ / _` | '_ ` _ \ / _` | '__| | | | | / __| | '__/ _ \/ _` |/ _` | | | |
  ____) | | | | |   < (_| | | | | | | (_| | |  | |_| | | \__ \ | | |  __/ (_| | (_| | |_| |
 |_____/|_| |_|_|_|\_\__,_|_| |_| |_|\__,_|_|   \__,_| |_|___/ |_|  \___|\__,_|\__,_|\__, |
                                                                                      __/ |
                                                                                     |___/ 
              \n\n""")
コード例 #2
0
 async def on_ready(self, event):
     await self.bot.update_presence(activity=hikari.Activity(
         name=
         f"sh!help in {len([server async for server in self.bot.rest.fetch_my_guilds()])} servers | What a drag....",
         type=hikari.ActivityType.WATCHING))
     print("\n\n I'm ready for work! What a drag.....\n\n")
コード例 #3
0
ファイル: run.py プロジェクト: VaradRege/shikamaru-bot
import os
import inspect
import hikari
import importlib
import shikamaru
from shikamaru import bot

print(f"\n\n\nShikamaru v{shikamaru.__version__} by", shikamaru.__author__, "\n\n\n")

bot.hidden_plugins = ["SuperUser", "Events", "Help"]

# Loading plugins
# If you are familiar with Discord.py, plugins are similar to cogs
for i in os.listdir('./shikamaru/plugins'):
    if i.endswith(".py"):
        plugin = importlib.import_module(f"shikamaru.plugins.{i[:-3]}")
        plugin.load(bot)



# Running bot
bot.run(activity=hikari.Activity(
    name=f"{bot.prefix}help",
    type=hikari.ActivityType.WATCHING
))
コード例 #4
0
ファイル: __main__.py プロジェクト: FlasH1719/Builder
import hikari
from builder.config import *
from builder.bot import BuilderBot
from builder.database.client import DBClient

cache_settings = hikari.CacheSettings(invites=False,
                                      voice_states=False,
                                      messages=False)

intents = (hikari.Intents.GUILD_MEMBERS | hikari.Intents.GUILDS
           | hikari.Intents.GUILD_MESSAGES)

bot_settings = {
    "token": TOKEN,
    "prefix": "",
    "ignore_bots": True,
    "cache_settings": cache_settings,
    "intents": intents
}

database = DBClient(database=POSTGRES_DATABASE,
                    password=POSTGRES_PASSWORD,
                    user=POSTGRES_USER,
                    host=POSTGRES_HOST)

bot = BuilderBot(database, **bot_settings)
bot.run(activity=hikari.Activity(name="the trading market",
                                 type=hikari.ActivityType.COMPETING))
コード例 #5
0
import os
import inspect
import hikari
import importlib
import shikamaru
from shikamaru import bot

print(f"\n\n\nShikamaru v{shikamaru.__version__} by", shikamaru.__author__,
      "\n\n\n")

# Loading plugins
# If you are familiar with Discord.py, plugins are similar to cogs
for i in os.listdir('./shikamaru/plugins'):
    if i.endswith(".py"):
        plugin = importlib.import_module(f"shikamaru.plugins.{i[:-3]}")
        plugin.load(bot)

# Running bot
bot.run(activity=hikari.Activity(name=f"sh!help",
                                 type=hikari.ActivityType.WATCHING))
コード例 #6
0
ファイル: bot.py プロジェクト: Cercvinatori/GameTracker-Bot
import logging, lightbulb, hikari, os, mysql.connector
from os import environ, listdir
from config import TOKEN, HOST, USER, PASSWD, DATABASE

conn = mysql.connector.connect(host=HOST,
                               user=USER,
                               passwd=PASSWD,
                               database=DATABASE)

c.execute(
    "CREATE TABLE IF NOT EXISTS costumers(ip TEXT, ipname TEXT, guild_id TEXT)"
)
c.execute("CREATE TABLE IF NOT EXISTS language(lan TEXT, guild_id TEXT)")
conn.commit()

bot = lightbulb.Bot(
    token=TOKEN,  #change it
    prefix=">",
    intents=hikari.Intents.ALL)
bot.remove_command("help")
print(bot.heartbeat())

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

bot.run(activity=hikari.Activity(name=">help | gametrackerbot.cf",
                                 type=hikari.ActivityType.PLAYING),
        asyncio_debug=True)
コード例 #7
0
ファイル: client.py プロジェクト: GodEmpressVerin/requiem
async def handle_presence(bot: Requiem) -> None:
    possible = ("Listening for Slash Commands", "Waiting for something to do",
                "Grinding gears")
    activity = hikari.Activity(name=random.choice(possible))
    await bot.update_presence(activity=activity)