Skip to content

Missing Prefixes #1104

Closed
Closed
@Deadtrix21

Description

@Deadtrix21

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 Update README.rst #1 SMP Debian 5.14.9-9parrot1 (2021-10-26)

Checklist

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

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    unconfirmed bugA bug report that needs triaging

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions