Example #1
0
        public bool InitRef(BuildContext context, CallExpression.ClassRef @ref)
        {
            switch (@ref.RefType)
            {
            case CallExpression.ClassRef.TypeId:
                if (ulong.TryParse(@ref.Value, out ulong id))
                {
                    Init(context.Guild.GetChannel(id));
                }
                break;

            case CallExpression.ClassRef.TypeStr:
                var chan = context.Guild.Channels.FirstOrDefault(c => c.Name == @ref.Value);
                if (chan != null)
                {
                    Init(chan);
                }
                break;
            }
            return(_channel != null);
        }
Example #2
0
 public bool InitRef(BuildContext context, CallExpression.ClassRef @ref) => false;