C
C#2y ago
TAXI

❔ cant use variable in respond async

hello i am new to c# I have a invite command for my discord bot but it gives me a error when i put my variable inside respondasync

public async Task invite()
{
var defaultChannel = await Context.Guild.DefaultChannel.CreateInviteAsync();



await RespondAsync(defaultChannel)`;

public async Task invite()
{
var defaultChannel = await Context.Guild.DefaultChannel.CreateInviteAsync();



await RespondAsync(defaultChannel)`;
10 Replies
TAXI
TAXIOP2y ago
how do i have it not do that? when i put some text and my variable in respond astync it works but I dont want to do that
SG97
SG972y ago
if you have errors, post them
TAXI
TAXIOP2y ago
i have another erorr now fror a different command
Non-invocable member 'SocketGuild.IconUrl' cannot be used like a method.
Non-invocable member 'SocketGuild.IconUrl' cannot be used like a method.
why cant I just combined 2 variables to fix it
TAXI
TAXIOP2y ago
TAXI
TAXIOP2y ago
I want to format a image as
(ImageFormat.Auto, Size: 2048);
(ImageFormat.Auto, Size: 2048);
TAXI
TAXIOP2y ago
this is what my command looked like before and i thought i could just combined 2 variables to fix something lol
JakenVeina
JakenVeina2y ago
why would you think you can do that Not trying to be mean, I mean that literally. What aspect of the C# language do you have in mind that led you to think that was valid? there either isn't one, indicating that you need to work on your C# language fundamentals, or at least work on thinking through problems more directly or there is one, and you're misunderstanding how it works, and we can explore that
˞˞˞˞˞˞˞˞˞˞˞˞˞˞˞˞˞˞˞˞
Bro help him, don't teach him something different
JakenVeina
JakenVeina2y ago
I'm not trying to teach him something different I'm trying to teach him why that's invalid syntax that is the help
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server