#Allgemeine Hilfe

1 messages · Page 55 of 1

open dragon
restive herald
#

bro du darfst nd eif import tasks schreiben

open dragon
#

was den sonst

restive herald
#

musst from discord.ext import tasksschreiben

open dragon
#

achso danke

#

habe aber trzdm den error mit guild

restive herald
#

hast guild nd definiert

#

das is keine bekannte variable

open dragon
#

ah oke

#

eif. ein parameter nehmen also GUILD=None

restive herald
#

du brauchst ne id

#

wenn die id none is kommt auch none zurück

open dragon
#

die vom channel

open dragon
restive herald
#

du brauchst die id vom channel und der guild

open dragon
#

oke

#

wie von guild? sorry habe lange net mehr gecodet

restive herald
#

vom server

open dragon
#

stimmt danke

#

habe diesen error

restive herald
#

cog hat keine setup funktion

open dragon
#

ah falsch eingeordnet oke

open dragon
wind finch
#

Nah

normal sundial
#

kann mir wer sagen wieso ich diesen error bekomme und wie ich diesen gelöst bekomme?

connection handler failed
Traceback (most recent call last):
  File "C:\Users\Angel\AppData\Local\Programs\Python\Python310\lib\site-packages\websockets\legacy\server.py", line 240, in handler
    payload["response"] = json.dumps(resp)
  File "C:\Users\Angel\AppData\Local\Programs\Python\Python310\lib\json\__init__.py", line 231, in dumps
    return _default_encoder.encode(obj)
  File "C:\Users\Angel\AppData\Local\Programs\Python\Python310\lib\json\encoder.py", line 199, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "C:\Users\Angel\AppData\Local\Programs\Python\Python310\lib\json\encoder.py", line 257, in iterencode
    return _iterencode(o, 0)
  File "C:\Users\Angel\AppData\Local\Programs\Python\Python310\lib\json\encoder.py", line 179, in default
    raise TypeError(f'Object of type {o.__class__.__name__} '
TypeError: Object of type Role is not JSON serializable
#

ich versuche guild.roles in einem dict an die main.py zu schicken um sie auf der website anzuzeigen

tawdry leaf
#

TypeError: Object of type Role is not JSON serializable

normal sundial
#

das hab ich auch schon gelesen aber ich verstehe nicht was das problem ist da es ein dict ist

tawdry leaf
#

gibt es das den in der lib

normal sundial
#

also ich bekomme wenn ich es printe ein dict mit allen roles ja.

normal sundial
#

das ist die print ausgabe. oder wie meinst du es?

#

und bei der main taucht der traceback auf:

Traceback (most recent call last):
  File "C:\Users\Angel\AppData\Local\Programs\Python\Python310\lib\site-packages\uvicorn\protocols\http\h11_impl.py", line 408, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
  File "C:\Users\Angel\AppData\Local\Programs\Python\Python310\lib\site-packages\uvicorn\middleware\proxy_headers.py", line 84, in __call__
    return await self.app(scope, receive, send)
  File "C:\Users\Angel\AppData\Local\Programs\Python\Python310\lib\site-packages\fastapi\applications.py", line 292, in __call__
    await super().__call__(scope, receive, send)
  File "C:\Users\Angel\AppData\Local\Programs\Python\Python310\lib\site-packages\starlette\applications.py", line 122, in __call__
    await self.middleware_stack(scope, receive, send)
  File "C:\Users\Angel\AppData\Local\Programs\Python\Python310\lib\site-packages\starlette\middleware\errors.py", line 184, in __call__
    raise exc
  File "C:\Users\Angel\AppData\Local\Programs\Python\Python310\lib\site-packages\starlette\middleware\errors.py", line 162, in __call__
    await self.app(scope, receive, _send)
  File "C:\Users\Angel\AppData\Local\Programs\Python\Python310\lib\site-packages\starlette\middleware\exceptions.py", line 79, in __call__
    raise exc
  File "C:\Users\Angel\AppData\Local\Programs\Python\Python310\lib\site-packages\starlette\middleware\exceptions.py", line 68, in __call__
    await self.app(scope, receive, sender)
  File "C:\Users\Angel\AppData\Local\Programs\Python\Python310\lib\site-packages\fastapi\middleware\asyncexitstack.py", line 20, in __call__
    raise e
  File "C:\Users\Angel\AppData\Local\Programs\Python\Python310\lib\site-packages\fastapi\middleware\asyncexitstack.py", line 17, in __call__
    await self.app(scope, receive, send)
  File "C:\Users\Angel\AppData\Local\Programs\Python\Python310\lib\site-packages\starlette\routing.py", line 718, in __call__
    await route.handle(scope, receive, send)
  File "C:\Users\Angel\AppData\Local\Programs\Python\Python310\lib\site-packages\starlette\routing.py", line 276, in handle
    await self.app(scope, receive, send)
  File "C:\Users\Angel\AppData\Local\Programs\Python\Python310\lib\site-packages\starlette\routing.py", line 66, in app
    response = await func(request)
  File "C:\Users\Angel\AppData\Local\Programs\Python\Python310\lib\site-packages\fastapi\routing.py", line 273, in app
    raw_response = await run_endpoint_function(
  File "C:\Users\Angel\AppData\Local\Programs\Python\Python310\lib\site-packages\fastapi\routing.py", line 190, in run_endpoint_function
    return await dependant.call(**values)
  File "c:\Users\Angel\Desktop\dashboard test - Kopie\main.py", line 196, in server
    role = await ipc.request("get_roles", guild_id=guild_id)
  File "C:\Users\Angel\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\ipc\client.py", line 107, in request
    return ServerResponse(await asyncio.wait_for(conn.recv(), self.timeout)) # type: ignore
  File "C:\Users\Angel\AppData\Local\Programs\Python\Python310\lib\asyncio\tasks.py", line 408, in wait_for
    return await fut
  File "C:\Users\Angel\AppData\Local\Programs\Python\Python310\lib\site-packages\websockets\legacy\protocol.py", line 568, in recv
    await self.ensure_open()
  File "C:\Users\Angel\AppData\Local\Programs\Python\Python310\lib\site-packages\websockets\legacy\protocol.py", line 944, in ensure_open
    raise self.connection_closed_exc()
websockets.exceptions.ConnectionClosedError: received 1011 (unexpected error); then sent 1011 (unexpected error)
open dragon
#

kann mir einer helfen

normal sundial
#

gibts grade keinen der mir da helfen kann?

restive herald
#

später gerne

#

also in 10 min oder so

normal sundial
#

okay dann warte ic hsolange es halt absehbar ist xD

normal sundial
restive herald
#

ok ok rummy braucht bissl länger xd

#

denke halb

normal sundial
#

ok

tawdry leaf
open dragon
fierce dove
#

@open dragon schaue die das Video ganz genau an

tawdry leaf
#

@open dragon bei dir fehlt die __init__ somit erkennt er des nd als self.bot

fierce dove
#
Traceback (most recent call last):
  File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/discord/cog.py", line 777, in _load_from_module_spec
    spec.loader.exec_module(lib)  # type: ignore
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap_external>", line 936, in exec_module
  File "<frozen importlib._bootstrap_external>", line 1074, in get_code
  File "<frozen importlib._bootstrap_external>", line 1004, in source_to_code
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/storage/emulated/0/Timo/Dev/Discord/Test/Fun/cogs/trivia.py", line 17
    self.db = await aiosqlite.connect("data/quiz.db") as self.db:
                                                      ^^
SyntaxError: invalid syntax

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/storage/emulated/0/Timo/Dev/Discord/Test/Fun/bot.py", line 18, in <module>
    bot.load_cogs("cogs")  # Load all cogs in the "cogs" folder
    ^^^^^^^^^^^^^^^^^^^^^
  File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/ezcord/bot.py", line 222, in load_cogs
    self.load_extension(f"{'.'.join(path.parts)}.{name}")
  File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/discord/cog.py", line 913, in load_extension
    self._load_from_module_spec(spec, name)
  File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/discord/cog.py", line 780, in _load_from_module_spec
    raise errors.ExtensionFailed(key, e) from e
discord.errors.ExtensionFailed: Extension 'cogs.trivia' raised an error: SyntaxError: invalid syntax (trivia.py, line 17)

Code

async def connect_db(self):
    self.db = await aiosqlite.connect("data/quiz.db") as self.db:
        self.cursor = await self.db.cursor()
restive herald
#

@normal sundial isses gelöst?

normal sundial
#

nope

restive herald
#

dann hau raus

tawdry leaf
fierce dove
#

Joa

tawdry leaf
#

was heißt denn das 😄

#

im cogs Ordner einen data ordner @fierce dove

normal sundial
# restive herald dann hau raus

also ich will alle rollen auf der website abbilden. dafür habe ich alle roles in ein dict gepackt und bekomme aber trotzde mden traceback

#
Traceback (most recent call last):
  File "C:\Users\Angel\AppData\Local\Programs\Python\Python310\lib\site-packages\websockets\legacy\server.py", line 240, in handler
    await self.ws_handler(self)
  File "C:\Users\Angel\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\ipc\server.py", line 211, in multicast_handler
    await asyncio.create_task(self.handle_request(websocket, message, True))
  File "C:\Users\Angel\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\ipc\server.py", line 170, in handle_request
    payload["response"] = json.dumps(resp)
  File "C:\Users\Angel\AppData\Local\Programs\Python\Python310\lib\json\__init__.py", line 231, in dumps
    return _default_encoder.encode(obj)
  File "C:\Users\Angel\AppData\Local\Programs\Python\Python310\lib\json\encoder.py", line 199, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "C:\Users\Angel\AppData\Local\Programs\Python\Python310\lib\json\encoder.py", line 257, in iterencode
    return _iterencode(o, 0)
  File "C:\Users\Angel\AppData\Local\Programs\Python\Python310\lib\json\encoder.py", line 179, in default
    raise TypeError(f'Object of type {o.__class__.__name__} '
TypeError: Object of type Role is not JSON serializable
fierce dove
normal sundial
#

die print ausgabe sieht so aus ```py
{'role': [<Role id=123 name='@everyone'>]}

fierce dove
tawdry leaf
restive herald
fierce dove
normal sundial
#

und bei der main bekomme ich den traceback Traceback (most recent call last): File "C:\Users\Angel\AppData\Local\Programs\Python\Python310\lib\site-packages\uvicorn\protocols\http\h11_impl.py", line 408, in run_asgi result = await app( # type: ignore[func-returns-value] File "C:\Users\Angel\AppData\Local\Programs\Python\Python310\lib\site-packages\uvicorn\middleware\proxy_headers.py", line 84, in __call__ return await self.app(scope, receive, send) File "C:\Users\Angel\AppData\Local\Programs\Python\Python310\lib\site-packages\fastapi\applications.py", line 292, in __call__ await super().__call__(scope, receive, send) File "C:\Users\Angel\AppData\Local\Programs\Python\Python310\lib\site-packages\starlette\applications.py", line 122, in __call__ await self.middleware_stack(scope, receive, send) File "C:\Users\Angel\AppData\Local\Programs\Python\Python310\lib\site-packages\starlette\middleware\errors.py", line 184, in __call__ raise exc File "C:\Users\Angel\AppData\Local\Programs\Python\Python310\lib\site-packages\starlette\middleware\errors.py", line 162, in __call__ await self.app(scope, receive, _send) File "C:\Users\Angel\AppData\Local\Programs\Python\Python310\lib\site-packages\starlette\middleware\exceptions.py", line 79, in __call__ raise exc File "C:\Users\Angel\AppData\Local\Programs\Python\Python310\lib\site-packages\starlette\middleware\exceptions.py", line 68, in __call__ await self.app(scope, receive, sender) File "C:\Users\Angel\AppData\Local\Programs\Python\Python310\lib\site-packages\fastapi\middleware\asyncexitstack.py", line 20, in __call__ raise e File "C:\Users\Angel\AppData\Local\Programs\Python\Python310\lib\site-packages\fastapi\middleware\asyncexitstack.py", line 17, in __call__ await self.app(scope, receive, send) File "C:\Users\Angel\AppData\Local\Programs\Python\Python310\lib\site-packages\starlette\routing.py", line 718, in __call__ await route.handle(scope, receive, send) File "C:\Users\Angel\AppData\Local\Programs\Python\Python310\lib\site-packages\starlette\routing.py", line 276, in handle await self.app(scope, receive, send) File "C:\Users\Angel\AppData\Local\Programs\Python\Python310\lib\site-packages\starlette\routing.py", line 66, in app response = await func(request) File "C:\Users\Angel\AppData\Local\Programs\Python\Python310\lib\site-packages\fastapi\routing.py", line 273, in app raw_response = await run_endpoint_function( File "C:\Users\Angel\AppData\Local\Programs\Python\Python310\lib\site-packages\fastapi\routing.py", line 190, in run_endpoint_function return await dependant.call(**values) File "c:\Users\Angel\Desktop\dashboard test - Kopie\main.py", line 196, in server rolees = await ipc.request("get_roles", guild_id=guild_id) File "C:\Users\Angel\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\ipc\client.py", line 107, in request return ServerResponse(await asyncio.wait_for(conn.recv(), self.timeout)) # type: ignore File "C:\Users\Angel\AppData\Local\Programs\Python\Python310\lib\asyncio\tasks.py", line 408, in wait_for return await fut File "C:\Users\Angel\AppData\Local\Programs\Python\Python310\lib\site-packages\websockets\legacy\protocol.py", line 568, in recv await self.ensure_open() File "C:\Users\Angel\AppData\Local\Programs\Python\Python310\lib\site-packages\websockets\legacy\protocol.py", line 944, in ensure_open raise self.connection_closed_exc() websockets.exceptions.ConnectionClosedError: received 1011 (unexpected error); then sent 1011 (unexpected error)

rolees = await ipc.request("get_roles", guild_id=guild_id)
    print(rolees)
``` bei der abfrage
fierce dove
tawdry leaf
#

teste es doch

open dragon
#

da steht die ganze zeit 0

tawdry leaf
open dragon
#

@tawdry leaf

tawdry leaf
open dragon
#
intents = discord.Intents.default()

bot = discord.Bot(
    intents=intents,
)
fierce dove
tawdry leaf
#
intents = discord.Intents.all()```
tawdry leaf
open dragon
#

passiert weiter nichts

fierce dove
#
    @tasks.loop(minutes=5)
    async def channel_task(self):
        await self.bot.wait_until_ready()

        guild: discord.Guild = self.bot.get_guild(GUILD)
        channel = self.bot.get_channel(1051461006657859605)
        real_members = [t for t in guild.members if not t.bot]
        
        await channel.edit(name=f'🏠 × Zentrale (USER: {len(real_members)})')
        
        
    @commands.Cog.listener()
    async def on_ready(self):
        self.channel_task.start()
tawdry leaf
fierce dove
tawdry leaf
open dragon
restive herald
#

channel wird nd gefunden

tawdry leaf
#

ja wie auch xD

#

der ist nd definiert

restive herald
#

d.h. lass dir mal die gegettete guild printen

open dragon
#

jetz danke

tawdry leaf
fierce dove
tawdry leaf
# open dragon

du brauchst bei get_guild des nicht mit guild: discord.Guild

tawdry leaf
restive herald
fierce dove
tawdry leaf
tawdry leaf
fierce dove
tawdry leaf
fierce dove
#
import enum
import discord
from discord.ext import commands
from discord.commands import SlashCommandGroup

import aiosqlite
import json
import random

class Database(commands.Cog):
    def __init__(self, bot):
        self.bot = bot
        
    @commands.Cog.listener()
    async def on_ready(self):
        async with aiosqlite.connect("data/quiz.db") as db:
            await db.execute("CREATE TABLE IF NOT EXISTS triviaquiz(id INTEGER, quiz JSON, PRIMARY KEY (id, AUTOINCREMENT")

def setup(bot):
    bot.add_cog(Database(bot))
#

Das geht irgendwie nicht

tawdry leaf
restive herald
#

egal

fierce dove
tawdry leaf
fierce dove
#
Traceback (most recent call last):
  File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/discord/client.py", line 399, in _run_event
    await coro(*args, **kwargs)
  File "/storage/emulated/0/Timo/Dev/Discord/Test/Fun/cogs/db.py", line 17, in on_ready
    await db.execute("CREATE TABLE IF NOT EXISTS triviaquiz(id INTEGER, quiz JSON, PRIMARY KEY (id, AUTOINCREMENT))")
  File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/aiosqlite/core.py", line 184, in execute
    cursor = await self._execute(self._conn.execute, sql, parameters)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/aiosqlite/core.py", line 129, in _execute
    return await future
           ^^^^^^^^^^^^
  File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/aiosqlite/core.py", line 102, in run
    result = function()
             ^^^^^^^^^^
sqlite3.OperationalError: near "AUTOINCREMENT": syntax error
tawdry leaf
#
import enum
import discord
from discord.ext import commands
from discord.commands import SlashCommandGroup

import aiosqlite
import json
import random

class Database(commands.Cog):
    def __init__(self, bot):
        self.bot = bot
        
    @commands.Cog.listener()
    async def on_ready(self):
        async with aiosqlite.connect("data/quiz.db") as db:
            await db.execute("CREATE TABLE IF NOT EXISTS triviaquiz(id INTEGER PRIMARY KEY AUTOINCREMENT, quiz JSON)")

def setup(bot):
    bot.add_cog(Database(bot))```

@fierce dove
fierce dove
#

Wo sind die "

tawdry leaf
#

die darfst du selber machen 😉

fierce dove
#

Digga

tawdry leaf
fierce dove
tawdry leaf
fierce dove
#

Habe eine Klammer vergessen thx

open dragon
#

immer wenn ich das ticket öffne passiert das

tawdry leaf
#

na du bösewicht

#

du schickst ja nix

restive herald
#

bro

#

du musst natürlich noch nh msg reinmachen

#

das is nh empty msg

normal sundial
#

wie kann ich an die website roles übergeben ? für die server stats ?

restive herald
#

Moin Moin, bekomme beim chat exporter code den error hier

#

jmd ne idee why?

tawdry leaf
restive herald
#

hier steht ja nichts von nem key

tawdry leaf
#

schau maybe timos video idk

restive herald
#

das is ja der code von seinem video

raven lotus
#

Hellnah, geht nicht:

import discord
from discord.ext import commands
import youtube_dl
from discord.commands import slash_command

bot = commands.Bot()

class Music(commands.Cog):
    def __init__(self, bot):
        self.bot = bot

    @slash_command()
    async def play_music(self, ctx, url: str):
        if ctx.author.voice is None or ctx.author.voice.channel is None:
            await ctx.respond("Du musst dich in einem Voice-Channel befinden, um Musik abzuspielen!")
            return

        voice_channel = ctx.author.voice.channel
        voice_client = voice_channel.connect()

        ydl_opts = {
            'format': 'bestaudio/best',
            'postprocessors': [{
                'key': 'FFmpegExtractAudio',
                'preferredcodec': 'mp3',
                'preferredquality': '192',
            }],
        }

        with youtube_dl.YoutubeDL(ydl_opts) as ydl:
            info = ydl.extract_info(url, download=False)
            url2 = info['formats'][0]['url']
            await voice_channel.connect()
            voice_client.play(discord.FFmpegPCMAudio(url2))

    @slash_command()
    async def stop_music(self, ctx):
        voice_client = discord.utils.get(bot.voice_clients, guild=ctx.guild)
        if voice_client.is_playing():
            voice_client.stop()
            await voice_client.disconnect()

def setup(bot):
    bot.add_cog(Music(bot))
tawdry leaf
raven lotus
#

ich nicht wissen warum

#

DownloadError: ERROR: No video formats found; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see https://yt-dl.org/update on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.

#

das ist fehler code vom bot

#

und das beste ist das hier:

restive herald
#

belastend

raven lotus
#

😦

#

ich nichts machen kann

restive herald
#
user = interaction.guild.get_member(self.id)
        r1 = discord.utils.get(interaction.guild.roles, name=f"Shop Punkte: {points - price}")
        r2 = discord.utils.get(interaction.guild.roles, name=f"Shop Punkte: {points}")
        await user.add_roles(r1)
        await user.remove_roles(r2)```

Jmd. nh Idee warum ich damit nd nem User die Rolle adden kann?
raven lotus
#

mmmh

tawdry leaf
#

get_member gibt es doch gar nd

raven lotus
#

ohne get

odd kiteBOT
restive herald
restive herald
raven lotus
#

bruh

tawdry leaf
raven lotus
#

aber ... was ist mit mir jetzt

#

ich weiß nicht, warum es nicht geht 😦

tawdry leaf
raven lotus
#

mist

#

was mache ich jetzt?

tawdry leaf
#

idk

raven lotus
#

ich will doch nur Music im Talk hören

#

😦

odd kiteBOT
#

Mein Discord Server
https://discord.gg/zfvbjTEzv6

Links aus diesem Video
FFMPEG ► https://ffmpeg.org/download.html
I Love Radio ► https://ilovemusic.de/streams

▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
Mein Hosting* ► https://tidd.ly/3gJufg6
Code auf Github ► https://github.com/tibue99/tutorial-bot

PYCORD
Docs ► https://docs.pycord.dev/
Guide ► https://guide....

▶ Play video
raven lotus
#

das ist Radio 😦

#

ich will aber was von YT abspielen

tawdry leaf
viscid lake
raven lotus
#

aber .. aber... warum?

viscid lake
#

TOS

raven lotus
#

uff

#

mist

#

alles was spaß macht, darf man nicht

#

XD

tawdry leaf
#

😄

viscid lake
#

zb Urheberrechtsverletzung

raven lotus
#

idk, radio vllt doch gut

restive herald
#

lucky hab btw fehler gefunden

raven lotus
#

der bot sagt nein:
RuntimeError: PyNaCl library needed in order to use voice

fierce dove
#

@raven lotus

tawdry leaf
fierce dove
tawdry leaf
#

muss es einf nur in den Ordner schieben :<

raven lotus
#

wait ich idiot

#

ich habe nur den Code kopiert ._.

tawdry leaf
#

.-.

raven lotus
#

hellnah, er spielt nix ab

fierce dove
raven lotus
#

ClientException: ffmpeg was not found.

tawdry leaf
raven lotus
#

was muss i tuen

#

ich muss was installieren

tawdry leaf
raven lotus
#

mach ich gerade

#

hellnah, mach ich doch nicht

odd kiteBOT
open dragon
#

ich kann kein ticket öffnen

#

code

solid ingot
#

bitte sende nur den code, der für dein problem relevant ist

open dragon
#

wait

#
class TutorialView(discord.ui.View):
    def __init__(self, bot):
        self.bot = bot
        super().__init__(timeout=None)
        self.cooldown = commands.CooldownMapping.from_cooldown(1, 120, commands.BucketType.user)

    @discord.ui.button(label="x Support ", style=discord.ButtonStyle.gray, emoji="✉️", custom_id="ticket12",row=1)
    async def button_callback16(self, button, interaction):
        cat = self.bot.get_channel(1159548507896696903)
        interaction.message.author = interaction.user
        bucket = self.cooldown.get_bucket(interaction.message)
        retry = bucket.update_rate_limit()

    @discord.ui.button(label="x Fraktionsanliegen", style=discord.ButtonStyle.gray, emoji="🔨", custom_id="ticket13",row=2)
    async def button_callback28(self, button, interaction):
        cat = self.bot.get_channel(1159548497968775270)
        interaction.message.author = interaction.user
        bucket = self.cooldown.get_bucket(interaction.message)
        retry = bucket.update_rate_limit()
    @discord.ui.button(label="x Teambewerbung ", style=discord.ButtonStyle.gray, emoji="🚀", custom_id="ticket", row=1)
    async def button_callback1(self, button, interaction):
        cat = self.bot.get_channel(1159548495414431774)
        interaction.message.author = interaction.user
        bucket = self.cooldown.get_bucket(interaction.message)
        retry = bucket.update_rate_limit()

solid ingot
#

wenn ein user auf einen button drückt, musst du darauf immer in irgendeiner form antworten, zb indem du eine antwort sendest oder die nachricht bearbeitest

open dragon
#

also

await. send_message("bla bla")
restive herald
#

await interaction.response.send_message(“bla bla“)

wind finch
#

Ich habe ein Ticket System programmiert es funktioniert auch nur alles nun möchte ich das der close und claim button nach dem restart auch noch gehen, hat jemand eine idee was ich machen kann?

solid ingot
#

ja, du könntest den view persistent machen

wind finch
tawdry leaf
#

Ja 🤫

tawdry leaf
wind finch
tawdry leaf
viscid lake
#

lucky unser big brain

wind finch
solid ingot
#

items kanns du mit view.add_item zu einem view hinzufügen

odd kiteBOT
solid ingot
wind finch
#

liegt an ticket_id = 1234567890 ig

ruby sparrow
#

Wie kann man das Dashboard in den gleichen Ordner wie den Bot machen?

solid ingot
#

bei der dashboard tutorial reihe ist der bot bereits im selben ordner wie das dashboard

lofty rock
limpid wolf
#

Einfach garnichts? Weil irgendwas müsste dort ja stehen in der Konsole

lofty rock
# limpid wolf Was wird angezeigt?
container@pterodactyl~ Server marked as offline...
[Pterodactyl Daemon]: Checking server disk space usage, this could take a few seconds...
[Pterodactyl Daemon]: Updating process configuration files...
[Pterodactyl Daemon]: Ensuring file permissions are set correctly, this could take a few seconds...
container@pterodactyl~ Server marked as starting...
[Pterodactyl Daemon]: Pulling Docker container image, this could take a few minutes to complete...
[Pterodactyl Daemon]: Finished pulling Docker container image
Python 3.10.13
:/home/container$ if [[ -d .git ]] && [[ "${AUTO_UPDATE}" == "1" ]]; then git pull; fi; if [[ ! -z "${PY_PACKAGES}" ]]; then pip install -U --prefix .local ${PY_PACKAGES}; fi; if [[ -f /home/container/${REQUIREMENTS_FILE} ]]; then pip install -U --prefix .local -r ${REQUIREMENTS_FILE}; fi; /usr/local/bin/python /home/container/${PY_FILE}
Requirement already satisfied: py-cord in ./.local/lib/python3.10/site-packages (from -r req.txt (line 1)) (2.4.1)
Requirement already satisfied: requests in ./.local/lib/python3.10/site-packages (from -r req.txt (line 2)) (2.31.0)
Requirement already satisfied: typing-extensions<5,>=4 in ./.local/lib/python3.10/site-packages (from py-cord->-r req.txt (line 1)) (4.8.0)
Requirement already satisfied: aiohttp<3.9.0,>=3.6.0 in ./.local/lib/python3.10/site-packages (from py-cord->-r req.txt (line 1)) (3.8.5)
Requirement already satisfied: idna<4,>=2.5 in ./.local/lib/python3.10/site-packages (from requests->-r req.txt (line 2)) (3.4)
Requirement already satisfied: charset-normalizer<4,>=2 in ./.local/lib/python3.10/site-packages (from requests->-r req.txt (line 2)) (3.2.0)
Requirement already satisfied: urllib3<3,>=1.21.1 in ./.local/lib/python3.10/site-packages (from requests->-r req.txt (line 2)) (2.0.6)
Requirement already satisfied: certifi>=2017.4.17 in ./.local/lib/python3.10/site-packages (from requests->-r req.txt (line 2)) (2023.7.22)
Requirement already satisfied: multidict<7.0,>=4.5 in ./.local/lib/python3.10/site-packages (from aiohttp<3.9.0,>=3.6.0->py-cord->-r req.txt (line 1)) (6.0.4)
Requirement already satisfied: async-timeout<5.0,>=4.0.0a3 in ./.local/lib/python3.10/site-packages (from aiohttp<3.9.0,>=3.6.0->py-cord->-r req.txt (line 1)) (4.0.3)
Requirement already satisfied: frozenlist>=1.1.1 in ./.local/lib/python3.10/site-packages (from aiohttp<3.9.0,>=3.6.0->py-cord->-r req.txt (line 1)) (1.4.0)
Requirement already satisfied: attrs>=17.3.0 in ./.local/lib/python3.10/site-packages (from aiohttp<3.9.0,>=3.6.0->py-cord->-r req.txt (line 1)) (23.1.0)
Requirement already satisfied: yarl<2.0,>=1.0 in ./.local/lib/python3.10/site-packages (from aiohttp<3.9.0,>=3.6.0->py-cord->-r req.txt (line 1)) (1.9.2)
Requirement already satisfied: aiosignal>=1.1.2 in ./.local/lib/python3.10/site-packages (from aiohttp<3.9.0,>=3.6.0->py-cord->-r req.txt (line 1)) (1.3.1)
[notice] A new release of pip is available: 23.0.1 -> 23.2.1
[notice] To update, run: pip install --upgrade pip
container@pterodactyl~ Server marked as offline...
[Pterodactyl Daemon]: ---------- Detected server process in a crashed state! ----------
[Pterodactyl Daemon]: Exit code: 0
[Pterodactyl Daemon]: Out of memory: false
[Pterodactyl Daemon]: Checking server disk space usage, this could take a few seconds...
[Pterodactyl Daemon]: Updating process configuration files...
[Pterodactyl Daemon]: Ensuring file permissions are set correctly, this could take a few seconds...
container@pterodactyl~ Server marked as starting...
[Pterodactyl Daemon]: Pulling Docker container image, this could take a few minutes to complete...
[Pterodactyl Daemon]: Finished pulling Docker container image```
ruby sparrow
solid ingot
lofty rock
solid ingot
#

same

lofty rock
#

Also ist nur ein welcome & goodbye system das geht aber

lofty rock
solid ingot
lofty rock
#

Kein code error

lofty rock
#

Weil die ist ein wenig überlastet

#

69,98% von 69

solid ingot
#

wenn du mir deine main nicht zeigen willst kann ich dir nicht helfen

#

auch wenn du mich 5 mal pingst

hard pivot
#

Hallo ich versuche grad ein Bot zu machen bei dem jeder server sich eine custom rank card anlegen kann wie kann ich die bilder am besten speichern oder wie bekomem ich die in die Datenbank benutze MySQL

lofty rock
#

ehrlich ich bin so lost

#

hm immernoch

solid ingot
lofty rock
#
import discord
from discord.ext import commands
import requests


intents = discord.Intents.all()
bot = commands.Bot(command_prefix='/', intents=intents)

@bot.event
async def on_ready():
    print(f'Logged in as {bot.user.name}')

@bot.event
async def on_member_join(member):
    welcome_channel = bot.get_channel(channelid)  # Replace with your welcome channel ID

    embed = discord.Embed(
        title=f"Welcome to the server, {member.display_name}!",
        description=f"We're thrilled to have you here in our community. Feel free to explore and engage with other members. We are now {member.guild.member_count} Members.",
        color=discord.Color(int("7A2F8F", 16))  
    )
    embed.set_thumbnail(url=member.avatar.url) 
    embed.add_field(name="Server Rules", value="Make sure to familiarize yourself with our server rules to ensure a positive experience for everyone.")
    embed.add_field(name="Introduction", value="Please take a moment to introduce yourself in the introductions channel so that we can get to know you better.")

    await welcome_channel.send(member.mention, embed=embed)

@bot.event
async def on_member_remove(member):
    goodbye_channel = bot.get_channel(channelid)  # Replace with your goodbye channel ID

    embed = discord.Embed(
        title=f"Goodbye, {member.display_name}!",
        description=f"We're sad to see you go. Thank you for being a part of our community. Take care! We are now {member.guild.member_count} Members.",
        color=discord.Color(int("7A2F8F", 16))  
    )
    embed.set_thumbnail(url=member.avatar.url)  
    await goodbye_channel.send(embed=embed)
    
    bot.run("TOKEN")```
#

da

solid ingot
#

stark, jetzt wo du das problem schon gelöst hast hilft mir die datei viel

hard pivot
lofty rock
#

Crashed immernoch

solid ingot
solid ingot
lofty rock
# solid ingot du darfst dein `bot.run` nicht in das `on_member_remove` event schreiben
import discord
from discord.ext import commands
import requests


intents = discord.Intents.all()
bot = commands.Bot(command_prefix='/', intents=intents)

@bot.event
async def on_ready():
    print(f'Logged in as {bot.user.name}')

@bot.event
async def on_member_join(member):
    welcome_channel = bot.get_channel(channelid)  # Replace with your welcome channel ID

    embed = discord.Embed(
        title=f"Welcome to the server, {member.display_name}!",
        description=f"We're thrilled to have you here in our community. Feel free to explore and engage with other members. We are now {member.guild.member_count} Members.",
        color=discord.Color(int("7A2F8F", 16))  
    )
    embed.set_thumbnail(url=member.avatar.url) 
    embed.add_field(name="Server Rules", value="Make sure to familiarize yourself with our server rules to ensure a positive experience for everyone.")
    embed.add_field(name="Introduction", value="Please take a moment to introduce yourself in the introductions channel so that we can get to know you better.")

    await welcome_channel.send(member.mention, embed=embed)

@bot.event
async def on_member_remove(member):
    goodbye_channel = bot.get_channel(channelid)  # Replace with your goodbye channel ID

    embed = discord.Embed(
        title=f"Goodbye, {member.display_name}!",
        description=f"We're sad to see you go. Thank you for being a part of our community. Take care! We are now {member.guild.member_count} Members.",
        color=discord.Color(int("7A2F8F", 16))  
    )
    embed.set_thumbnail(url=member.avatar.url)  
    await goodbye_channel.send(embed=embed)
    
bot.run("TOKEN")```so?
#

Update: geht jetzt alles

twilit anvil
#

Heyho! Ich wollte gerade anfangen in Visual Studio Code zu coden, aber die Main-Example aus den EzCord-Docs findet den "Cogs"-Ordner nicht. Wie lasse ich ihn den Ordner finden?

lofty rock
lofty rock
#

oder muss ich da auch ändern

twilit anvil
#

VSC ist der Ordner in C:\Users\Konstantin

solid ingot
fierce dove
#

In welchem Ordner ist die Main drinn

twilit anvil
fierce dove
#

Ok

twilit anvil
#
import discord
import ezcord
import os

from dotenv import load_dotenv

from discord.ext import commands
from discord.commands import slash_command
bot = ezcord.Bot(
    intents=discord.Intents.all(),
    language="de",
    debug_guilds=[1160102640169013270]
)

if __name__ == "__main__":
    load_dotenv()
    bot.run(os.getenv("TOKEN"))
fierce dove
#
import discord
import ezcord
import os

from dotenv import load_dotenv

from discord.ext import commands
from discord.commands import slash_command
bot = ezcord.Bot(
    intents=discord.Intents.all(),
    language="de",
    debug_guilds=[1160102640169013270]
)

if __name__ == "__main__":
    load_dotenv()
    bot.load_cogs("cogs")
    bot.run(os.getenv("TOKEN"))
twilit anvil
#

wenn da bot.load_cogs("cogs") drinne ist kommt: ```
Traceback (most recent call last):
File "c:\Users\Leander\VSC\testbot\main.py", line 16, in <module>
bot.load_cogs("cogs")
File "C:\Users\Leander\AppData\Local\Programs\Python\Python311\Lib\site-packages\ezcord\bot.py", line 219, in load_cogs
for filename in os.listdir(directory):
^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [WinError 3] Das System kann den angegebenen Pfad nicht finden: 'cogs'

fierce dove
#

Hmm

twilit anvil
#

@urban glen - Du codest doch in VSC kannst du mir da helfen?

fierce dove
#
import discord
import ezcord
import os

from dotenv import load_dotenv

from discord.ext import commands
from discord.commands import slash_command

load_dotenv()

TOKEN = os.getenv("TOKEN")


bot = ezcord.Bot(
    intents=discord.Intents.all(),
    language="de",
    debug_guilds=[1160102640169013270]
)

if __name__ == "__main__":
    bot.run(TOKEN)
    bot.load_cogs("cogs")
#

So hab ich es

twilit anvil
#

Jetzt startet er, aber wenn ich ihn stoppe kommt der Fehler.

fierce dove
#

?

twilit anvil
urban glen
#

zeig mal deine ordner struktur

twilit anvil
urban glen
#

du musst testbot als ordner öffnen, nicht VSC

twilit anvil
#

Isser nicht?

twilit anvil
#

Aber der Ordner ist VSC. Darin ist noch ein Ordner der testbot ist.

urban glen
#

Du hast VSC geöffnet als Ordner aber du musst testbot als ordner öffnen

twilit anvil
#

Ahhh verstehe

urban glen
#

ye

strange juniper
#

Gibt es bei embeds die Möglichkeit jeweils 2 Felder nebeneinander, Also inline=True, zu haben, ohne jedes 3. inline=False zu setzen?

twilit anvil
#

Wie schließe ich den VSC ordner? xD

urban glen
#

außer wenn du es so haben willst machst du einfach bot.load_cogs("testbot/cogs")

urban glen
#

dann anstatt den last project ordner einfach testbot machen

#

moin, ist das eigentlich normal das mein bot 15 minuten braucht um slash commands zu registrieren oder gab es seit dem tutorial dazu irgend eine änderung? denke die frage ist zu klein für nen forum post

#

benutzt du eine bot class oder machst du einfach nur bot = ezcord.Bot

twilit anvil
urban glen
#

oder sowas ähnliches?

ruby sparrow
#

Ich verstehe nicht

fierce dove
ruby sparrow
fierce dove
#

?

#

Ja

ruby sparrow
#

wie denn send mal zb ?

fierce dove
#

du machst in terminal cd Dashboard

ruby sparrow
fierce dove
#

Zu erst cd Dashboard

fierce dove
vernal rampart
#

was bedueted das:

ruby sparrow
#
PS C:\Users\nicor\OneDrive\Desktop\prefix bot> & C:/Users/nicor/AppData/Local/Programs/Python/Python310/python.exe "c:/Users/nicor/OneDrive/Desktop/prefix bot/Dashboard/bot.py"
Traceback (most recent call last):
  File "c:\Users\nicor\OneDrive\Desktop\prefix bot\Dashboard\bot.py", line 50, in <module>
    bot.load_cogs("prefix", "support", "role", ".bot updates", "poll", "mingroup", log=ezcord.CogLog.default, log_color="green")
  File "C:\Users\nicor\AppData\Local\Programs\Python\Python310\lib\site-packages\ezcord\bot.py", line 214, in load_cogs
    self.load_extension(f"{'.'.join(path.parts)}.{name}")
  File "C:\Users\nicor\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\cog.py", line 900, in load_extension
    elif (spec := importlib.util.find_spec(name)) is None:
  File "C:\Users\nicor\AppData\Local\Programs\Python\Python310\lib\importlib\util.py", line 94, in find_spec
    parent = __import__(parent_name, fromlist=['__path__'])
ModuleNotFoundError: No module named 'prefix'```
twilit anvil
# vernal rampart was bedueted das:

Could not send Message to User. Das beantwortet doch deine Frage? Ich gehe davon aus dass du einen Nutzer eine DM senden möchtest. Der Fehler ist also dass der Bot dem Nutzer keine DM senden kann.

vernal rampart
twilit anvil
#

Oder welchen Fehler meinst du?

twilit anvil
#

Was versuchst du da eigentlich? /spam

vernal rampart
twilit anvil
vernal rampart
twilit anvil
#

Jup, Invalid Webhook Token also falsche Webhook Url

vernal rampart
twilit anvil
novel ore
#

Beim Starten des Bootes kommt dieser Error. Ich hab denn Token nochmal resetet aber der error kommt noch immern. Was kann ich dagegen machen?

vernal rampart
# twilit anvil Hmm, schick mir mal deine Main. *Token nicht vergessen rauszumachen*
import json
import os
import discord
import ezcord
import requests
from dotenv import load_dotenv

intents = discord.Intents.all()
status = discord.Status.online
activity = discord.Activity(type=discord.ActivityType.watching, name="/meme")
load_dotenv()
bot = ezcord.Bot(intents=intents,
                 status=status,
                 activity=activity,
                 language="de",
                 error_webhook_url=os.getenv("webhookurl"),
                 ready_event=None
                 )


@bot.event
async def on_ready():
    info = {
        "Cogs": len(bot.cogs),
    }
    bot.ready(new_info=info)


@bot.slash_command(description="Zeige dir ein Meme an")
async def meme(ctx):
    response = requests.get("https://meme-api.com/gimme")
    json_data = json.loads(response.text)
    meme_url = json_data.get("url")
    if meme_url:
        await ctx.respond(meme_url)
    else:
        await ctx.respond("Es tut mir leid, es konnte kein Meme gefunden werden.", ephemeral=True)

if __name__ == "__main__":
    bot.load_cogs(subdirectories=True)

    load_dotenv()
    bot.run(os.getenv("TEST"))
twilit anvil
novel ore
twilit anvil
#

Oder, benötigst du das Error-Webhook überhaupt? Ich habe das bei mir einfach aus der Main gelöscht.

novel ore
twilit anvil
#

Hey, Hey, kann mir jemand kurz sagen wie ich den output von {self.bot.user.created_at.date} in einen Timestamp bekomme? Bei mir sieht es nähmlich so in Discord aus:

fierce dove
#

Wie kann ich das machen mit dem Namen

#

Weil es so bei mir aus sieht

tawdry leaf
#

och timo

tawdry leaf
#

nur member dann hast es so wie beim 1.

fierce dove
tawdry leaf
fierce dove
#

@tawdry leaf

#

Ne keine Lust

tawdry leaf
fierce dove
#

OK😃

vernal rampart
fierce dove
odd kiteBOT
#

Mein Discord Server
https://discord.gg/zfvbjTEzv6

Links aus diesem Video
Git ► https://git-scm.com/downloads

▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
Mein Hosting* ► https://tidd.ly/3gJufg6
Code auf Github ► https://github.com/tibue99/tutorial-bot

PYCORD
Docs ► https://docs.pycord.dev/
Guide ► https://guide.pycord.dev/introduction/
Discord Server ► https://d...

▶ Play video
viscid lake
#

Da wird alles erklärt

vernal rampart
#

einfach

pip install py-cord-dev

und

pip uninstall py-cord
fierce dove
viscid lake
#

Macht

#

Laut der offiziellen Seite soll man Pip install git+https:/: machen

wind finch
old ore
#

warum passiert dieser fehler bei meine slash commands

fierce dove
#

Code plus Error

ruby sparrow
old ore
old ore
old ore
fierce dove
#

Hmm

old ore
fierce dove
#

Ok

silk gulch
#

Versuche gerade in Dashboard Tutorial die requirements zu installieren. Irgendwie macht der das aber nicht... Die Datei existiert aber.

viscid lake
#

du musst das nicht mit der txt machen

ruby sparrow
viscid lake
#

schreib pip install name name name

silk gulch
#

Hab ich nun. Dennoch folgender Fehler:

Traceback (most recent call last):
  File "c:\Users\maxme\Desktop\Dashboard\main.py", line 1, in <module>
    from fastapi import FastAPI
ModuleNotFoundError: No module named 'fastapi'
PS C:\Users\maxme\Desktop\Dashboard>```
ruby sparrow
#

du musst auch die Datei in deinen Ordner haben...

viscid lake
fierce dove
urban glen
# silk gulch

Der ModuleNotFoundError sagt eigendlich nur aus, dass er das Modul nicht finden konnte. Also FastAPI konnte nicht gefunden werden, deswegen pip3 install fastapi

wind finch
tawdry leaf
#

denke wenn du des anders rum machst ist es andersrum beim embed

sullen fossil
#

Hallo ich wollte auch so ein RPS spiel machen wie in #🎮・games aber wie kann man das am besten machen das der bot wartet bis es beide antworten hat?

#

Weil man kann ja glaub nur es so machen das er beim ersten knopf druck reagiert

opal basin
#

ich möchte das der bot beim erstellen eines post einen bestimmten tag nutz wie geht das?

wind finch
#

Will nur ein Ticket select Menü und im Ticket Channel 2 Buttons und alles soll nach dem restart gehen als ob das so schwer ist.

tawdry leaf
upper adder
#

Weiß nicht obs hier reinpasst, aber ich wollte jetzt keinen Extra Post dafür machenn....

Habe mir einen eigenen Counting-Bot gebaut, aber jetzt gibts Probleme, wenn Nutzer manchmal zur gleichen Zeit Nachrichten absenden. Habts ihr Ideen?

upper adder
#

uhm. Ach ne. Hab ne Lösung gefunden ^^

native plume
urban glen
#

als beispiel
User 1 : True
User 2 : False
wenn das so ist dann "Du musst noch warten"
User 1 : True
User 2 : True
Dann haben beide abgegeben

und du fragst du bei jedesmal ausführen ab wie deine dictionary ist als beispiel

native plume
#

Du brauchst ein Command.Cog.listener()

Dann nennst du die Funktion on_guild_channel create() und kannst dann gucken ob der Channel ein Post ist. Und wenn ja kannst du mit Thread.edit(applied_tags) die Tags ändern

opal basin
solid ingot
strange juniper
solid ingot
strange juniper
solid ingot
#

das war auf jemand anderen bezogen, trotzdem danke für die info 😄

strange juniper
#

Ups 😅

solid ingot
solid ingot
solid ingot
restive herald
ripe quest
#

Weiß jemand wieso ich diesen Error Code bekomme?

PS C:\Users\Oguzhan\Desktop\embedcreator> py embed.py
Traceback (most recent call last):
  File "C:\Users\Oguzhan\Desktop\embedcreator\embed.py", line 22, in <module>
    @bot.slash_command()
AttributeError: 'Bot' object has no attribute 'slash_command'. Did you mean: 'add_command'?

Das ist der Code:

import discord
from discord.ext import commands
import discord.ui
import json

def get_config(name):
    with open("config.json", "r") as f:
        json_file = json.load(f)
        return json_file[name]


intents = discord.Intents.all()

bot = commands.Bot(command_prefix='!', intents=intents, help_command=None)

@bot.event
async def on_ready():
    print(f'Bot wurde erfolgreich als {bot.user.name} eingeloggt')



@bot.slash_command()
async def embed(ctx, color: str, title: str, description: str, url: str = None, author_name: str = None, author_icon: str = None, footer_text: str = None, footer_icon: str = None, thumbnail: str = None, image: str = None):
    color1 = color.strip("#")
    hex_int = int(color1, base=16)
    channel = ctx.channel
    embed = discord.Embed(
        title=f"{title}",
        description=f"{description}",
        color=hex_int,
        url=url
    )
    if author_name is not None:
        embed.set_author(name=author_name, icon_url=author_icon)
    if footer_text is not None:
        embed.set_footer(text=footer_text, icon_url=footer_icon)
    if thumbnail is not None:
        embed.set_thumbnail(url=thumbnail)
    if image is not None:
        embed.set_image(url=image)
    await channel.send(embed=embed)


bot.run(get_config("token"))
ruby sparrow
#

@ripe quest für was ist mein oder cogs?

ripe quest
#

teste immer neue commands in main.py

#

bzw. jetzt habe ich es embed genannt

ruby sparrow
ripe quest
#

Sry geht gerade nicht xD

solid ingot
ripe quest
#

oke, danke

urban glen
#

Versuche es mal so:


import discord
from discord.commands import slash_command # Slashcommands vom discord.commands importiert
import discord.ui
import json

def get_config(name):
    with open("config.json", "r") as f:
        json_file = json.load(f)
        return json_file[name]


intents = discord.Intents.all()

bot = commands.Bot(command_prefix='!', intents=intents, help_command=None)

@bot.event
async def on_ready():
    print(f'Bot wurde erfolgreich als {bot.user.name} eingeloggt')



@slash_command() # Ohne bot.slash_command()
async def embed(ctx, color: str, title: str, description: str, url: str = None, author_name: str = None, author_icon: str = None, footer_text: str = None, footer_icon: str = None, thumbnail: str = None, image: str = None):
    color1 = color.strip("#")
    hex_int = int(color1, base=16)
    channel = ctx.channel
    embed = discord.Embed(
        title=f"{title}",
        description=f"{description}",
        color=hex_int,
        url=url
    )
    if author_name is not None:
        embed.set_author(name=author_name, icon_url=author_icon)
    if footer_text is not None:
        embed.set_footer(text=footer_text, icon_url=footer_icon)
    if thumbnail is not None:
        embed.set_thumbnail(url=thumbnail)
    if image is not None:
        embed.set_image(url=image)
    await channel.send(embed=embed)

bot.run(get_config("token"))

ripe quest
#
PS C:\Users\Oguzhan\Desktop\embedcreator> py embed.py
Traceback (most recent call last):
  File "C:\Users\Oguzhan\Desktop\embedcreator\embed.py", line 2, in <module>
    from discord.commands import slash_command
ModuleNotFoundError: No module named 'discord.commands'
#

Dann kommt das

#

ich glaube ich habe irgendwas falsch installiert

urban glen
#

Was ist der output pip list?

tawdry leaf
#

hast wohl was falsch installiert

urban glen
#

discordpy und Pycord vertragen sich nicht btw

ripe quest
urban glen
#

Okay mach bitte pip uninstall discord discord.py discord-py-slash-command discord-ui und danach pip install py-cord

odd kiteBOT
#

@ripe quest

Requirements-Check

⚠️ Entferne alle Module aus der Python Standardbibliothek

asyncio                   3.4.3
DateTime                  4.5```
⚠️ Es sollte nur eine Discord Library installiert sein
```yml
discord                   1.7.3
discord.py                2.3.2
disnake                   2.9.0```
*Ich habe [diese Nachricht](#1019974414487535736 message) geprüft.*
ripe quest
#

Okay nun kommt das:

PS C:\Users\Oguzhan\Desktop\embedcreator> py embed.py
Traceback (most recent call last):
  File "C:\Users\Oguzhan\Desktop\embedcreator\embed.py", line 14, in <module>
    bot = commands.Bot(command_prefix='!', intents=intents, help_command=None)
NameError: name 'commands' is not defined
tawdry leaf
#

from discord.ext import commands

urban glen
#

mach mal anstatt bot = commands.Bot(command_prefix='!', intents=intents, help_command=None) zu bot = discord.Bot(command_prefix='!', intents=intents, help_command=None)

#

Wobei da du slashcommands hast brauchst du kein Prefix

#

also eig kannst du command_prefix='!' entfernen

ripe quest
#

Okay danke habe es hinbekommen

urban glen
#

Also /commands etc funkionieren?

ripe quest
#

Ja, muss ich noch schnell ausprobieren xD

urban glen
#

Sag mir bescheid. wenns funkioniert Top

ripe quest
#

hmm, leider kommt nichts

urban glen
#

Keine Antwort oder wird es nicht vorgeschlagen?

ripe quest
#

Es wird nicht vorgeschlagen wenn ich / eingebe

urban glen
#

bzw die bearbeite

ripe quest
#

Also das ist nicht das aktuelle

#

habe ja gerade bisschen geändert

#

ein Moment schicke es rein

urban glen
#

Schick mal die Aktuelle rein

restive herald
#

worum gehts

ripe quest
#
import discord
from discord.commands import slash_command
import discord.ui
import json

def get_config(name):
    with open("config.json", "r") as f:
        json_file = json.load(f)
        return json_file[name]


intents = discord.Intents.all()

bot = discord.Bot(intents=intents, help_command=None)

@bot.event
async def on_ready():
    print(f'Bot wurde erfolgreich als {bot.user.name} eingeloggt')



@slash_command()
async def embed(ctx, color: str, title: str, description: str, url: str = None, author_name: str = None, author_icon: str = None, footer_text: str = None, footer_icon: str = None, thumbnail: str = None, image: str = None):
    color1 = color.strip("#")
    hex_int = int(color1, base=16)
    channel = ctx.channel
    embed = discord.Embed(
        title=f"{title}",
        description=f"{description}",
        color=hex_int,
        url=url
    )
    if author_name is not None:
        embed.set_author(name=author_name, icon_url=author_icon)
    if footer_text is not None:
        embed.set_footer(text=footer_text, icon_url=footer_icon)
    if thumbnail is not None:
        embed.set_thumbnail(url=thumbnail)
    if image is not None:
        embed.set_image(url=image)
    await channel.send(embed=embed)

bot.run(get_config("token"))
urban glen
ruby sparrow
urban glen
#

Achso mach mal bitte so: ```py

import discord
from discord.commands import slash_command
import discord.ui
import json

def get_config(name):
with open("config.json", "r") as f:
json_file = json.load(f)
return json_file[name]

intents = discord.Intents.all()

bot = discord.Bot(intents=intents, help_command=None)

@bot.event
async def on_ready():
print(f'Bot wurde erfolgreich als {bot.user.name} eingeloggt')

@slash_command(name="meincommand") #/name hinzugefügt
async def embed(ctx, color: str, title: str, description: str, url: str = None, author_name: str = None, author_icon: str = None, footer_text: str = None, footer_icon: str = None, thumbnail: str = None, image: str = None):
color1 = color.strip("#")
hex_int = int(color1, base=16)
channel = ctx.channel
embed = discord.Embed(
title=f"{title}",
description=f"{description}",
color=hex_int,
url=url
)
if author_name is not None:
embed.set_author(name=author_name, icon_url=author_icon)
if footer_text is not None:
embed.set_footer(text=footer_text, icon_url=footer_icon)
if thumbnail is not None:
embed.set_thumbnail(url=thumbnail)
if image is not None:
embed.set_image(url=image)
await channel.send(embed=embed)

bot.run(get_config("token"))

ruby sparrow
urban glen
ripe quest
#

Er findet den Command immer noch nicht

restive herald
#

bro eine frage

#

du importierst von discord.commands

#

aber hast das nd importiert

ruby sparrow
urban glen
#

@ripe quest Was soll der Code überhaupt machen?

ripe quest
#

Einen Embed schicken

#

und farbe usw. kann man im Command hinzufügen

ruby sparrow
#

Hab dir gesagt warum @ripe quest

ripe quest
#

Aber der findet es trotzdem nicht

ruby sparrow
ripe quest
urban glen
#

Versuch es mal so(Habe ctx definiert):

 
import discord
from discord.commands import slash_command
import discord.ui
import json

def get_config(name):
    with open("config.json", "r") as f:
        json_file = json.load(f)
        return json_file[name]


intents = discord.Intents.all()
bot = discord.Bot(intents=intents, help_command=None)

@bot.event
async def on_ready():
    print(f'Bot wurde erfolgreich als {bot.user.name} eingeloggt')



@slash_command(name="meincommand") #/name hinzugefügt
async def embed(ctx: discord.ApplicationContext, color: str, title: str, description: str, url: str = None, author_name: str = None, author_icon: str = None, footer_text: str = None, footer_icon: str = None, thumbnail: str = None, image: str = None):
    color1 = color.strip("#")
    hex_int = int(color1, base=16)
    channel = ctx.channel
    embed = discord.Embed(
        title=f"{title}",
        description=f"{description}",
        color=hex_int,
        url=url
    )
    
    if author_name is not None:
        embed.set_author(name=author_name, icon_url=author_icon)
    if footer_text is not None:
        embed.set_footer(text=footer_text, icon_url=footer_icon)
    if thumbnail is not None:
        embed.set_thumbnail(url=thumbnail)
    if image is not None:
        embed.set_image(url=image)
    await channel.send(embed=embed)


bot.run(get_config("token"))
ruby sparrow
#

Wieso discord.ui?

#

@ripe quest erst warum dicord.ui?

#
  1. Das brachte du nicht
ripe quest
#

ka habe ich noch von meiner anderen main.py kopiert

ruby sparrow
#

Warte kurz mach dir

#

@restive herald kannst du kurz mich helfen mabye

ripe quest
urban glen
#

Bekommst du ein Output im Terminal?

ripe quest
#

Ja wenn ich den Bot starte kommt halt print raus

ruby sparrow
#
import discord
from discord.ext import commands
import json

def get_config(name):
    with open("config.json", "r") as f:
        json_file = json.load(f)
        return json_file[name]


intents = discord.Intents.all()

bot = commands.Bot(command_prefix='!', intents=intents, help_command=None)

@bot.event
async def on_ready():
    print(f'Bot wurde erfolgreich als {bot.user.name} eingeloggt')


@bot.slash_command(name="meincommand")
async def embed(ctx: discord.ApplicationContext, color: str, title: str, description: str, url: str = None,
                author_name: str = None, author_icon: str = None, footer_text: str = None, footer_icon: str = None,
                thumbnail: str = None, image: str = None):
    color1 = color.strip("#")
    hex_int = int(color1, base=16)
    channel = ctx.channel
    embed = discord.Embed(
        title=f"{title}",
        description=f"{description}",
        color=hex_int,
        url=url
    )

    if author_name is not None:
        embed.set_author(name=author_name, icon_url=author_icon)
    if footer_text is not None:
        embed.set_footer(text=footer_text, icon_url=footer_icon)
    if thumbnail is not None:
        embed.set_thumbnail(url=thumbnail)
    if image is not None:
        embed.set_image(url=image)
    await channel.send(embed=embed)

bot.run(get_config("token"))``` @ripe quest test mal
ripe quest
#

Jo, ein Moment

#

Ne leider auch nicht

ruby sparrow
#

mach bitte pip freeze

#

@ripe quest

ripe quest
#

Soll ich dir schicken was rauskam?

ruby sparrow
#

ja

#

bitte

restive herald
ruby sparrow
restive herald
ripe quest
#
aiofiles==0.8.0
aiohttp==3.8.5
aiosignal==1.2.0
aiosqlite==0.19.0
altgraph==0.17.2
anyio==3.6.1
app-commands==0.1.0
Async-OAuthlib==0.0.9
async-timeout==4.0.3
asyncio==3.4.3
attrs==22.1.0
beautifulsoup4==4.12.2
blinker==1.5
Brotli==1.1.0
bs4==0.0.1
cachetools==5.2.0
certifi==2022.6.15
cffi==1.16.0
chardet==4.0.0
charset-normalizer==2.1.0
chat-exporter==2.6.1
click==8.1.3
colorama==0.4.5
colour==0.1.5
config==0.5.1
DateTime==4.5
dhooks==1.1.4
discum==1.4.1
disnake==2.9.0
EasyProcess==1.1
emoji==2.8.0
entrypoint2==1.1
exceptiongroup==1.1.3
filetype==1.2.0
Flask==2.2.2
frozenlist==1.3.1
future==0.18.2
getmac==0.8.3
grapheme==0.6.0
h11==0.12.0
h2==4.1.0
hpack==4.0.0
httpcore==0.15.0
httpsx==0.0.1
httpx==0.23.0
hypercorn==0.13.2
hyperframe==6.0.1
idna==3.3
itsdangerous==2.1.2
Jinja2==3.1.2
keyboard==0.13.5
markdown-it-py==3.0.0
MarkupSafe==2.1.1
mdurl==0.1.2
mojang==0.2.0
MouseInfo==0.1.3
mss==9.0.1
multidict==6.0.2
numpy==1.23.1
oauthlib==3.2.0
outcome==1.2.0
packaging==23.1
pafy==0.5.5
pefile==2022.5.30
PIL-Tools==1.1.0
Pillow==9.2.0
priority==2.0.0
psutil==5.9.1
py-cord==2.4.1
PyAutoGUI==0.9.54
pycparser==2.21
pycryptodome==3.15.0
PyGetWindow==0.0.9
Pygments==2.16.1
pyinstaller==5.3
pyinstaller-hooks-contrib==2022.8
PyJWT==2.4.0
PyMsgBox==1.0.9
PyNaCl==1.5.0
pyotp==2.6.0
pyperclip==1.8.2
pypresence==4.2.1
PyRect==0.2.0
pyscreenshot==3.1
PyScreeze==0.1.29
PySocks==1.7.1
pystyle==2.9
python-dotenv==1.0.0
pytube==12.1.0
pytweening==1.0.7
pytz==2022.2
pywin32-ctypes==0.2.2
PyYAML==6.0.1
quart==0.18.0
Quart-Discord==2.1.4
requests==2.28.1
requests-toolbelt==1.0.0
rfc3986==1.5.0
rich==13.5.3
ruamel.yaml==0.17.21
ruamel.yaml.clib==0.2.6
selenium==4.13.0
six==1.16.0
sniffio==1.2.0
sortedcontainers==2.4.0
soupsieve==2.5
tls-client==0.2.2
toml==0.10.2
tqdm==4.66.1
trio==0.22.2
trio-websocket==0.11.1
typing_extensions==4.3.0
ua-parser==0.18.0
urllib3==1.26.11
websocket-client==0.59.0
websockets==3.4
Werkzeug==2.2.2
wsproto==1.1.0
yarl==1.8.1
youtube-dl==2021.12.17
zope.interface==5.4.0
odd kiteBOT
#

@ripe quest

Requirements-Check

⚠️ Entferne alle Module aus der Python Standardbibliothek

asyncio==3.4.3
DateTime==4.5```
⚠️ Es sollte nur eine Discord Library installiert sein
```yml
disnake==2.9.0
py-cord==2.4.1```
*Ich habe [diese Nachricht](#1019974414487535736 message) geprüft.*
restive herald
restive herald
urban glen
#

also pip uninstall disnake

restive herald
#

und pip uninstall py-cord

#

und dann wieder pip install py-cord

#

und dann halt asyncio und datetime deinstallieren

urban glen
#

Achso py-cord neuinstallieren, klar

ripe quest
#

Habe alles gemacht

urban glen
#

Und läuft?

ripe quest
#

/embed findet er trotzdem nd xD

restive herald
#

zeig nochmal deinen jtzigen code

ripe quest
#
import discord
from discord.ext import commands
from discord.commands import slash_command
import json

def get_config(name):
    with open("config.json", "r") as f:
        json_file = json.load(f)
        return json_file[name]


intents = discord.Intents.all()

bot = commands.Bot(command_prefix='!', intents=intents, help_command=None)

@bot.event
async def on_ready():
    print(f'Bot wurde erfolgreich als {bot.user.name} eingeloggt')


@bot.slash_command(name="meincommand")
async def embed(ctx: discord.ApplicationContext, color: str, title: str, description: str, url: str = None,
                author_name: str = None, author_icon: str = None, footer_text: str = None, footer_icon: str = None,
                thumbnail: str = None, image: str = None):
    color1 = color.strip("#")
    hex_int = int(color1, base=16)
    channel = ctx.channel
    embed = discord.Embed(
        title=f"{title}",
        description=f"{description}",
        color=hex_int,
        url=url
    )

    if author_name is not None:
        embed.set_author(name=author_name, icon_url=author_icon)
    if footer_text is not None:
        embed.set_footer(text=footer_text, icon_url=footer_icon)
    if thumbnail is not None:
        embed.set_thumbnail(url=thumbnail)
    if image is not None:
        embed.set_image(url=image)
    await channel.send(embed=embed)

bot.run(get_config("token"))
urban glen
#

Hast du auch schon /meincommand versucht?

ruby sparrow
#

@ripe quest

ripe quest
ripe quest
#

/meincommand funktioniert

#

Danke hahah

urban glen
#

Wegen name="meincommand" ist halt der name lol

#

Aber freut mich, dass es jetzt funkioniert. Dachte du machst /meincommand aber egal. Hauptsache es funkioniert

ripe quest
#

Jo, danke für eure Zeit ❤️

urban glen
#

Kein Problem 😂

urban glen
ruby sparrow
#

man was besser machen ?

urban glen
#

ephemeral=True hinzufügen

ruby sparrow
urban glen
#

Achso lol

ruby sparrow
#

ja

urban glen
#

Eigendlich nur die Rechtschreibung. Alles richtig geschrieben aber die Groß/kleinschreibung halt

ruby sparrow
urban glen
#

Vielleicht eine Interaction dort wo du dein Code eingeben kannst?

restive herald
ruby sparrow
#

@restive herald bei mir geht das nicht weg

restive herald
#

ähh wö is das bitte

ruby sparrow
restive herald
#

wie kam das da hin?

ruby sparrow
#

ka

lament talon
#

Wie schalte ich das für meinen Bot frei oder geht das noch nicht?

restive herald
#

der bot muss dafür verifiziert sein

wind finch
sullen fossil
sullen fossil
urban glen
#

ich hab einfach den bot gestartet gewartet und gewartet immer mal wieder neugestartet es geht einfach nicht

blissful vale
#

Heho.
Bevor ich meine Frage ausführlich stelle....
Kennt sich jemand mit Unity Animations aus?
Danke!

solid ingot
urban glen
#

hab das sogar über nacht laufen lassen es wurde einfach nicht anzeigt

solid ingot
solid ingot
# urban glen garnicht

achso, dann liegt es sehr wahrscheinlich einfach an deinem Code, nicht daran dass Discord zu lange braucht um die commands anzuzeigen

urban glen
solid ingot
#

gerne

wind finch
solid ingot
#

wieso nicht?

wind finch
wind finch
ruby sparrow
solid ingot
#

hast du das denn definiert im Code?

wind finch
solid ingot
#

schick mal den ganzen error

snow hatch
#

Moin, arbeite bei einem Projekt mit, dessen bot ist aber in discord.py
Wie Sehr unterscheidet sich das von pycord?

#

Oder ist es möglich irgendwie pycord Code in einen discord.py bot zu nutzen

solid ingot
wind finch
# solid ingot schick mal den ganzen error

hab bisschen was geändert , jetzt ist der close button nur noch das Problem.

Ignoring exception in view <TicketView timeout=None children=1> for item <Ticket type=<ComponentType.string_select: 3> placeholder='Triff eine Auswahl' min_values=1 max_values=1 options=[<SelectOption label='Allgemeiner Support' value='Allgemeiner Support' description=None emoji=<PartialEmoji animated=False name='8917blurpleticket' id=1159555563546497044> default=False>, <SelectOption label='Bewerbung' value='Bewerbung' description=None emoji=<PartialEmoji animated=False name='5053earlysupporter' id=1159553897669591051> default=False>, <SelectOption label='Allgemeine Fragen' value='Allgemeine Fragen' description=None emoji=<PartialEmoji animated=False name='3936faqbadge' id=1159555561910702100> default=False>] channel_types=[] disabled=False>:
Traceback (most recent call last):
  File "C:\Users\\Lib\site-packages\discord\ui\view.py", line 421, in _scheduled_task
    await item.callback(interaction)
  File "C:\Users\Dropdown.py", line 94, in callback
NameError: name 'close_ticket' is not defined```
solid ingot
#

alle ab slash commands

snow hatch
#

Oh...
Das heißt der Umstieg ist eher komplizierter/nervig

twilit anvil
viscid lake
silk gulch
#

Bin noch immer am Dashboard Tutorial und versuche gerade die Anzahl der Server anzeigen zu lassen.
Ich erhalte folgenden Fehler in meiner bot.py:

[ERROR] Error in event on_ipc_error 
Traceback (most recent call last):
  File "C:\Users\maxme\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\discord\client.py", line 378, in _run_event
    await coro(*args, **kwargs)
  File "c:\Users\maxme\Desktop\Dashboard\bot.py", line 20, in on_ipc_error
    raise exc
  File "C:\Users\maxme\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\discord\ext\ipc\server.py", line 153, in handle_request      
    resp: Optional[Union[Dict, str]] = await func(self.get_cls(func), coro[1](data))
                                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: Bot.guild_count() takes 1 positional argument but 2 were given```
solid ingot
#

code?

silk gulch
wind finch
viscid lake
silk gulch
#

Danke dennoch 🙂

solid ingot
silk gulch
#

Problem war, dass ich

async def guild_count(self, ):``` stehen hatte, obwohl dort
```py
async def guild_count(self, _):``` hinmusste. Wurde im Video jetzt nicht direkt erklärt.
solid ingot
#

doch das hab ich extra erklärt wieso da ein unterstrich hinmuss peeposlurp

silk gulch
#

Muss mein Bot dann eigentlich mit über das Dashboard laufen? Oder kann ich meinen Bot z.B. schon über meinen Server laufen und das Dashboard localhost?

silk gulch
solid ingot
wind finch
solid ingot
#

naja, wenn close_ticket nicht existiert, kannst du es auch nicht nutzen

ruby sparrow
#

weiss einer wie kommt man solche Bilder ?

wind finch
tawdry leaf
#

die benutzt man dafür nd

#

dass ist die view class die du da schreibst xD

urban glen
tawdry leaf
urban glen
#

tawdry leaf
wind finch
tawdry leaf
odd kiteBOT
wind finch
strange juniper
#

wie komme ich, innerhalb eines slash commands,
an den user oder member namen, der spezifisch für diesen server eingestellt wurde?

ctx.user.name und .display_name lieferten nur den richtigen acc namen. selbes für ctx.member.

limpid wolf
strange juniper
limpid wolf
#

Laut docs müsste das aber klappen Hmm

#

Sonst probier mal .nick aus

#

Der kann aber none sein i guess

strange juniper
#

mache ich

kind depot
#

Hi!
Ich habe ein Problem Bei Der Main Datei vom Dashbord... es kommt immer dießer error seit dem ich die .env reingemacht habe...

tawdry leaf
#

code vom error

ruby sparrow
kind depot
#

habe gerade den error gefunde... :/

ruby sparrow
#

du soll dem code senden denn könen wir dir besser helfen

tawdry leaf
#

also hast ihn selber lösen können?

kind depot
#

jup

tawdry leaf
#

sehr schön

ruby sparrow
#

ok

kind depot
#

trotzdem danke ^^

strange juniper
limpid wolf
#

Bist du dir sicher das die Person genickt ist? Hmm

#

Weil display_name müsste eig klappen und dann .nick sowieso

ruby sparrow
#

wie kann man man er commad geht nur dem ein server

fierce dove
#

Das nur der command auf einem Server geht

#

debug_guild

#

Glaub ich

native plume
ruby sparrow
native plume
ruby sparrow
native plume
native plume
#

Kein Ding

graceful fiber
#

Gibt's debug guild nicht eigentlich auch einfach pro slash connand 😅

native plume
urban glen
native plume
#

Cool

urban glen
#

Kannst einfach deine Guilds in den /command hinzufügen

wind finch
#

ERROR:

Ignoring exception in view <TicketView timeout=None children=1> for item <Ticket type=<ComponentType.string_select: 3> placeholder='Triff eine Auswahl' min_values=1 max_values=1 options=[<SelectOption label='Allgemeiner Support' value='Allgemeiner Support' description=None emoji=<PartialEmoji animated=False name='8917blurpleticket' id=1159555563546497044> default=False>, <SelectOption label='Bewerbung' value='Bewerbung' description=None emoji=<PartialEmoji animated=False name='5053earlysupporter' id=1159553897669591051> default=False>, <SelectOption label='Allgemeine Fragen' value='Allgemeine Fragen' description=None emoji=<PartialEmoji animated=False name='3936faqbadge' id=1159555561910702100> default=False>] channel_types=[] disabled=False>:
Traceback (most recent call last):
  File "C:\Users\Pizza\Lib\site-packages\discord\ui\view.py", line 421, in _scheduled_task
    await item.callback(interaction)
  File "C:\Users\Pizza\Downloads\Test Bot\cogs\Dropdown.py", line 92, in callback
    buttons_view = CloseundClaim()
                   ^^^^^^^^^^^^^^^
TypeError: CloseundClaim.__init__() missing 2 required positional arguments: 'ticket_id' and 'bot'```
wind finch
wind finch
strange juniper
#

.display_name tut seinen job.

ruby sparrow
wind finch
ruby sparrow
wind finch
ruby sparrow
limpid wolf
lofty rock
#
@bot.event
async def on_button_click(interaction: discord.Interaction):
    if interaction.custom_id == "verify_button":
        # Generate 4 random numbers from 1 to 7
        random_numbers = [random.randint(1, 7) for _ in range(4)]
        formatted_numbers = " ".join(map(str, random_numbers))

        
        embed = discord.Embed(
            title="Verification",
            description=f"Start of Verification. Please click the 4 Numbers below: {formatted_numbers}",
            color=discord.Color.green()
        )
        await interaction.followup.send(embed=embed, ephemeral=True)```
Kann mir jemand sagen warum das nicht kommt wenn ich den button klicke?


```py
import discord
import random
from discord.ext import commands
from discord.ui import Button, View

intents = discord.Intents.all()

bot = commands.Bot(command_prefix='/', intents=intents)

@bot.event
async def on_ready():
    print(f'Logged in as {bot.user.name}')

@bot.slash_command(
    name="verificationsetup",
    description="Set up verification",
)
async def verification_setup(ctx: commands.Context, channel: discord.TextChannel, role: discord.Role):
    # Verification code (kommt noch)
    
    
    
    embed = discord.Embed(
        title="Verification Setup",
        description="Click the button below to verify.",
        color=discord.Color.blue()
    )
    
    # Create a button
    button = Button(
        label="Verify",
        custom_id="verify_button",
        style=discord.ButtonStyle.primary
    )
    
    
    view = View()
    view.add_item(button)
    
    
    await channel.send(embed=embed, view=view)

@bot.event
async def on_button_click(interaction: discord.Interaction):
    if interaction.custom_id == "verify_button":
        # Generate 4 random numbers from 1 to 7
        random_numbers = [random.randint(1, 7) for _ in range(4)]
        formatted_numbers = " ".join(map(str, random_numbers))

        
        embed = discord.Embed(
            title="Verification",
            description=f"Start of Verification. Please click the 4 Numbers below: {formatted_numbers}",
            color=discord.Color.green()
        )
        await interaction.followup.send(embed=embed, ephemeral=True)
bot.run("token")
novel ore
#

choice = ["an", "aus"]

def get_auswahl():
    return choice

@slash_command(description="💬 × Entscheide ob der Bot dir eine DM senden soll oder nicht!")
    async def dm(
        self, ctx: discord.ApplicationContext, auswahl: Option(str, autocomplete=ezcord.ez_autocomplete(get_auswahl()))
    ):
        message = await BerächtigungenDB.get_dm(ctx.author.id)
        if auswahl == "aus":
            if message == 0:
                await ctx.respond(
                    f"{Nope} × Du hast deine DM-Nachrichten schon ausgeschalten", ephemeral=True
                )
            elif message == 1:
                await db.dm_set(0, ctx.author.id)
                await ctx.respond(
                    f"{Falcon_Yes} × Du hast eine DM-Nachrichten ausgeschalten", ephemeral=True
                )
            else:
                await ctx.respond(f"{Nope} × Es ist ein Fehler aufgetreten", ephemeral=True)
        elif auswahl == "an":
            if message == 1:
                await ctx.respond(
                    f"{Nope} × Du hast deine DM-Nachrichten schon angeschalten", ephemeral=True
                )
            elif message == 0:
                await db.dm_set(1, ctx.author.id)
                await ctx.respond(
                    f"{Falcon_Yes} × Du hast eine DM-Nachrichten angeschalten!", ephemeral=True
                )
            else:
                await ctx.respond(f"{Nope} × Es ist ein Fehler aufgetreten", ephemeral=True)

@solid ingot hier ist der code

lofty rock
vernal rampart
#

Warum ist end ein Tuble?

input("Wilkommen zum Neue Mitglieder Rechner, drücke ein Taste um zu starten")
mitglieder = input("Wie viele aktuelle Mitglieder")
erwartung = input("Wie viel Prozent?(Ohne Prozentzeichen)")
mitglieder = int(mitglieder)
erwartung = int(erwartung)
end = mitglieder + 0,erwartung * mitglieder / 100

#

@solid ingot

vernal rampart
viscid lake
#

spamme deine Frage nicht und pinge keine anderen User ohne Erlaubnis

solid ingot
vernal rampart
solid ingot
viscid lake
#

spamme deine Frage nicht und pinge keine anderen User ohne Erlaubnis

#

damit du es besser sieht

vernal rampart
solid ingot
#

solche kommas werden mit einem punkt dargestellt, trotzdem würde das nicht funktionieren. versuch es lieber mit einer normalen rechnung

vernal rampart
#

ok

tawdry leaf
vernal rampart
#

damit du es besser sieht

viscid lake
#

hat du die Erlaubnis?

#

ich denke nicht

tawdry leaf
#

was mischt du dich eig ein bist du mod?

viscid lake
#

ich darf auch ohne mod auf die regen hinweisen

#

🤡

#

regeln

vernal rampart
viscid lake
#

hab ich das gesagt peepothink

tawdry leaf
viscid lake
#

naja ich denke nicht das er sie hat ich meinte timo mag es auch nicht so da er es sieht

#

ich denken heißt ja auch nicht das es so sein muss oder?

tawdry leaf
#

Junge dann sagt das Timo selber fertig

viscid lake
#

sei mal nicht so fech :d

tawdry leaf
#

Mach kein Fass auf wo keine Haltbarkeit ist

viscid lake
#

und was mischst du dich eig ein war eine sachen zwischen mir und tofbd oder nicht

#

naw jetzt sagt er nichts mehr

lofty rock
novel ore
#

was?

#

das meine nachricht

tawdry leaf
#

die falsche nachricht replied xD

tawdry leaf
#

also im Code

#

und wieso machst du des nicht einfach so das du wenn es schon der button ist das du die sachen auch beim button auslöst?

lofty rock
wind finch
lofty rock
wind finch
ripe harness
limpid wolf
ruby sparrow
#

@ripe harness hier

limpid wolf
ripe harness
#

Aber was haben Datenbanken denn mit Discord Bots zutun

limpid wolf
ripe harness
limpid wolf
#

Dann kann dir schneller geholfen werden

ruby sparrow
#

ja ist so

#

nikas weiss du warum wurde die db gemacht

limpid wolf
ripe harness
#

Hatte keinen Grund eigentlich

ruby sparrow
#

weiss einer fragen wurd die db g nicht gemacht ```py
class TicketSystemCog(commands.Cog):
def init(self, bot):
self.bot = bot
self.conn = sqlite3.connect("Ticket.db")
self.create_tables()

def create_tables(self):
    c = self.conn.cursor()
    c.execute('''
        CREATE TABLE IF NOT EXISTS ticket_settings (
            guild_id INTEGER PRIMARY KEY,
            category_team INTEGER,
            category_help INTEGER,
            category_other INTEGER,
            role_team INTEGER,
            role_high_team INTEGER,
            role_fraktionsantrag INTEGER
        )
    ''')
    self.conn.commit()

def get_guild_settings(self, guild_id):
    c = self.conn.cursor()
    c.execute('SELECT * FROM ticket_settings WHERE guild_id = ?', (guild_id,))
    return c.fetchone()

def save_guild_settings(self, guild_id, category_team, category_help, category_other,
                        role_team, role_high_team, role_fraktionsantrag):
    c = self.conn.cursor()
    c.execute('''
        INSERT OR REPLACE INTO ticket_settings (guild_id, category_team, category_help, category_other,
                                                role_team, role_high_team, role_fraktionsantrag)
        VALUES (?, ?, ?, ?, ?, ?, ?)
    ''', (guild_id, category_team, category_help, category_other, role_team, role_high_team, role_fraktionsantrag))
    self.conn.commit()```
viscid lake
limpid wolf
ruby sparrow
viscid lake
ruby sparrow
limpid wolf
#

Ich glaube mehr muss ich dazu nicht sagen?

viscid lake
#

das ist aber sehr persönlich xd

ripe harness
#

Ich will ein Warn System mit pycord machen weiß aber nicht ganz wie ich das in meinen Bot implementieren könnte da ich so gut wie 0 Ahnung von Datenbanken habe
Hat igrendjemand docs dafür oder sowas ähnliches?

#

Danke im Voraus thumbs_up

ripe harness
ripe harness
#

docs wären cool oder irgendwas woran ich mich orientieren kann

ruby sparrow
ruby sparrow
#

@ripe harness komm

#

ich helfe dir

old ore
#

weiß wer wie man sich so einen table in ein embed überträgt

wicked echo
#

Ignoring exception in view <TutorialView timeout=None children=1> for item <Select type=<ComponentType.string_select: 3> placeholder='Triff eine auswahl' min_values=1 max_values=1 options=[<SelectOption label='📌-Allgemein' value='1' description='Ticket auswahl' emoji=None default=False>, <SelectOption label='📞-Frage' value='2' description='Ticket auswahl' emoji=None default=False>, <SelectOption label='💵-Kaufen' value='3' description='Ticket auswahl' emoji=None default=False>] channel_types=[] disabled=False>:
Traceback (most recent call last):
  File "C:\Users\Filip\PycharmProjects\testbot\venv\Lib\site-packages\discord\ui\view.py", line 414, in _scheduled_task
    await item.callback(interaction)
  File "C:\Users\Filip\PycharmProjects\testbot\cogs\dropdown.py", line 83, in select_callback
    channel = await interaction.guild.create_text_channel(name=f"🎫-{interaction.user.name}", overwrites=overwrites, category=cat)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Filip\PycharmProjects\testbot\venv\Lib\site-packages\discord\guild.py", line 1263, in create_text_channel
    data = await self._create_channel(
                 ^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Filip\PycharmProjects\testbot\venv\Lib\site-packages\discord\guild.py", line 1142, in _create_channel
    "id": target.id,
          ^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'id'```
#

kann mir wer helfen es soll eigentlich ein channel created werden es tut es aber nd

#

und es passiert nur was wenn ich administrator rechte habe es ist ein ticket system

ruby sparrow
#
    def __init__(self, bot) -> None:
        self.bot = bot
        super().__init__(timeout=None)

        @discord.ui.button(label="Claim", style=discord.ButtonStyle.green, emoji=None, custom_id="ticketClaim")
        async def button_callback4(self, button, interaction):
            for child in self.children:
                child.disabled = True

            Embed = discord.Embed(
                title="Ticket wird Claim",
                description=f"Anfrage von: {interaction.user.mention}\n"
                            f"\n"
                            f"\n"
                            f"▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬\n",
                color=discord.Color.purple())
            Embed.set_footer(icon_url=self.bot.user.display_avatar.url, text=self.bot.user)
            await interaction.response.edit_message(view=self)
            await interaction.followup.send(embed=Embed, ephemeral=True)```
#

warum wurd dem butten nicht angezeig

wicked echo
ruby sparrow
wicked echo
#

aber ich kann ein ticket öffnen wenn ich administrator rchte habe aber wenn ich keine habe dann geht es nd

old ore
#

weiß wer wie man sich so einen table in ein embed überträgt

wicked echo
#

weis wer wie ich mache das Z.b die rolle team zugriff auf die tickets hat also die tickets sieht

habe es damit gemacht geht aber nd

interaction.user.get_role(1107251138790686829): discord.PermissionOverwrite(read_messages=True)
hard pivot
old ore
hard pivot
# old ore ja das wäre eine Möglichkeit muss ich schauen wie des geht

hab noch ne andere möglich keit

from table2ascii import table2ascii as t2a, PresetStyle

# In your command:
output = t2a(
    header=["Rank", "Team", "Kills", "Position Pts", "Total"],
    body=[[1, 'Team A', 2, 4, 6], [2, 'Team B', 3, 3, 6], [3, 'Team C', 4, 2, 6]],
    first_col_heading=True
)

await ctx.send(f"```\n{output}\n```")
hard pivot
#

Geht jetzt nicht weil discord mir das sonst nicht als code block macht

#

Und farben kannst du mit CSS als codeblock machen also so

old ore
#

ja ich schau mal nach ob es geht

old ore
#

is das so gewollt

hard pivot
hard pivot
old ore
#

ach jz ja danke dir

hard pivot
wicked echo
#

habe ein verify system geschrieben hier kommt aber dieser error beim drücken des knöpfes kann mir wer helfen ?


Ignoring exception in view <VerifyView timeout=180.0 children=1> for item <Button style=<ButtonStyle.danger: 4> url=None disabled=False label='Verify' emoji=None row=None>:
Traceback (most recent call last):
  File "C:\Users\Filip\PycharmProjects\testbot\venv\Lib\site-packages\discord\ui\view.py", line 414, in _scheduled_task
    await item.callback(interaction)
  File "C:\Users\Filip\PycharmProjects\testbot\cogs\verify.py", line 31, in button_callback
    await interaction.user.add_roles(self, 1107251138790686826)
  File "C:\Users\Filip\PycharmProjects\testbot\venv\Lib\site-packages\discord\member.py", line 1007, in add_roles
    await req(guild_id, user_id, role.id, reason=reason)
  File "C:\Users\Filip\PycharmProjects\testbot\venv\Lib\site-packages\discord\http.py", line 371, in request
    raise HTTPException(response, data)
discord.errors.HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body
In role_id: Value "0823567de90881fdefb35d852c8c83d1" is not snowflake.

wicked echo
#

Ja

wicked echo
# old ore maybe mal code?
import discord
import asyncio
from discord.ext import commands
from discord.commands import slash_command


class Verify(commands.Cog):
    def __init__(self, bot: discord.Bot):
        self.bot = bot

    @slash_command(description="Verify command")
    async def verify(self, ctx):
        embed = discord.Embed(
            title="VERIFY",
            description="Verifiziere dich mit dem Button."
        )

        embed.set_footer(icon_url=self.bot.user.display_avatar.url, text=self.bot.user.name)

        await ctx.respond(embed=embed, view=VerifyView())


def setup(bot: discord.Bot):
    bot.add_cog(Verify(bot))

class VerifyView(discord.ui.View):
    @discord.ui.button(label="Verify", style=discord.ButtonStyle.red)
    async def button_callback(self, button, interaction):
        await interaction.response.send_message("du hast dich Verifiziert", ephemeral=True)
        await asyncio.sleep(5)
        await interaction.user.add_roles(self, 1107251138790686826)```
old ore
#

wo für der self parameter

fierce dove
#

Wie kann, Ich das blau machen in pycarm

#

Oben in der ecke

old ore
#

ich würde dir auch empfehlen die rolle erst zu getten um sicher zu gehen das es sie noch geht:

role = await ctx.guild.get_role(yourid)
if role is None:
    await interaction.followup.send(your text/embed), ephemeral=True)
else:
    pass
    #dein weitere code

old ore
viscid lake
#

Wie heißt das nochmal wenn jemand ein Forum Post erstellt

#

Async def blablabla

fierce dove
#

Wenn ich auf add_help_command darauf drücke das ich dann da hin komme

fierce dove
tawdry leaf
fierce dove
#

Keine Ahnung warum es nicht geht

#

@tawdry leaf

tawdry leaf
fierce dove
#

Bin gerade nicht am pc

fierce dove
tawdry leaf
viscid lake
fierce dove
fierce dove
fierce dove
tawdry leaf
fierce dove
tawdry leaf
fierce dove
#

Selber

ruby sparrow
#
@discord.ui.button(label="Warn", style=discord.ButtonStyle.green, custom_id="warn",
                       emoji=":apepewild:")
    async def warn(self, button: discord.ui.Button, interaction: discord.Interaction):

        if self.user.guild_permissions.kick_members:
            warn_time = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
            async with aiosqlite.connect("warnings.db") as db:
                print("Database connection established.")
                sql = "INSERT INTO WarnList (user_id, guild_id, warns, warn_reason, mod_id, warn_time) VALUES (?, ?, ?, ?, ?, ?)"
                values = (self.user.id, interaction.guild.id, 1, self.reason, interaction.user.id, warn_time)
                try:
                    await db.execute(sql, values)
                    await db.commit()
                    print("Data inserted successfully.")
                except Exception as e:
                    print(f"Error while inserting data: {e}")

                async with db.execute('SELECT warns FROM WarnList WHERE user_id = ? AND guild_id = ?',
                                      (self.user.id, interaction.guild.id)) as cursor:
                    row = await cursor.fetchone()
                    if row and row[0] > 4:
                        await self.user.ban(reason=f"Mehr als 4 Warnungen ({row[0]})")
                        await interaction.response.send_message(
                            f"{self.user.mention} wurde aufgrund von mehr als 4 Warnungen gebannt.", ephemeral=True)
                        return

        await interaction.response.send_message(f"{self.user.mention} wurde gewarnt für `{self.reason}`",
                                                ephemeral=True)
        await asyncio.sleep(5)
        await interaction.delete_original_response()```
#
Ignoring exception in view <PunishView timeout=180.0 children=3> for item <Button style=<ButtonStyle.success: 3> url=None disabled=False label='Warn' emoji=<PartialEmoji animated=True name='apepewild' id=1086662139210637382> row=None>:
Traceback (most recent call last):
  File "C:\Users\nicor\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ui\view.py", line 421, in _scheduled_task
    await item.callback(interaction)
  File "C:\Users\nicor\OneDrive\Desktop\Mond bot\admin\Punish.py", line 155, in warn
    async with db.execute('SELECT warns FROM WarnList WHERE user_id = ? AND guild_id = ?',
  File "C:\Users\nicor\AppData\Local\Programs\Python\Python310\lib\site-packages\aiosqlite\context.py", line 41, in __aenter__
    self._obj = await self._coro
  File "C:\Users\nicor\AppData\Local\Programs\Python\Python310\lib\site-packages\aiosqlite\core.py", line 184, in execute
    cursor = await self._execute(self._conn.execute, sql, parameters)
  File "C:\Users\nicor\AppData\Local\Programs\Python\Python310\lib\site-packages\aiosqlite\core.py", line 129, in _execute
    return await future
  File "C:\Users\nicor\AppData\Local\Programs\Python\Python310\lib\site-packages\aiosqlite\core.py", line 102, in run
    result = function()
sqlite3.OperationalError: no such table: WarnList```
tawdry leaf
#

musst den table erstellen

ruby sparrow
#

hab ich

fierce dove
#

Die letzte Klammer ist zu weit draußen die muss unser await db.execute

tawdry leaf
#
  1. Im Code und im Bild sind zwei verschiedene Datei Pfade
  2. Einmal data/warnings.db und einmal warnings.db
  3. Also einmal nicht im ordner und einmal im ordner
ruby sparrow
#

also stimmt

#

💀

tawdry leaf
#

immer diese dms 😄

thick haven
#

Kann nmir wer helfen

task: <Task pending name='pycord: on_ready' coro=<Client._run_event() done, defined at C:\Users\Ramon\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\discord\client.py:370> wait_for=<Future pending cb=[Task.task_wakeup()]>>```

@commands.Cog.listener()
async def on_ready(self):
    self.guild_ids = [guild.id for guild in self.bot.guilds]
    async with connect() as (conn, cur):
        await cur.execute(f"CREATE TABLE IF NOT EXISTS changelog (guild_id BIGINT, dc_systemchannel_id BIGINT, dc_channel_id BIGINT, notify BOOLEAN)")
    await self.insert_data()

async def insert_data(self):
    async with connect() as (conn, cur):
        for guild_id in self.guild_ids:
            guild = self.bot.get_guild(guild_id)
            system_channel_id = guild.system_channel.id if guild.system_channel else None
            await cur.execute(f"SELECT * FROM changelog WHERE guild_id = {guild_id}")
            existing_entry = await cur.fetchone()
            if not existing_entry:
                await cur.execute(f"INSERT INTO changelog (`guild_id`, `dc_systemchannel_id`, `notify`) VALUES ('{guild_id}', '{system_channel_id}', '1')")
            else:
                continue
ruby sparrow
#
@discord.ui.button(label="Ban", style=discord.ButtonStyle.red, custom_id="ban",
                       emoji=":banbutton:")
    async def ban(self, button: discord.ui.Button, interaction: discord.Interaction):

        if self.user.guild_permissions.ban_members:
            await interaction.response.send_message("Du kannst keine Moderatoren bannen.", ephemeral=True)
            await asyncio.sleep(5)
            await interaction.delete_original_response()
            return

        if self.user.id == interaction.user.id:
            await interaction.response.send_message("Du kannst dich nicht selbst bannen!", ephemeral=True)
            await asyncio.sleep(5)
            await interaction.delete_original_response()
            return

        if interaction.user.top_role.position < self.user.top_role.position:
            await interaction.response.send_message("Du kannst keinen Nutzer bannen, der eine höhere Rolle hat als du!",
                                                    ephemeral=True)
            await asyncio.sleep(5)
            await interaction.delete_original_response()
            return

        if interaction.user.guild_permissions.ban_members:
            await self.user.ban(reason=self.reason, delete_message_seconds=60000)
            await interaction.response.send_message(f"{self.user.mention} wurde gebannt für `{self.reason}`",
                                                    ephemeral=True)
            await asyncio.sleep(5)
            await interaction.delete_original_response()

        if interaction.user.guild_permissions.ban_members:
            await interaction.response.send_message("Ohje.. du hast noch keine Berechtigung um Nutzer zu bannen!",
                                                    ephemeral=True)
            await asyncio.sleep(5)
            await interaction.delete_original_response()
            return```
#
Ignoring exception in view <PunishView timeout=180.0 children=3> for item <Button style=<ButtonStyle.danger: 4> url=None disabled=False label='Ban' emoji=<PartialEmoji animated=True name='banbutton' id=1086650068368633916> row=None>:
Traceback (most recent call last):
  File "C:\Users\nicor\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ui\view.py", line 421, in _scheduled_task
    await item.callback(interaction)
  File "C:\Users\nicor\OneDrive\Desktop\Mond bot\admin\Punish.py", line 101, in ban
    await interaction.response.send_message("Ohje.. du hast noch keine Berechtigung um Nutzer zu bannen!",
  File "C:\Users\nicor\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\interactions.py", line 844, in send_message
    raise InteractionResponded(self._parent)

discord.errors.InteractionResponded: This interaction has already been responded to before```
blissful vale
blissful vale
#

Du schreibst am anfang der funktion

await interaction.response.defer()

und ersetzt dann das, was ich geschrieben habe.

ruby sparrow
#
@discord.ui.button(label="Ban", style=discord.ButtonStyle.red, custom_id="ban",
                       emoji=":banbutton:")
    async def ban(self, button: discord.ui.Button, interaction: discord.Interaction):

        if self.user.guild_permissions.ban_members:
            await interaction.response.send_message("Du kannst keine Moderatoren bannen.", ephemeral=True)
            await asyncio.sleep(5)
            await interaction.response.defer()
            return

        if self.user.id == interaction.user.id:
            await interaction.response.send_message("Du kannst dich nicht selbst bannen!", ephemeral=True)
            await asyncio.sleep(5)
            await interaction.response.defer()
            return

        if interaction.user.top_role.position < self.user.top_role.position:
            await interaction.followup.send("Du kannst keinen Nutzer bannen, der eine höhere Rolle hat als du!",ephemeral=True)
            await asyncio.sleep(5)
            await interaction.response.defer()
            return

        if interaction.user.guild_permissions.ban_members:
            await self.user.ban(reason=self.reason, delete_message_seconds=60000)
            await interaction.followup.send(f"{self.user.mention} wurde gebannt für `{self.reason}`",
                                                    ephemeral=True)
            await asyncio.sleep(5)
            await interaction.response.defer()

        if interaction.user.guild_permissions.ban_members:
            await interaction.followup.send("Ohje.. du hast noch keine Berechtigung um Nutzer zu bannen!",
                                                    ephemeral=True)
            await asyncio.sleep(5)
            await interaction.response.defer()
            return``` @blissful vale meste du so
blissful vale
#
@discord.ui.button(label="Ban", style=discord.ButtonStyle.red, custom_id="ban",
                       emoji=":banbutton:")
    async def ban(self, button: discord.ui.Button, interaction: discord.Interaction):
        await interaction.response.defer()
        if self.user.guild_permissions.ban_members:
            await interaction.followup.send("Du kannst keine Moderatoren bannen.", ephemeral=True)
            await asyncio.sleep(5)
            return

        if self.user.id == interaction.user.id:
            await interaction.followup.send("Du kannst dich nicht selbst bannen!", ephemeral=True)
            await asyncio.sleep(5)
            return

        if interaction.user.top_role.position < self.user.top_role.position:
            await interaction.followup.send("Du kannst keinen Nutzer bannen, der eine höhere Rolle hat als du!",ephemeral=True)
            await asyncio.sleep(5)
            return

        if interaction.user.guild_permissions.ban_members:
            await self.user.ban(reason=self.reason, delete_message_seconds=60000)
            await interaction.followup.send(f"{self.user.mention} wurde gebannt für `{self.reason}`",
                                                    ephemeral=True)
            await asyncio.sleep(5)

        if interaction.user.guild_permissions.ban_members:
            await interaction.followup.send("Ohje.. du hast noch keine Berechtigung um Nutzer zu bannen!",
                                                    ephemeral=True)
            await asyncio.sleep(5)
            return
#

So ists richtig!

#

So meine ich, hab was übersehen!

ruby sparrow
#
[ERROR] Error while executing /punish 
Traceback (most recent call last):
  File "C:\Users\nicor\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\commands\core.py", line 131, in wrapped
    ret = await coro(arg)
  File "C:\Users\nicor\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\commands\core.py", line 1000, in _invoke
    await self.callback(self.cog, ctx, **kwargs)
  File "C:\Users\nicor\OneDrive\Desktop\Mond bot\admin\Punish.py", line 43, in punish
    await ctx.respond(embed=overview_embed, view=PunishView(reason, user), ephemeral=True)
  File "C:\Users\nicor\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\interactions.py", line 571, in respond
    return await self.response.send_message(*args, **kwargs)
  File "C:\Users\nicor\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\interactions.py", line 904, in send_message
    await self._locked_response(
  File "C:\Users\nicor\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\interactions.py", line 1198, in _locked_response
    await coro
  File "C:\Users\nicor\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\webhook\async_.py", line 222, in request
    raise HTTPException(response, data)
discord.errors.HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body
In data.components.0.components.0.emoji.name: Invalid emoji``` jerzt geht er emjji nicht mehr
#

@blissful vale

blissful vale
#

Ist der "banbutton" ein custom emoji?

ruby sparrow
#

ja

blissful vale
blissful vale
#

?

fierce dove
blissful vale
fierce dove
#

Ok

ruby sparrow
blissful vale
blissful vale
#

Lies die Zeile genau...

tawdry leaf
urban glen
old ore
#

gibt es irgendeine Möglichkeit das man discord Automod rules nur in einem bestimmten channel gülttig sein sollen

thick haven
#

Kann mir heir jmd helfen wie ich das richtig umwaandle?

Traceback (most recent call last):
  File "C:\Users\jurek\Documents\Development\Python\DC Bots\Xenority\Xenority-Main-Pycord-V2-PY\.venv\lib\site-packages\discord\ui\view.py", line 414, in _scheduled_task
    await item.callback(interaction)
  File "c:\Users\jurek\Documents\Development\Python\DC Bots\Xenority\Xenority-Main-Pycord-V2-PY\cogs\TEST.py", line 42, in callback
    image = Image.open(BytesIO(data))
TypeError: a bytes-like object is required, not '_io.BytesIO'```

```py
        image = Image.open(BytesIO(data))
        file = discord.File(BytesIO(data), filename="test.png")

        embed = discord.Embed()
        embed.set_image(url="attachment://test.png")

        await interaction.response.send_message(embed=embed, file=file)
old ore
fierce dove
#

Welche ID muss da rein

await channel.fetch_message()

#

Muss da die Message ID rein

wind finch
fierce dove
#

Ok

fierce dove
#

Wie kann man sowas machen

limpid wolf
#

Oder halt im Bot default permissions so setzen dass man manage guild oder sowas braucht

fierce dove
#

OK thx

lofty rock
#
activity = discord.CustomActivity("Securing Servers")
bot = ezcord.PrefixBot(command_prefix='!', intents=intents, activity=activity, status=discord.Status.idle)

kann mir wer sagen warum der Custom Status nicht angezeigt wird?

thick haven
#

Wie kann iuch in einem callback auf .wait_for zugreifen also was muss ich davor amchen wnen ich n icht den bot mit übergeb

ruby sparrow
urban glen
#

Also du willst auf das wait_for event zugreifen wenn du den Bot übergibst?

urban glen
#
[ERROR] Error in event on_ready
Traceback (most recent call last):
  File "C:\Users\gehtd\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\discord\client.py", line 399, in _run_event
    await coro(*args, **kwargs)
  File "C:\Users\gehtd\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\ezcord\bot.py", line 332, in _db_setup
    for instance in DBHandler._auto_setup.values():
RuntimeError: dictionary changed size during iteration
#

@solid ingot did i do something wrong, or is a error in ezcord :o

tawdry leaf
#

error in ezcord da wird timo sauer wenn er das liest

solid ingot
#

initialisiert du in ei EM on ready event eine neue DB klasse?

ruby sparrow
#
Ignoring exception in view <TicketClose timeout=None children=3> for item <Button style=<ButtonStyle.success: 3> url=None disabled=True label='Claim' emoji=None row=None>:
Traceback (most recent call last):
  File "C:\Users\nicor\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ui\view.py", line 421, in _scheduled_task
    await item.callback(interaction)
  File "C:\Users\nicor\OneDrive\Desktop\Mond bot\support\Ticket.py", line 245, in button_callback4
    await interaction.response.send_message(embed=embed, ephemeral=True)
  File "C:\Users\nicor\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\interactions.py", line 904, in send_message
    await self._locked_response(
  File "C:\Users\nicor\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\interactions.py", line 1198, in _locked_response
    await coro
  File "C:\Users\nicor\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\webhook\async_.py", line 220, in request
    raise NotFound(response, data)
discord.errors.NotFound: 404 Not Found (error code: 10062): Unknown interaction```
#
@discord.ui.button(label="Claim", style=discord.ButtonStyle.green, emoji=None, custom_id="ticketClaim")
    async def button_callback4(self, button: discord.ui.Button, interaction: discord.Interaction):

        if any(role.id in [teamroleID1, teamroleID2, teamroleID3] for role in interaction.user.roles):
            button.disabled = True

            async for message in interaction.channel.history(limit=None).filter(
                    lambda m: m.author.id != self.bot.user.id):
                await message.delete()

    
            embed = discord.Embed(
                title="Ticket wird Claimed",
                description=f"Anfrage von: {interaction.user.mention}\n"
                            f"\n"
                            f"\n"
                            f"▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬\n",
                color=discord.Color.purple()
            )
            embed.set_footer(icon_url=self.bot.user.display_avatar.url, text=self.bot.user.name)

            await interaction.response.send_message(embed=embed, ephemeral=True)
        else:
            await interaction.response.send_message("Nur Teammitglieder dürfen dieses Ticket übernehmen.",
                                                    ephemeral=True)```
sullen fossil
#

Hallo kann mir wer sagen wie ich so ein rps game wie in #🎮・games machen kann es geht dabei eher um den Multiplayer wie kann ich es denn machen das der bot wartet bis der zweite user gedrückt hat? (Wenn es geht bitte mit einen Beispiel)

native plume
native plume
ruby sparrow
#

weiss einer wie es geht in das ticket ein dropdown rein machen kann

sullen fossil
sullen fossil
ruby sparrow
#

@solid ingot Ich weiss wie dropdown geht ich weiss nicht wie kann man in das ticket dropdown machen kann

ruby sparrow
#

das ist meine farge

solid ingot
#

du musst einfach bei der Nachricht die du ins Ticket sendest noch einen View hinzufügen mit dem dropdown

ruby sparrow
#

ok

upper adder
#

Kennt jemand ein Workaround für "Führe Code XYZ in x Stunden aus"?

#

Ist ne asnyc-Funktion

solid ingot
urban glen
solid ingot
solid ingot
urban glen
#

Bin mir aber eig sicher das ich es nicht mache

#

bei meiner bot class sync ich die cmds under printe was und bei einem anderen in einem cog adde ich eine view

viscid lake
solid ingot
# sullen fossil Hallo kann mir wer sagen wie ich so ein rps game wie in <#1157718253674696815> m...

du könntest in der View Klasse eine Liste oder ein Dictionary erstellen, und darin speicherst du, welche User einen Button angeklickt haben.

dazu kannst du in der init Methode der View Klasse sowas schreiben wie ‘self.clicked = {}‘

in der callback Methode fügst du dann einfach ein Element zum Dict hinzu. dabei kannst du auch checken, ob schon ein Spieler im Dict vorhanden ist, denn dann weißt du, dass jetzt beide Spieler ihre Tipps abgegeben haben

solid ingot
normal sundial
#

kann mir wer sagen warum ich aus dem code:

roles = {}
        rolles =[]
        for roel in guild.roles:
            roles["name"] = roel.name
            roles["id"] = roel.id
            rolles.append(roles)
        print(rolles)

diese liste bekomme

[{'name': 'asdasdasd', 'id': 745744383365742642}, {'name': 'asdasdasd', 'id': 745744383365742642}, {'name': 'asdasdasd', 'id': 745744383365742642}, {'name': 'asdasdasd', 'id': 745744383365742642}, {'name': 'asdasdasd', 'id': 745744383365742642}, {'name': 'asdasdasd', 'id': 745744383365742642}, {'name': 'asdasdasd', 'id': 745744383365742642}, {'name': 'asdasdasd', 'id': 745744383365742642}, {'name': 'asdasdasd', 'id': 745744383365742642}, {'name': 'asdasdasd', 'id': 745744383365742642}, {'name': 'asdasdasd', 'id': 745744383365742642}, {'name': 'asdasdasd', 'id': 745744383365742642}, {'name': 'asdasdasd', 'id': 745744383365742642}, {'name': 'asdasdasd', 'id': 745744383365742642}, {'name': 'asdasdasd', 'id': 745744383365742642}, {'name': 'asdasdasd', 'id': 745744383365742642}, {'name': 'asdasdasd', 'id': 745744383365742642}, {'name': 'asdasdasd', 'id': 745744383365742642}, {'name': 'asdasdasd', 'id': 745744383365742642}, {'name': 'asdasdasd', 'id': 745744383365742642}, {'name': 'asdasdasd', 'id': 745744383365742642}, {'name': 'asdasdasd', 'id': 745744383365742642}, {'name': 'asdasdasd', 'id': 745744383365742642}, {'name': 'asdasdasd', 'id': 745744383365742642}, {'name': 'asdasdasd', 'id': 745744383365742642}, {'name': 'asdasdasd', 'id': 745744383365742642}, {'name': 'asdasdasd', 'id': 745744383365742642}, {'name': 'asdasdasd', 'id': 745744383365742642}, {'name': 'asdasdasd', 'id': 745744383365742642}]

es gibt 29 rollen die auch bis eben angezeigt wurden und auf einmal nur die letzte in der runde.

solid ingot
#

hast du die einrückung geändert?

normal sundial
#

nein

solid ingot
#

schick mal die einrückung als screenshot

normal sundial
solid ingot
#

sieht bis auf die variablennamen ganz gut aus, lass dir mal alle möglichen sachen printen damit du siehst was falsch läuft

normal sundial
#

wenn ich roles printe kommen alle rollen

#

also muss es eogentlich am append liegen..

solid ingot
#

versuchs als kurzform: [{"name": role.name, "id": role.id} for role in guild.roles]

normal sundial
#

okay hat geklappt stehe nun vor einem kleinen css problem xD

#

kann man css zwei items in einem div untereinander darstellen lassen?

normal sundial
#

also so dass Tatsu oben steht und die ID drunter. geht das?

viscid lake
graceful fiber
#

wenn sie in einem div sind geht vermutlich auch br @normal sundial ^^

#

oder display block i guess

normal sundial
#

habs halt so und es klappt nicht ```html
<div class="role-item">
<p id=role-1 class="role-title"> <b>{{ role.name }}</b> </p>
<p id =role-2 class="role-title"> <b>{{ role.id }}</b> </p>
</div>

normal sundial
graceful fiber
#

nicht unbedingt

#
.role-item{
  display: block;
}

.role-title {
  width: 100%;
}
#

Probier mal iwie sowas

#

das solle an sicht klappen, kenne halt deine restliche formatierung nicht

#

ansonsten musst du dir was mit display:flex und vermutlich ner column flex direction in css bauen

#

@normal sundial ^^

normal sundial
# graceful fiber <@283853739159453696> ^^
.role-item {
  margin: 10px 0 0 10px;
  width: 500px;
  min-width: 300px;
  height: 100px;
  border-radius: .75rem;
  font-size: 2rem;
  float: left;
  overflow: hidden;
  background-color: #3a4242;
  display: flex;
  align-items: center;
}

#role-1 {
  float: both;
  margin-left: 0px;
  margin-top: 0px;
  }
  
  #role-2 {
  float: both;
  margin-left: 0px;
  margin-top: 0px;
  }

.role-item:hover {
  transform: scale(1.05);
  box-shadow: 0 .2rem .5rem rgba(0, 0, 0, 0.3), 0 1rem .5rem rgba(0, 0, 0, 0.22)
}


.role-title {
  padding: 25px 25px ;
  height: 80%;
  width: 100%;
  font-size: 70%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: left;
  border-radius: 50%;
  margin:0 auto;
}

so hab ich das

#

ich bin überfragt ich bin css starter xD

graceful fiber
normal sundial
#

Leider hat das nichts gebracht

graceful fiber
normal sundial
#

ja ich habe nun keine id mehr angezeigt xD

graceful fiber
#
.role-item {
  margin: 10px 0 0 10px;
  width: 500px;
  min-width: 300px;
  height: 100px;
  border-radius: .75rem;
  font-size: 2rem;
  float: left;
  overflow: hidden;
  background-color: #3a4242;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.role-1, .role-2 {
  float: none;
  margin: 0;
}

.role-item:hover {
  transform: scale(1.05);
  box-shadow: 0 .2rem .5rem rgba(0, 0, 0, 0.3), 0 1rem .5rem rgba(0, 0, 0, 0.22)
}

.role-title {
  padding: 25px 25px;
  height: 50%;
  width: 100%;
  font-size: 70%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: left;
  border-radius: 50%;
  margin: 0 auto;
}
#

probier mal so, ansonsten ka gerade pikachu_derpface

normal sundial
#

das hat geklappt was genau war es jetzt?

graceful fiber
#

eigentlich genau das was ich geschrieben habe davor 😅

#

kannst ja mal vergleichen

#

also eigentlich nur die flex direction und 2 schönheitsfehler behoben

normal sundial
#

unter schönheitsfehler die role-1 und role-2 oder xD jedenfalls finde ich nur das neben den flex column

graceful fiber
#

joa basically

normal sundial
#

okay

#

danke xD

graceful fiber
#

kein ding, gerne

#

viel erfolg noch

normal sundial
#

danke

normal sundial
#

mal eine frage zu dem einrichtungs video zum dashboard wenn man nicht ezcord nutzt sondern pycord und einen bot in einer main py hat ohne dass man die ezcord klasse hat wie baue ich das

def __init__(self):
        super().__init__(intents=discord.Intents.default())
        self.ipc = Server(self, secret_key="keks")

ein, normale über ein bot event?

solid ingot
#

du musst nur statt ezcord.Bot discord.Bot schreiben

normal sundial
#

trotzdem ene klasse erstellen?

solid ingot
#

würde ich empfehlen

normal sundial
#

okay

solid ingot
#

sind ja nur paar zeilen

normal sundial
#
Traceback (most recent call last):
  File "C:\Users\Angel\AppData\Local\Programs\Python\Python310\lib\site-packages\uvicorn\protocols\http\h11_impl.py", line 408, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
  File "C:\Users\Angel\AppData\Local\Programs\Python\Python310\lib\site-packages\uvicorn\middleware\proxy_headers.py", line 84, in __call__
    return await self.app(scope, receive, send)
  File "C:\Users\Angel\AppData\Local\Programs\Python\Python310\lib\site-packages\fastapi\applications.py", line 292, in __call__
    await super().__call__(scope, receive, send)
  File "C:\Users\Angel\AppData\Local\Programs\Python\Python310\lib\site-packages\starlette\applications.py", line 122, in __call__
    await self.middleware_stack(scope, receive, send)
  File "C:\Users\Angel\AppData\Local\Programs\Python\Python310\lib\site-packages\starlette\middleware\errors.py", line 184, in __call__    
    raise exc
  File "C:\Users\Angel\AppData\Local\Programs\Python\Python310\lib\site-packages\starlette\middleware\errors.py", line 162, in __call__    
    await self.app(scope, receive, _send)
  File "C:\Users\Angel\AppData\Local\Programs\Python\Python310\lib\site-packages\starlette\middleware\exceptions.py", line 79, in __call__ 
    raise exc
  File "C:\Users\Angel\AppData\Local\Programs\Python\Python310\lib\site-packages\starlette\middleware\exceptions.py", line 68, in __call__
    await self.app(scope, receive, sender)
  File "C:\Users\Angel\AppData\Local\Programs\Python\Python310\lib\site-packages\fastapi\middleware\asyncexitstack.py", line 20, in __call__
    raise e
  File "C:\Users\Angel\AppData\Local\Programs\Python\Python310\lib\site-packages\fastapi\middleware\asyncexitstack.py", line 17, in __call__
    await self.app(scope, receive, send)
  File "C:\Users\Angel\AppData\Local\Programs\Python\Python310\lib\site-packages\starlette\routing.py", line 718, in __call__
    await route.handle(scope, receive, send)
  File "C:\Users\Angel\AppData\Local\Programs\Python\Python310\lib\site-packages\starlette\routing.py", line 276, in handle
    await self.app(scope, receive, send)
  File "C:\Users\Angel\AppData\Local\Programs\Python\Python310\lib\site-packages\starlette\routing.py", line 66, in app
    async with connect(self.url) as conn:
  File "C:\Users\Angel\AppData\Local\Programs\Python\Python310\lib\site-packages\websockets\legacy\client.py", line 637, in __aenter__
    return await self
  File "C:\Users\Angel\AppData\Local\Programs\Python\Python310\lib\site-packages\websockets\legacy\client.py", line 655, in __await_impl_timeout__
    return await self.__await_impl__()
  File "C:\Users\Angel\AppData\Local\Programs\Python\Python310\lib\site-packages\websockets\legacy\client.py", line 659, in __await_impl__
    _transport, _protocol = await self._create_connection()
  File "C:\Users\Angel\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 1076, in create_connection
    raise exceptions[0]
  File "C:\Users\Angel\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 1060, in create_connection
    sock = await self._connect_sock(
  File "C:\Users\Angel\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 969, in _connect_sock
    await self.sock_connect(sock, address)
  File "C:\Users\Angel\AppData\Local\Programs\Python\Python310\lib\asyncio\selector_events.py", line 501, in sock_connect
    return await fut
  File "C:\Users\Angel\AppData\Local\Programs\Python\Python310\lib\asyncio\selector_events.py", line 541, in _sock_connect_cb
    raise OSError(err, f'Connect call failed {address}')
ConnectionRefusedError: [Errno 10061] Connect call failed ('127.0.0.1', 20000)

der error dürfte doch mit dem richtigen key nicht kommen oder?

def __init__(self):
        super().__init__(intents=discord.Intents.default())
        self.ipc = Server(self, secret_key="Keks")

oder muss alles in einem ordner liegen?

viscid lake
#

die bot.py soll beim main sein wo die routen sind

normal sundial
#

dann müsste ich ja die komplette alte bot main umbauen dachte es ginge in einem anderen ordner das dashboard zu bauen und den bot im alten ordner zu belassen

urban glen
#

@solid ingot Nein, ich mache nirgendwo DB = ???

#

oder sowas

solid ingot
#

also hast du keine Datenbanken in deinem code?

#

@urban glen

urban glen
#

doch

#

aber im on_ready use ich davon nix

solid ingot
#

schick code

urban glen
#

von was

#

von den on_ready events?

solid ingot
#

ne von den db zeilen

fierce dove
#

Wie kann ich das in GitHub readme einfügen

odd kiteBOT
#

Mein Discord Server
https://discord.gg/zfvbjTEzv6

Links aus diesem Video
Shields.iohttps://shields.io/
Stats ► https://github.com/anuraghazra/github-readme-stats

▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
Mein Hosting* ► https://tidd.ly/3gJufg6
Code auf Github ► https://github.com/tibue99/tutorial-bot

PYCORD
Docs ► https://docs.pycord.dev/
Guide ► https://g...

▶ Play video
fierce dove
#

Kannst du ein neue Video zu shields io

#

@solid ingot er findet das badge nicht

tawdry leaf
#

Cool

safe tendon
#
Task exception was never retrieved
future: <Task finished name='discord-ui-view-timeout-a415cd677c56ec30e2aa7b03d760f361' coro=<View.on_timeout() done, defined at /Volumes/coding/merl/venv/lib/python3.10/site-packages/discord/ui/view.py:364> exception=NotFound('404 Not Found (error code: 10008): Unknown Message')>
Traceback (most recent call last):
  File "/Volumes/coding/merl/venv/lib/python3.10/site-packages/discord/ui/view.py", line 373, in on_timeout
    m = await message.edit(view=self)
  File "/Volumes/coding/merl/venv/lib/python3.10/site-packages/discord/message.py", line 1479, in edit
    data = await self._state.http.edit_message(
  File "/Volumes/coding/merl/venv/lib/python3.10/site-packages/discord/http.py", line 367, in request
    raise NotFound(response, data)
discord.errors.NotFound: 404 Not Found (error code: 10008): Unknown Message

kann wer erklären was das heißt?

safe tendon
#

gibts ja laut dem error nicht

#

xd

#

sonst würde er ja eine line sagen wo es passier

native plume
#

m = await Message.edit(view=self)

native plume
safe tendon
#

guck mal wo das ist xd

#

site-packages

native plume
#

Also du hast das ^ nicht im Code?

placid trellis
#

die message die du bearbeiten willst existiert nicht

safe tendon
#

nope site-packages sind ja die packages von pip

#

aber egal fixe selber

native plume
#

Du könntest ja den Code schicken, bei dem der Error geraised wird

placid trellis
#

Unknown Message = Ungültige Nachricht

safe tendon
#

ach ne

placid trellis
#

heißt so viel wie die Nachricht wurde nicht gefunden

safe tendon
#

aber du weißt das da keine error line steht

native plume
placid trellis
#

m = await message.edit(view=self) ist dein Fehler

#

Du willst eine Nachricht bearbeiten die nicht gefunden wird

safe tendon
#

das was von pycord selbsrt

#

da es in site-packages passiert

native plume
safe tendon
#

gefunden

#

war ein invalid webhook

#

bei dem logging system

limpid wolf
safe tendon
#

hab mich schon gewunder

fierce dove
tawdry leaf
fierce dove
tawdry leaf
fierce dove
#

#

Du wolltest ein Beweis darum schau auf mein GitHub nach

ruby sparrow
#

import json
import discord
import ezcord


intents = discord.Intents.all()

activity = discord.CustomActivity('Wird programmiert bip bup bip')
bot = ezcord.PrefixBot(command_prefix='M?', intents=intents, activity=activity, status=discord.Status.idle)


def get_config(name):
    with open('config.json', 'r') as f:
        json_file = json.load(f)
        return json_file[name]


ezcord.custom_log('invalidace',
                  'Ich habe diesen Bot programmiert und ich kann sagen er ist sehr übersichtlich aufgebaut!')

if __name__ == "main":
    bot.load_cogs('prefix', 'admin', 'support', 'user', 'tasks','verification', 'role', log=ezcord.CogLog.default, log_color='blue')

    bot.run(get_config('token'))``` wieso start er bot nicht ?
urban glen
#

was hast du für ein fehler?

ruby sparrow
urban glen
#

token sicher?

ruby sparrow
#

ja