#converting ticket system to a cog

1 messages · Page 1 of 1 (latest)

upbeat vapor
#

few things are broken and not sure on fixes for them

#
Traceback (most recent call last):
  File "C:\Users\philc\Desktop\venvs\artybot20\lib\site-packages\discord\ui\view.py", line 371, in _scheduled_task
    await item.callback(interaction)
  File "c:\Users\philc\Desktop\ABotV2\src\cogs\medbay.py", line 179, in button_two_callback
    await bot.get_channel(loaticket.id).send(embed=embed, view=medbaysubmitButtonsView(loaticket))
AttributeError: 'NoneType' object has no attribute 'send```
#
await bot.get_channel(loaticket.id).send(embed=embed, view=medbaysubmitButtonsView(loaticket))
tranquil perch
#

You have an invalid channel id

potent arch
#
dd = await bot.get_guild(id).get_channel(id)
dd.send(embed=embed, view=medbaysubmitButtonsView(loaticket))

Would you like to try this??

tranquil perch
#

Or are missing intents

potent arch
#

oh

#

send_message?

tranquil perch
#

do you have any idea what you're talking about

potent arch
#

Is it an intent issue?

tranquil perch
#

Possibly

torpid trout
upbeat vapor
#
Ignoring exception in view <MedbayButtonsView timeout=None children=2> for item <Button style=<ButtonStyle.secondary: 2> url=None disabled=False label='LOA' emoji=None row=None>:
Traceback (most recent call last):
  File "C:\Users\philc\Desktop\venvs\artybot20\lib\site-packages\discord\ui\view.py", line 371, in _scheduled_task
    await item.callback(interaction)
  File "c:\Users\philc\Desktop\ABotV2\src\cogs\medbay.py", line 182, in button_two_callback
    dd = await bot.get_guild(881207955029110855).get_channel(loaticket.id)
AttributeError: 'NoneType' object has no attribute 'get_channel'
upbeat vapor
torpid trout
#

Don't get the guild

#

Also if that isnt working try this

ch = await bot.fetch_channel(Id)
Await ch.send(...)
upbeat vapor
#

wouldnt it be self.bot...

torpid trout
upbeat vapor
#

Yes

#

I just tested getting the channel id and that worked fine but the send isn’t

torpid trout
#

Are u sure the channel is a valid channel ID?

upbeat vapor
#

pretty sure

upbeat vapor
#

the ticket id is valid

#

but it doesnt get created in the category

torpid trout
#

Ok

upbeat vapor
#

now its just putting it in the right category now