X-Git-Url: https://git.0d.be/?p=barnard.git;a=blobdiff_plain;f=ui.go;fp=ui.go;h=c1dc6a897b39cd69da5c564142c8c770ced6da4b;hp=b45479f5f46251f3918626303d879c9971a9fea1;hb=b56133e03344cfcb80f7a50d2bdcc9c9b513fb4a;hpb=e336d47fc50d045f911116ca302ab2d9c3dc0a26 diff --git a/ui.go b/ui.go index b45479f..c1dc6a8 100644 --- a/ui.go +++ b/ui.go @@ -39,7 +39,7 @@ func (b *Barnard) AddOutputMessage(sender *gumble.User, message string) { if sender == nil { b.AddOutputLine(message) } else { - b.AddOutputLine(fmt.Sprintf("%s: %s", sender.Name(), strings.TrimSpace(esc(message)))) + b.AddOutputLine(fmt.Sprintf("%s: %s", sender.Name, strings.TrimSpace(esc(message)))) } } @@ -96,9 +96,9 @@ func (b *Barnard) OnTextInput(ui *uiterm.Ui, textbox *uiterm.Textbox, text strin if text == "" { return } - if b.Client != nil && b.Client.Self() != nil { - b.Client.Self().Channel().Send(text, false) - b.AddOutputMessage(b.Client.Self(), text) + if b.Client != nil && b.Client.Self != nil { + b.Client.Self.Channel.Send(text, false) + b.AddOutputMessage(b.Client.Self, text) } }