diff --git a/BotResources.py b/BotResources.py index e804994..a0d15aa 100644 --- a/BotResources.py +++ b/BotResources.py @@ -126,6 +126,7 @@ def write_config_file(**kwargs): def get_device_list(): list_of_devices = query_devices().items() + LOGGER.info("Returning queried device list:") LOGGER.debug(list_of_devices) return list_of_devices diff --git a/bot.py b/bot.py index 0822e6f..8a1fe79 100644 --- a/bot.py +++ b/bot.py @@ -14,9 +14,11 @@ class Bot(commands.Bot): def __init__(self, **kwargs): # If there is no custom command prefix (!help, ?help, etc.), use '>!' but also accept @ mentions if 'command_prefix' not in kwargs.keys(): + bot_intents = set_server_intents() kwargs['command_prefix'] = '>!' commands.Bot.__init__(self, command_prefix=commands.when_mentioned_or(kwargs['command_prefix']), - activity=discord.Game(name=f"@ me"), status=discord.Status.idle) + activity=discord.Game(name=f"@ me"), status=discord.Status.idle, + intents=bot_intents) # Create the logger for the bot self.logger = logging.getLogger("Discord_Radio_Bot.Bot") @@ -578,3 +580,12 @@ class Bot(commands.Bot): message_body += f"\tSquelch:\t\t\t\t{config[section]['Squelch']}\n" return message_body + + +# Set discord intents and return the intent object +def set_server_intents(): + bot_intents = discord.Intents.default() + #bot_intents.messages = True + #bot_intents.message_content = True + #bot_intents.members = True + return bot_intents \ No newline at end of file diff --git a/main.py b/main.py index 00825ed..caf4990 100644 --- a/main.py +++ b/main.py @@ -42,6 +42,7 @@ def main(**passed_config): if not config: LOGGER.warning("No config file exists, please enter this information now") BotResources.write_config_file(init=True) + config = BotResources.read_config_file() # Overwrite config options if they were passed if len(passed_config.keys()) == 0: