Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to set up a guild #24

Closed
Nekoiscool opened this issue Dec 28, 2021 · 6 comments
Closed

How to set up a guild #24

Nekoiscool opened this issue Dec 28, 2021 · 6 comments

Comments

@Nekoiscool
Copy link

Traceback (most recent call last):
File "/workspaces/Bloo/./main.py", line 9, in
from utils.database import db
File "/workspaces/Bloo/utils/database.py", line 22, in
db = Database()
File "/workspaces/Bloo/utils/database.py", line 19, in init
raise Exception(f"The database has not been set up for guild {cfg.guild_id}! Please refer to README.md.")
Exception: The database has not been set up for guild 925495467205328906! Please refer to README.md.

@ja1dan
Copy link
Contributor

ja1dan commented Dec 28, 2021

Fill out the information in setup.py and run it.

@Nekoiscool
Copy link
Author

Hello, thanks for the reply.
I filled out everything in setup.py and it still says that the database has not been set up

import os

import mongoengine
from dotenv import find_dotenv, load_dotenv

from data.model.guild import Guild

load_dotenv(find_dotenv())

async def setup():
    print("STARTING SETUP...")
    guild = Guild()

    # you should have this setup in the .env file beforehand
    guild._id          = int(os.environ.get("MAIN_GUILD_ID"))

    guild.case_id      = 904470652344496179

    guild.role_administrator = 925732019479126017  # put in the role IDs for your server here
    guild.role_birthday      = 925732192221536368  # put in the role IDs for your server here
    guild.role_dev           = 925732676877561866  # put in the role IDs for your server here
    guild.role_genius        = 925816737486745711  # put in the role IDs for your server here

    guild.role_memberone     = 925732674084167730  # put in the role IDs for your server here
    guild.role_memberedition = 925816994245251102  # put in the role IDs for your server here
    guild.role_memberplus    = 925817065309372486  # put in the role IDs for your server here
    guild.role_memberpro     = 925817156862611587  # put in the role IDs for your server here
    guild.role_moderator     = 925733434775711814  # put in the role IDs for your server here

    guild.role_sub_mod       = 925817336160727072  # put in the role IDs for your server here
    guild.role_sub_news      = 925817492717334569  # put in the role IDs for your server here

    guild.channel_applenews      = 925733763298754591  # put in the channel IDs for your server here
    guild.channel_booster_emoji  = 925817701044203531  # put in the channel IDs for your server here
    guild.channel_botspam        = 925817729057960006  # put in the channel IDs for your server here
    guild.channel_common_issues  = 925817759324078140  # put in the channel IDs for your server here
    guild.channel_development    = 925817788088594462  # put in the channel IDs for your server here
    guild.channel_emoji_log      = 925818152842047619  # put in the channel IDs for your server here
    guild.channel_general        = 909203497398976542  # put in the channel IDs for your server here
    guild.channel_private        = 909203502088192040  # put in the channel IDs for your server here
    guild.channel_public         = 925818247511683203  # put in the channel IDs for your server here
    guild.channel_reaction_roles = 925818468102721588  # put in the channel IDs for your server here
    guild.channel_reports        = 925818318059864154  # put in the channel IDs for your server here
    guild.channel_subnews        = 925818525153644637  # put in the channel IDs for your server here
    guild.channel_music          = 909203499030548521  # put in the channel IDs for your server here

    guild.emoji_logging_webhook = "https://discord.com/api/webhooks/925818710852255796/-u9ql8rhQxaHmGvtPzExdyr1WumYOU-ryM6Yoco6bnqo1uxshuOR617kJghJ8fIoTBxK" # create a webhook in the channel where you want react logging and put the link here

    guild.logging_excluded_channels = []  # put in a channel if you want (ignored in logging)
    guild.filter_excluded_channels  = []  # put in a channel if you want (ignored in filter)
    guild.filter_excluded_guilds    = []  # put guild ID to whitelist in invite filter if you want

    guild.nsa_guild_id = 123 # you can leave this as is if you don't want Blootooth (message mirroring system)

    guild.role_member        = 123  # this is no longer used, leave as is.
    guild.role_mute          = 123  # this is no longer used, leave as is.

    guild.save()

    print("DONE")

if __name__ == "__main__":
    if os.environ.get("DB_CONNECTION_STRING") is None:
        mongoengine.register_connection(
            host=os.environ.get("DB_HOST"), port=int(os.environ.get("DB_PORT")), alias="default", name="botty")
    else:
        mongoengine.register_connection(
            host=os.environ.get("DB_CONNECTION_STRING"), alias="default", name="botty")
    res = asyncio.get_event_loop().run_until_complete( setup() )```

@ja1dan
Copy link
Contributor

ja1dan commented Dec 29, 2021

And you ran python setup.py? Looks like everything should be working...

@Nekoiscool
Copy link
Author

Nevermind it works! Thank you so much for guiding me but I noticed that the slash commands aren't working. Could you tell me why?

@ja1dan
Copy link
Contributor

ja1dan commented Dec 29, 2021

When you invited the bot to the server, did you select both the "bot" and "application.commands" scopes?

@Nekoiscool
Copy link
Author

No, I just reinvited the bot and it works now! Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants