Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ITextChannel lacks getter for AutoArchiveDuration #2257

Closed
TheKrush opened this issue Apr 23, 2022 · 4 comments · Fixed by #2295
Closed

ITextChannel lacks getter for AutoArchiveDuration #2257

TheKrush opened this issue Apr 23, 2022 · 4 comments · Fixed by #2295
Assignees
Labels

Comments

@TheKrush
Copy link

TheKrush commented Apr 23, 2022

await textChannel.ModifyAsync(x => x.AutoArchiveDuration = threadArchiveDuration);

ITextChannel can modify the value but has no way of fetching the current value.

version 3.5

@Spider570
Copy link

Spider570 commented Apr 23, 2022

If you cast the channel as an IThreadChannel then you can get that property.

Example:
var duration = (textChannel as IThreadChannel).AutoArchiveDuration

@TheKrush
Copy link
Author

If you cast the channel as an IThreadChannel then you can get that property.

Example: var duration = (textChannel as IThreadChannel).AutoArchiveDuration

Does that work on non-threads?

image

Like would it work on "high-times-bar-grill" ?

@TheKrush
Copy link
Author

Yeah if you try that on a normal text channel, it returns null. But discord definitely has the value on them as the client shows it.

@TheKrush
Copy link
Author

image
It also appears that using it in the ModifyAsync call also doesn't work. But here it is marked in the discord client showing it's an option for a channel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants