mirror of
https://github.com/Jetsparrow/jetherald.git
synced 2026-01-21 07:56:09 +03:00
Turn GetTopicListing to ToString for Db.Topic
This commit is contained in:
parent
04a04f418c
commit
7fffbbe365
@ -67,7 +67,7 @@ namespace JetHerald
|
||||
var topics = await db.GetTopicsForChat((long)ctx.Channel.Id, "Discord");
|
||||
|
||||
await ctx.RespondAsync(topics.Any()
|
||||
? "Topics:\n" + string.Join("\n", topics.Select(ListCommand.GetTopicListing))
|
||||
? "Topics:\n" + string.Join("\n", topics)
|
||||
: "No subscriptions active.");
|
||||
}
|
||||
|
||||
|
||||
@ -20,12 +20,8 @@ namespace JetHerald
|
||||
var topics = await db.GetTopicsForChat(chatid, "Telegram");
|
||||
|
||||
return topics.Any()
|
||||
? "Topics:\n" + string.Join("\n", topics.Select(GetTopicListing))
|
||||
? "Topics:\n" + string.Join("\n", topics)
|
||||
: "No subscriptions active.";
|
||||
}
|
||||
|
||||
internal static string GetTopicListing(Db.Topic t)
|
||||
=> t.Name == t.Description ? t.Name : $"{t.Name}: {t.Description}";
|
||||
|
||||
}
|
||||
}
|
||||
@ -25,6 +25,9 @@ namespace JetHerald
|
||||
|
||||
public long? ChatId { get; set; }
|
||||
public string Service { get; set; }
|
||||
|
||||
public override string ToString()
|
||||
=> Name == Description ? Name : $"{Name}: {Description}";
|
||||
}
|
||||
|
||||
public class ExpiredTopicChat
|
||||
|
||||
Loading…
Reference in New Issue
Block a user