dolfies / discord.py-self

A fork of the popular discord.py for user accounts.
https://discordpy-self.rtfd.io/en/latest/
MIT License
665 stars 155 forks source link

Can't create invite #497

Closed gamie0412 closed 1 year ago

gamie0412 commented 1 year ago

Summary

When i try to create an invite it gives an error

Reproduction Steps

The variable generalchannel is a discord channel i got with client.get_channel(id), this part works, because i can send messages to it

I tried to make an invite to the channel but that doesn't work

Code

link = await generalchannel.create_invite(max_age=25200, max_uses=1)
print(link)

Expected Results

It's supposed to print the link (i'm pretty sure this part works when i try it on an actual bot)

Actual Results

Ignoring exception in on_ready Traceback (most recent call last): File "main.py", line 294, in on_ready link = await generalchannel.create_invite(max_age=25200, max_uses=1) File "C:\Users\User\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\abc.py", line 881, in create_invite return Invite.from_incomplete(data=data, state=self._state) File "C:\Users\User\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\invite.py", line 316, in from_incomplete guild_id = int(data['guild']['id']) TypeError: string indices must be integers

System Information

Checklist

Additional Information

I'm pretty sure this works on a bot account.

dolfies commented 1 year ago

Unable to reproduce.