pycord icon indicating copy to clipboard operation
pycord copied to clipboard

Missing Prefixes

Open Deadtrix21 opened this issue 4 years ago • 2 comments

Summary

The prefixes that are specified using the class version of the bot are not available when actually running the bot except for "when mentioned"

it doesn't take any other prefixes except "when mentioned" the prefix_delta does not seem to be added to the possible prefixes

Minimal Reproducible Code

import discord, os, json
from discord.ext import commands
from pprint import pprint


async def get_prefix(bot, ctx):
    prefix_delta = ["x","X","..."]
    return commands.when_mentioned_or(*prefix_delta)(bot, ctx)

class Bot (commands.AutoShardedBot):
    def __init__(self, command_prefix=get_prefix):
        super().__init__(command_prefix)
        self.bot = self
        self.config = self.get_config()

    def get_config(self, arg=None):
        file = os.path.join(os.getcwd()+"/config/bot.json")
        with open(file,"r") as form:
            arg = json.load(form)
            form.close()
        return arg
    
    
    
    def start_up(self):
        self.bot.run(self.config['token'])

bot = Bot()
bot.start_up()

Expected Results

all of the preixes should be able to be used when calling a command from the bot

Actual Results

only the when mentioned "prefix" is accessible to be used to call the bot

Intents

members

System Information

  • Python v3.9.2-final
  • py-cord v2.0.0-beta
    • py-cord pkg_resources: v2.0.0b4
  • aiohttp v3.7.4
  • system info: Linux 5.14.0-9parrot1-amd64 #1 SMP Debian 5.14.9-9parrot1 (2021-10-26)

Checklist

  • [X] I have searched the open issues for duplicates.
  • [X] I have shown the entire traceback, if possible.
  • [X] I have removed my token from display, if visible.

Additional Context

No response

Deadtrix21 avatar Mar 03 '22 13:03 Deadtrix21

Did you enabled the message intent in the developer portal and in the settings

Lulalaby avatar Mar 03 '22 13:03 Lulalaby

You need to enable the message content intent in both the code and the dev portal.

Dorukyum avatar Mar 03 '22 13:03 Dorukyum