❔ Need help with var

Hello
5 Replies
Professor Chen
Professor ChenOP2y ago
i need help i ave error with bot.Ticket , NebulaProfile , Nebulatoken why
Angius
Angius2y ago
BotList seems to be a list of tuples You deconstruct them inside of that foreach So... use the variables you deconstructed the tuples into Ah, wait, later on you're trying to access the elements outside of the foreach Well, in that case, those tuples aren't deconstructed And they're also unnamed, because you didn't name them So there's only .Item1, .Item2, .Item3 and .Item4 properties Not .Ticket, .NebulaProfile, and .NebulaToken Either: a) use .ItemX b) Use a named tuple c) PREFERABLY use a class or a record instead of a tuple
Professor Chen
Professor ChenOP2y ago
ok thx var bot = BotList.FirstOrDefault(); if (bot != null) { CS_WM(bot.NebulaProfile, bot.NebulaToken, botTickets); } so i just change the line to this
Angius
Angius2y ago
No Your bot is an unnamed tuple It doesn't have .NebulaProfile property Read what I wrote again
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