forked from adam/discord-bot-shtik
vassago is back to 0! sort of!
Some checks failed
gitea.arg.rip/vassago/pipeline/head There was a failure building this commit
Some checks failed
gitea.arg.rip/vassago/pipeline/head There was a failure building this commit
This commit is contained in:
parent
6881816c94
commit
d22faae2f6
@ -255,6 +255,7 @@ public class DiscordInterface
|
|||||||
else if (channel is IPrivateChannel)
|
else if (channel is IPrivateChannel)
|
||||||
{
|
{
|
||||||
c.ParentChannel = protocolAsChannel;
|
c.ParentChannel = protocolAsChannel;
|
||||||
|
Console.WriteLine("i'm a private channel so I'm setting my parent channel to the protocol as channel");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -262,11 +263,20 @@ public class DiscordInterface
|
|||||||
Console.Error.WriteLine($"trying to upsert channel {channel.Id}/{channel.Name}, but it's neither guildchannel nor private channel. shrug.jpg");
|
Console.Error.WriteLine($"trying to upsert channel {channel.Id}/{channel.Name}, but it's neither guildchannel nor private channel. shrug.jpg");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Console.WriteLine($"upsertion of channel {c.DisplayName}, it's type {c.ChannelType}");
|
||||||
switch (c.ChannelType)
|
switch (c.ChannelType)
|
||||||
{
|
{
|
||||||
case vassago.Models.Enumerations.ChannelType.DM:
|
case vassago.Models.Enumerations.ChannelType.DM:
|
||||||
var asPriv =(channel as IPrivateChannel);
|
var asPriv =(channel as IPrivateChannel);
|
||||||
c.DisplayName = "DM: " + asPriv?.Recipients?.FirstOrDefault(u => u.Id != client.CurrentUser.Id).Username;
|
var sender = asPriv?.Recipients?.FirstOrDefault(u => u.Id != client.CurrentUser.Id); // why yes, there's a list of recipients, and it's the sender.
|
||||||
|
if(sender != null)
|
||||||
|
{
|
||||||
|
c.DisplayName = "DM: " + sender.Username;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//I sent it, so I don't know the recipient's name.
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
c.DisplayName = channel.Name;
|
c.DisplayName = channel.Name;
|
||||||
|
Loading…
Reference in New Issue
Block a user