Discord.Net/docs/guides/entities/samples/casting.cs
2024-06-13 17:43:59 +12:00

7 lines
351 B
C#

// 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();