Answer the question
In order to leave comments, you need to log in
How to call a non-static method?
There is a code:
static async void Bot_OnMessage(object sender, MessageEventArgs e)
{
Head hd = new Head();
if (e.Message.Text != null && e.Message.Chat.Id == myChatId)
{
await botClient.SendTextMessageAsync(
chatId: myChatId,
text: "You said:\n" + e.Message.Text
);
hd.writeLog("sdgergergreg");
}
}
public void writeLog(string text)
{
logText.Text = logText.Text + DateTime.Now + text // + "\n";
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question