Discord.Net/docs/guides/entities/samples/casting.cs

8 lines
351 B
C#
Raw Normal View History

2024-06-12 22:43:59 -07:00
// Say we have an entity; for the simplicity of this example, it will appear from thin air.
IChannel channel;
// If we want this to be an ITextChannel so we can access the properties of a text channel inside of a guild, an approach would be:
ITextChannel textChannel = channel as ITextChannel;
await textChannel.DoSomethingICantWithIChannelAsync();