diff --git a/README.md b/README.md index dd6cbae..e5fb195 100644 --- a/README.md +++ b/README.md @@ -9,27 +9,13 @@ Check by from time to time to see what has changed. :) # Installation 1. Check that you create a venv and then install requirements.txt in there. - - python3 -m venv venv - - Linux: source venv/bin/activate - - pip install -r requirements.txt -2. Visit https://discordpy.readthedocs.io/en/latest/discord.html to read about how to create a bot on the Discord Website. -3. Then make a copy of bot.ini.example and name it "bot.ini". Edit the file. -4. Run the bot inside the venv. - - Make sure u're inside the venv. - - Now: python3 pybot-f.py -5. Invite the bot to your server using the provided link after successfully starting the bot. +2. Then edit the bot.ini.example and move it to bot.ini . +3. Run the bot by using your venv interpreter. # Bugs If you find a bug or have a feature request, visit https://code.nextgamers.eu/freaky/pybot-f/issues . -# Extensions -- Extensions are how you create "plugins/modules" for the bot to provide additional features. There are some .example extension files in - the ext/ folder. -- If you need more information visit https://discordpy.readthedocs.io/en/latest/index.html#extensions and read about extensions there. -- The Jishaku extension is always loaded and downloaded from the network on requirement.txt updates. The module provides administration commands. - it is not written by me. -- Jishaku Documentation: https://jishaku.readthedocs.io/en/latest/index.html +If you don't want to load the example extensions, just move them to some other ending (not .py). -# Notes -- There is a .gitignore which ignores things like bot.ini and bot.log with git so passwords and logs are not getting commited to git. -- A better description and HowTo will follow someday, maybe in the wiki. :) +# Note +A better description and HowTo will follow someday, maybe in the wiki. :) \ No newline at end of file diff --git a/ext/administration.py.example b/ext/administration.py similarity index 100% rename from ext/administration.py.example rename to ext/administration.py diff --git a/ext/test.py.example b/ext/test.py similarity index 100% rename from ext/test.py.example rename to ext/test.py diff --git a/test2.py.example b/ext/test2.py similarity index 100% rename from test2.py.example rename to ext/test2.py diff --git a/pybot-f.py b/pybot-f.py index bee0bf2..91c20e2 100644 --- a/pybot-f.py +++ b/pybot-f.py @@ -7,26 +7,10 @@ import asyncio import typing from discord.ext import commands import logging -from logging import handlers - # Logging -#loghandler = logging.FileHandler(filename='bot.log', encoding='utf-8', mode='w') -#discord.utils.setup_logging(handler=loghandler) - -logger = logging.getLogger('discord') -logger.setLevel(logging.INFO) - -loghandler = logging.handlers.RotatingFileHandler( - filename='bot.log', - encoding='utf-8', - maxBytes=32 * 1024 * 1024, # 32 MiB - backupCount=5, # Rotate through 5 files -) -dt_fmt = '%Y-%m-%d %H:%M:%S' -formatter = logging.Formatter('[{asctime}] [{levelname:<8}] {name}: {message}', dt_fmt, style='{') -loghandler.setFormatter(formatter) -logger.addHandler(loghandler) +loghandler = logging.FileHandler(filename='bot.log', encoding='utf-8', mode='w') +discord.utils.setup_logging(handler=loghandler) # logger = logging.getLogger('discord') # logger.setLevel(logging.INFO) @@ -49,7 +33,6 @@ config.read('bot.ini') bottoken = config['General']['bottoken'] - # Setting up commands.Bot bot = commands.Bot(command_prefix='.', description=description, intents=intents)